Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

IPCEventTranslator Class Reference

#include <EventTranslator.h>

Inheritance diagram for IPCEventTranslator:

List of all members.


Detailed Description

An implementation of EventTranslator which will forward events using the inter-process mechanisms of the current platform.

The current implementation creates an RCRegion for each event and then releases its reference to the region after it is sent. A more efficient implementation might retain a queue of recycled RCRegions to reduce allocation costs

Definition at line 110 of file EventTranslator.h.


Public Types

typedef MessageQueueBase IPCSender_t
 the class for sending IPC messages on unix-based systems

Public Member Functions

 IPCEventTranslator (IPCSender_t &subj)
 constructor
virtual void encodeEvent (const EventBase &event, bool onlyReady=false)
 extends base class's implementation to store event.getName() into curName

Protected Member Functions

virtual char * bufferRequest (unsigned int size)
 Called by encodeEvent() to request a buffer for serializing into, must be at least size.
virtual void post (const char *buf, unsigned int size, bool onlyReady)
 Called by encodeEvent() after serialization is complete for communication to other processes.

Protected Attributes

IPCSender_tsubject
 where to post messages upon serialization, set by constructor
RCRegioncurRegion
 the region currently being serialized into, only valid between call to bufferRequest() and following post()
std::string curName
 name of current event being posted (for error messages)

Private Member Functions

 IPCEventTranslator (const IPCEventTranslator &)
 don't call
IPCEventTranslator operator= (const IPCEventTranslator &)
 don't call

Member Typedef Documentation

the class for sending IPC messages on unix-based systems

Definition at line 116 of file EventTranslator.h.


Constructor & Destructor Documentation

IPCEventTranslator::IPCEventTranslator ( IPCSender_t subj  )  [inline, explicit]

constructor

Definition at line 120 of file EventTranslator.h.

IPCEventTranslator::IPCEventTranslator ( const IPCEventTranslator  )  [private]

don't call


Member Function Documentation

virtual void IPCEventTranslator::encodeEvent ( const EventBase event,
bool  onlyReady = false 
) [inline, virtual]

extends base class's implementation to store event.getName() into curName

Reimplemented from EventTranslator.

Definition at line 123 of file EventTranslator.h.

char * IPCEventTranslator::bufferRequest ( unsigned int  size  )  [protected, virtual]

Called by encodeEvent() to request a buffer for serializing into, must be at least size.

This buffer will then be sent to post(), which should free it (or recycle it for usage by a later bufferRequest())

Implements EventTranslator.

Definition at line 70 of file EventTranslator.cc.

void IPCEventTranslator::post ( const char *  buf,
unsigned int  size,
bool  onlyReady 
) [protected, virtual]

Called by encodeEvent() after serialization is complete for communication to other processes.

Parameters:
buf the data to be sent, will be a buffer previously requested from bufferRequest
size the number of bytes to send
onlyReady if true, only send the event to observers which do not have any message backlog (if supported by transfer mechanism)
You will always get this callback after each call to bufferRequest(), even in the event of an error during saving. If an error occured, the callback will receive 0 for size.

Implements EventTranslator.

Definition at line 82 of file EventTranslator.cc.

IPCEventTranslator IPCEventTranslator::operator= ( const IPCEventTranslator  )  [private]

don't call


Member Data Documentation

where to post messages upon serialization, set by constructor

Definition at line 132 of file EventTranslator.h.

Referenced by post().

the region currently being serialized into, only valid between call to bufferRequest() and following post()

Definition at line 133 of file EventTranslator.h.

Referenced by bufferRequest(), and post().

std::string IPCEventTranslator::curName [protected]

name of current event being posted (for error messages)

Definition at line 134 of file EventTranslator.h.

Referenced by encodeEvent(), and post().


The documentation for this class was generated from the following files:

Tekkotsu v4.0
Generated Thu Nov 22 00:58:27 2007 by Doxygen 1.5.4