KMessageDirect Class Reference

#include <kmessageio.h>

Inheritance diagram for KMessageDirect:

KMessageIO List of all members.

Detailed Description

This class implements the message communication using function calls directly.

It can only be used when both sides of the message pipe are within the same process. The communication is very fast.

To establish a communication, you have to create two instances of KMessageDirect, the first one with no parameters in the constructor, the second one with the first as parameter:

/code KMessageDirect *peer1, *peer2; peer1 = new KMessageDirect (); // unconnected peer2 = new KMessageDirect (peer1); // connect with peer1 /endcode

The connection is only closed when one of the instances is deleted.

Definition at line 295 of file kmessageio.h.


Public Member Functions

 KMessageDirect (KMessageDirect *partner=0, QObject *parent=0, const char *name=0)
 ~KMessageDirect ()
virtual int rtti () const
bool isNetwork () const
bool isConnected () const
void send (const QByteArray &msg)

Protected Attributes

KMessageDirectmPartner

Constructor & Destructor Documentation

KMessageDirect::KMessageDirect ( KMessageDirect partner = 0,
QObject *  parent = 0,
const char *  name = 0 
)

Creates an object and connects it to the object given in the first parameter.

Use 0 as first parameter to create an unconnected object, that is later connected.

If that object is already connected, the object remains unconnected.

Definition at line 180 of file kmessageio.cpp.

KMessageDirect::~KMessageDirect (  ) 

Destructor, closes the connection.

Definition at line 202 of file kmessageio.cpp.


Member Function Documentation

virtual int KMessageDirect::rtti (  )  const [inline, virtual]

The runtime idendifcation.

Reimplemented from KMessageIO.

Definition at line 318 of file kmessageio.h.

bool KMessageDirect::isNetwork (  )  const [inline, virtual]

Returns:
FALSE as this is no network IO.

Reimplemented from KMessageIO.

Definition at line 324 of file kmessageio.h.

bool KMessageDirect::isConnected (  )  const [virtual]

Returns true, if the object is connected to another instance.

If you use the first constructor, the object is unconnected unless another object is created with this one as parameter.

The connection can only be closed by deleting one of the objects.

Reimplemented from KMessageIO.

Definition at line 211 of file kmessageio.cpp.

void KMessageDirect::send ( const QByteArray &  msg  )  [virtual]

Overwritten slot method from KMessageIO.

Note: It is not declared as a slot method, since the slot is already defined in KMessageIO as a virtual method.

Implements KMessageIO.

Definition at line 216 of file kmessageio.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys