#include <kmessageio.h>

Public Member Functions | |
KMessageDirect (KMessageDirect *partner=0, TQObject *parent=0, const char *name=0) | |
~KMessageDirect () | |
virtual int | rtti () const |
bool | isNetwork () const |
bool | isConnected () const |
void | send (const TQByteArray &msg) |
![]() | |
KMessageIO (TQObject *parent=0, const char *name=0) | |
~KMessageIO () | |
virtual int | rtti () const |
virtual bool | isNetwork () const |
virtual bool | isConnected () const |
void | setId (TQ_UINT32 id) |
TQ_UINT32 | id () |
virtual TQ_UINT16 | peerPort () const |
virtual TQString | peerName () const |
Protected Attributes | |
KMessageDirect * | mPartner |
![]() | |
TQ_UINT32 | m_id |
Additional Inherited Members | |
![]() | |
virtual void | send (const TQByteArray &msg)=0 |
![]() | |
void | received (const TQByteArray &msg) |
void | connectionBroken () |
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 297 of file kmessageio.h.
Constructor & Destructor Documentation
◆ KMessageDirect()
KMessageDirect::KMessageDirect | ( | KMessageDirect * | partner = 0 , |
TQObject * | 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::~KMessageDirect | ( | ) |
Destructor, closes the connection.
Definition at line 202 of file kmessageio.cpp.
Member Function Documentation
◆ isConnected()
|
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.
◆ isNetwork()
|
inlinevirtual |
- Returns
- false as this is no network IO.
Reimplemented from KMessageIO.
Definition at line 327 of file kmessageio.h.
◆ rtti()
|
inlinevirtual |
The runtime idendifcation.
Reimplemented from KMessageIO.
Definition at line 321 of file kmessageio.h.
◆ send()
|
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.
Member Data Documentation
◆ mPartner
|
protected |
Definition at line 348 of file kmessageio.h.
The documentation for this class was generated from the following files: