EventTranslator Class Reference#include <EventTranslator.h>
Inheritance diagram for EventTranslator:
[legend]List of all members.
Detailed Description
EventTranslator receives events from EventRouters in non-Main processes and adds them into a SharedQueue for Main to pick up.
The SharedQueue which the processes should set up and then pass to this object is defined by TranslatorSharedQueue_t - it allows 100 entries totalling 3KB of space. You can modify the type to change the capacity, but if you're making that many events that between Main's calls to translateEvents() you might want to rethink a few things...
EventTranslator only handles LocomotionEvent, VisionObjectEvent, and TextMsgEvent subtypes for the moment. Anything else is only handled as an EventBase class. (so extra fields aren't going to be stored) It's easy to add more types if you need to send them from other processes (that's the whole point of this class!)
Reason for doing it this way: Avoids OPENR message lag time (4-8ms in our testing), also avoids problems with RTTI stored in classes from different processes.
Definition at line 21 of file EventTranslator.h.
Member Typedef Documentation
|
Use this type to set up the shared queue between processes.
Definition at line 27 of file EventTranslator.h. |
Member Enumeration Documentation
|
an ID is inserted before the event data in the queue so we can tell which subclass it is
(quickly, could look at the creator code which is stored, but that's a text string) - Enumeration values:
-
EventBase_ID |
|
LocomotionEvent_ID |
|
VisionObjectEvent_ID |
|
TextMsgEvent_ID |
|
Definition at line 31 of file EventTranslator.h. |
Constructor & Destructor Documentation
EventTranslator::EventTranslator |
( |
|
) |
[inline] |
|
Member Function Documentation
void EventTranslator::enqueue |
( |
const EventBase & |
event |
) |
[inline] |
|
|
called by non-MotionCommands to enqueue an event
Definition at line 43 of file EventTranslator.h. |
void EventTranslator::sendEvent |
( |
const void * |
buf, |
|
|
unsigned int |
size |
|
) |
[static, protected] |
|
void EventTranslator::setQueue |
( |
Queue_t * |
q |
) |
[inline] |
|
void EventTranslator::translateEvents |
( |
|
) |
|
|
bool EventTranslator::trapEvent |
( |
const EventBase & |
event |
) |
[virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following files:
|