• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

Public Member Functions | Protected Attributes | List of all members
KMessageDirect Class Reference

#include <kmessageio.h>

Inheritance diagram for KMessageDirect:
KMessageIO

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)
 
- Public Member Functions inherited from KMessageIO
 KMessageIO (TQObject *parent=0, const char *name=0)
 
 ~KMessageIO ()
 
void setId (TQ_UINT32 id)
 
TQ_UINT32 id ()
 
virtual TQ_UINT16 peerPort () const
 
virtual TQString peerName () const
 

Protected Attributes

KMessageDirect * mPartner
 
- Protected Attributes inherited from KMessageIO
TQ_UINT32 m_id
 

Additional Inherited Members

- Public Slots inherited from KMessageIO
- Signals inherited from KMessageIO
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()

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.

◆ isNetwork()

bool KMessageDirect::isNetwork ( ) const
inlinevirtual
Returns
false as this is no network IO.

Reimplemented from KMessageIO.

Definition at line 327 of file kmessageio.h.

◆ rtti()

virtual int KMessageDirect::rtti ( ) const
inlinevirtual

The runtime idendifcation.

Reimplemented from KMessageIO.

Definition at line 321 of file kmessageio.h.

◆ send()

void KMessageDirect::send ( const TQByteArray &  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:
  • kmessageio.h
  • kmessageio.cpp

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.1
This website is maintained by Timothy Pearson.