Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

EventBase Class Reference

#include <EventBase.h>

Inheritance diagram for EventBase:

Inheritance graph
[legend]
List of all members.

Detailed Description

Forms the basis of communication between modules/behaviors in the framework.

Events are defined by a 3-tuple:

  • The generator indicates the class of the creator of the event, and in practice also generally implies the type (i.e. subclass) of the event itself.
  • The source indicates the instance of the creator of the event, which differentiates when more than one generator is available.
  • The type indicates the role of the event among other events from the source.

Each of these is represented by an ID, the EventGeneratorID_t (EGID) and EventTypeID_t (ETID) are defined here in EventBase. Source IDs (SID) are defined separately by each generator, so the documentation in each entry of EventGeneratorID_t describes how to interpret the source field.

So for example, the button event which results from initially pressing the head button on an ERS-7 robot would be:

(EventBase::buttonEGID, ERS7Info::HeadButOffset, EventBase::activateETID)

While the button is held down, additional statusETID events are used to report varying pressure values (if the button is pressure sensitive), and an event with deactivateETID is sent when the button is released. Alternatively, an SID value from a vision detector (say visObjEGID) refers to seeing a particular object, a completely different domain, values of which may overlap with other generators' source IDs. Thus, interpreting the source field requires knowing the generator as well.

When the generator doesn't have groups of activity with a 'begin' or 'end', it will use statusETID for all of its events. (in other words, not all generators necessarily have to use activate or deactivate) For example, sensor updates are continuously occuring, so you will only ever see

(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID)

The duration field is also generator specific - some may refer to the time since the last activation event (e.g. button events) where as others refer to time since last status (e.g. sensors updates)

If you want to make a new generator, all you have to do is add a new entry to the ID list (EventGeneratorID_t) and then put its name in the EventGeneratorNames[] array. Alternatively, there is an 'unlicensed spectrum' available under unknownEGID. You can send out events from that generator just like any other, but it should only be used for quick tests and hacking around...

The generator ID number is only that -- an ID number. Events can be posted to the EventRouter anywhere, anytime, and do not require anything of the sender. However, there is an EventGeneratorBase which can simplify some aspects of behaviors whose sole purpose is processing information and generating events.

If more information needs to be sent along with the event, the cleanest solution is to create a subclass of EventBase to hold the additional information. For example, you can see the existing subclasses in the inheritance diagram above. If you want to use a quick hack however, you could just pass a pointer to data as the SID if you don't need that field for something else, or use a DataEvent.

Note:
All subclasses must override getClassTypeID() and provide a unique value to allow fast polymorphic serialization for inter-process communication. Implementing the load/save functions ({load,save}BinaryBuffer and {load,save}XML) for your addtional data fields would also be necessary in order to allow your event to be sent between processes, or eventually, between robots.
See also:
EventRouter for discussion on sending and receiving of events

Tutorials:

Definition at line 74 of file EventBase.h.

LoadSave interface

Useful for serializing events to send between processes

enum  SaveFormat { BINARY, XML }
 values to pass to setSaveFormat() More...
virtual unsigned int getClassTypeID () const
 All subclasses should override this and return a unique ID for their class.
virtual unsigned int getBinSize () const
 should return the minimum size needed if using binary format (i.e. not XML)
virtual unsigned int loadBinaryBuffer (const char buf[], unsigned int len)
 load from binary format
virtual unsigned int saveBinaryBuffer (char buf[], unsigned int len) const
 save to binary format
virtual void loadXML (xmlNode *node)
 load from XML format
virtual void saveXML (xmlNode *node) const
 save to XML format
virtual unsigned int loadBuffer (const char buf[], unsigned int len)
 no longer need to override this -- will automatically call either loadXML() or loadBinaryBuffer() based on saveFormat
virtual unsigned int saveBuffer (char buf[], unsigned int len) const
 no longer need to override this -- will automatically call either saveXML() or saveBinaryBuffer() based on saveFormat
virtual unsigned int loadFile (const char *filename)
 automatically calls either XMLLoadSave::loadFile or LoadSave::loadFile based on saveFormat
virtual unsigned int saveFile (const char *filename) const
 automatically calls either XMLLoadSave::saveFile or LoadSave::saveFile based on saveFormat
virtual unsigned int loadFileStream (FILE *f)
 automatically calls either XMLLoadSave::loadFileStream or LoadSave::loadFileStream based on saveFormat
virtual unsigned int saveFileStream (FILE *f) const
 automatically calls either XMLLoadSave::loadFileStream or LoadSave::loadFileStream based on saveFormat
virtual void setSaveFormat (SaveFormat sf) const
 set saveFormat
virtual SaveFormat getSaveFormat () const
 return saveFormat

Methods

virtual const std::string & getName () const
 gets the name of the event - useful for debugging output, see also getDescription()
virtual EventBasesetName (const std::string &n)
 sets name to a given string, prevents overwriting by generated names
virtual float getMagnitude () const
 gets "strength" of event - by default 1 for activate and status events, 0 for deactivate events
virtual EventBasesetMagnitude (float m)
 sets "strength" of event - you may want to override the default values (see getMagnitude())
virtual unsigned int getTimeStamp () const
 time event was created
virtual void setTimeStamp (unsigned int t)
 resets time event was created
virtual EventGeneratorID_t getGeneratorID () const
 gets the generator ID for this event
virtual EventBasesetGeneratorID (EventGeneratorID_t gid)
 sets the generator ID for this event
virtual unsigned int getSourceID () const
 gets the source ID for this event
virtual EventBasesetSourceID (unsigned int sid)
 sets the source ID for this event
virtual EventTypeID_t getTypeID () const
 gets the type ID
virtual EventBasesetTypeID (EventTypeID_t tid)
 sets the type ID
virtual int getHostID () const
 gets the name of the event - useful for debugging output, see also getDescription()
virtual EventBasesetHostID (int host)
 gets the name of the event - useful for debugging output, see also getDescription()
virtual unsigned int getDuration () const
 gets the time since the beginning of this sequence (the timestamp of the activate event)
virtual EventBasesetDuration (unsigned int d)
 sets the time since the beginning of this sequence (the timestamp of the activate event)
virtual const std::string & resetName ()
 resets name to generated form, overwriting any previous name
virtual bool isCustomName () const
 returns true if not using the generated name
virtual std::string getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const
 generates a description of the event with variable verbosity
bool operator< (const EventBase &e) const
 gets the name of the event - useful for debugging output, see also getDescription()
virtual bool operator== (const EventBase &eb) const
 is true if the genID, typeID, and sourceID's all match
bool sameGenSource (const EventBase &eb) const
 tests to see if events have the same generator and source IDs
bool longerThan (const EventBase &eb) const
 compares event duration and ensures same event generator, source, and type - useful for event masks
bool shorterThan (const EventBase &eb) const
 compares event duration and ensures same event generator, source, and type - useful for event masks
bool equalOrLongerThan (const EventBase &eb) const
 compares event duration and ensures same event generator, source, and type - useful for event masks
bool equalOrShorterThan (const EventBase &eb) const
 compares event duration and ensures same event generator, source, and type - useful for event masks
static bool isValidGeneratorID (unsigned int egid)
 gets the name of the event - useful for debugging output, see also getDescription()

Public Types

 unknownEGID = 0
 default EGID, used if you forget to set it, probably not a good idea to use this for anything except errors or testing quick hacks
 aiEGID
 not being used, yet (might use this when AI makes decisions?)
 audioEGID
 Sends an event when a sound starts/ends playback, status events as chained sounds end; SID is SoundManager::Play_ID; duration is playtime.
 buttonEGID
 Sends activate event for button down, deactivate for button up. Status events only for when pressure sensitive buttons' reading changes. (on sensorEGID updates); SIDs are from ButtonOffset_t in the namespace of the target model (e.g. ERS210Info::ButtonOffset_t); duration is button down time.
 erouterEGID
 Sends activate event on first listener, deactivate on last listener, and status on other listener changes.; SID is the generator ID affected.
 estopEGID
 Sends an event when the estop is turned on or off; SID is the MotionManager::MC_ID of the EmergencyStopMC; duration is length of estop activation.
 locomotionEGID
 Sends events regarding transportation in the world; you can/should assume these will all be LocomotionEvent classes; SID is MotionManager::MC_ID of posting MotionCommand; duration is the time since last velocity change of that MC. (You could generate these for things other than walking...).
 lookoutEGID
 Sends an event when Lookout request is complete; SID is the id for lookout request.
 mapbuilderEGID
 Sends a status event when map is completed.
 micOSndEGID
 Sends a DataEvent<OSoundVectorData> for every audio buffer received from the system; SID and duration are always 0 (This is generated by the MainObj instantiation of MMCombo).
 micRawEGID
 reserved for future use
 micFFTEGID
 reserved for future use
 micPitchEGID
 Sends a PitchEvent when a particular frequency is detected; SID is a pointer to the PitchDetector, magnitude is product of amplitude and confidence.
 motmanEGID
 Sends events when a MotionCommand is added or removed, SID is is the MotionManager::MC_ID, duration is always 0; individual MotionCommands may throw status events to signal intermediary status.
 pilotEGID
 Sends events when position of agent is updated or pilot request is completed.
 powerEGID
 Sends events for low power warnings, temperature, etc. see PowerSourceID::PowerSourceID_t.
 sensorEGID
 Sends a status event when new sensor readings are available. see SensorSourceID::SensorSourceID_t.
 stateMachineEGID
 Sends an event upon entering and leaving a StateNode; SID is pointer to the StateNode; duration is always 0; some state will throw a status event when they have completed their task and are now idling.
 stateSignalEGID
 Sends a DataEvent that can be monitored by a SignalTrans for triggering a state transition.
 stateTransitionEGID
 Sends an event each time a transition is triggered; SID is a pointer to the transition; type is always status, duration is always 0; guaranteed to occur immediately *before* the transition actually occurs.
 textmsgEGID
 Sends status events when a text msg is received on console; generated by the Controller, SID is 0 if broadcast from ControllerGUI, 1 if "private" from BehaviorSwitchControl; duration is always 0 (see Controller for more information).
 timerEGID
 Sends timer events; you set timers explicitly, you don't have to listen as well. (See EventRouter::addTimer()) There's no cross-talk, only the listener which requested the timer will receive it; SID is whatever you requested it to be; duration is the time (since boot, in ms) that the timer was supposed to go off; these are always status.
 visOFbkEGID
 Sends a DataEvent < OFbkImageVectorData > for every camera image received from the system; SID and duration are always 0 (This is generated by the MainObj instantiation of MMCombo).
 visRawCameraEGID
 Sends a FilterBankEvent when new raw camera images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visInterleaveEGID
 Sends a FilterBankEvent when new interleaved images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visJPEGEGID
 Sends a FilterBankEvent when JPEG compressed images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visPNGEGID
 Sends a FilterBankEvent when PNG compressed images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visSegmentEGID
 Sends a SegmentedColorFilterBankEvent when color segmentated images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visRLEEGID
 Sends a SegmentedColorFilterBankEvent when RLE encoded color segmentated images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visRegionEGID
 Sends a SegmentedColorFilterBankEvent when color regions are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 visObjEGID
 Sends VisionObjectEvents for objects detected in camera images; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
 wmVarEGID
 Sends an event when a watched memory is changed; source id is pointer to WMEntry.
 worldModelEGID
 not being used, yet (for when objects are detected/lost?)
 remoteStateEGID
 Sent when remote state is updated.
 numEGIDs
 the number of generators available
 activateETID
 Start of an event sequence, e.g. button down.
 statusETID
 Indicates a value has changed, e.g. new sensor readings.
 deactivateETID
 Last of a series of events, e.g. button up.
 numETIDs
 the number of different event types
 BINARY
 saves will be in packed binary, loads will try binary first
 XML
 saves will be in xml, loads will try xml first
enum  EventGeneratorID_t {
  unknownEGID = 0, aiEGID, audioEGID, buttonEGID,
  erouterEGID, estopEGID, locomotionEGID, lookoutEGID,
  mapbuilderEGID, micOSndEGID, micRawEGID, micFFTEGID,
  micPitchEGID, motmanEGID, pilotEGID, powerEGID,
  sensorEGID, stateMachineEGID, stateSignalEGID, stateTransitionEGID,
  textmsgEGID, timerEGID, visOFbkEGID, visRawCameraEGID,
  visInterleaveEGID, visJPEGEGID, visPNGEGID, visSegmentEGID,
  visRLEEGID, visRegionEGID, visObjEGID, wmVarEGID,
  worldModelEGID, remoteStateEGID, numEGIDs
}
 Lists all possible event generator ids. More...
enum  EventTypeID_t { activateETID, statusETID, deactivateETID, numETIDs }
 an event type id is used to denote whether it's the first in a sequence (button down), in a sequence (button still down), or last (button up) More...

Public Member Functions

Constructors/Destructors
 EventBase ()
 constructor
 EventBase (EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur=0)
 constructor
 EventBase (EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur, const std::string &n)
 constructor
 EventBase (EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur, const std::string &n, float mag)
 constructor
virtual ~EventBase ()
 destructor
virtual EventBaseclone () const
 allows a copy to be made of an event, supporting polymorphism

Static Public Attributes

static const char *const EventGeneratorNames [numEGIDs]
 Holds string versions of each of the generator's names, handy for debugging so you can output the events as readable strings (you'll find this in EventBase.cc since it can't go in the header or we get multiply-defined errors during linking).
static const char *const EventTypeNames [numETIDs]
 holds string versions of EventTypeID_t
static const char *const EventTypeAbbr [numETIDs] = { "A", "S", "D" }
 holds abbreviated string versions of EventTypeID_t

Protected Member Functions

virtual void genName ()
 calls setName() with a string version of sourceID, decimal notation

Static Protected Member Functions

static unsigned int makeClassTypeID (const char *str)
 converts the first 4 characters of str to an unsigned int, should ensure consistent byte ordering across platforms

Protected Attributes

std::string stim_id
 the name of the event, use the same name consistently or else will be seen as different stimuli
float magnitude
 the current "strength" of the event/stimuli... MAKE SURE this gets set to ZERO IF event is DEACTIVATE
unsigned int timestamp
 the time the event was created - set automatically by constructor
SaveFormat saveFormat
 controls the format used during the next call to saveBuffer() (packed binary or XML)
bool nameisgen
 tracks whether the current name (stim_id) was generated by genName() (true) or setName() (false)
EventGeneratorID_t genID
 generator ID, see EventGeneratorID_t
EventTypeID_t typeID
 type ID, see EventTypeID_t
size_t sourceID
 the source ID for this event Source IDs are defined by the generator that made it. This should give authors flexibility to design their modules without having to worry about ID space collision
int hostID
unsigned int duration
 the time since this sequence started (like, how long the button has been pressed); not all generators will set this; Typically, this would be 0 for activate, (activate.timestamp-get_time()) for status and deactivate


Member Enumeration Documentation

Lists all possible event generator ids.

An event generator is a abstract source of events, used for listening to and parsing certain classes of events

IF YOU ADD AN EVENT GENERATOR, DON'T FORGET TO NAME IT (EventBase::EventGeneratorNames, actual names are in EventBase.cc)

Enumerator:
unknownEGID  default EGID, used if you forget to set it, probably not a good idea to use this for anything except errors or testing quick hacks
aiEGID  not being used, yet (might use this when AI makes decisions?)
audioEGID  Sends an event when a sound starts/ends playback, status events as chained sounds end; SID is SoundManager::Play_ID; duration is playtime.
buttonEGID  Sends activate event for button down, deactivate for button up. Status events only for when pressure sensitive buttons' reading changes. (on sensorEGID updates); SIDs are from ButtonOffset_t in the namespace of the target model (e.g. ERS210Info::ButtonOffset_t); duration is button down time.
erouterEGID  Sends activate event on first listener, deactivate on last listener, and status on other listener changes.; SID is the generator ID affected.
estopEGID  Sends an event when the estop is turned on or off; SID is the MotionManager::MC_ID of the EmergencyStopMC; duration is length of estop activation.
locomotionEGID  Sends events regarding transportation in the world; you can/should assume these will all be LocomotionEvent classes; SID is MotionManager::MC_ID of posting MotionCommand; duration is the time since last velocity change of that MC. (You could generate these for things other than walking...).
lookoutEGID  Sends an event when Lookout request is complete; SID is the id for lookout request.
mapbuilderEGID  Sends a status event when map is completed.
micOSndEGID  Sends a DataEvent<OSoundVectorData> for every audio buffer received from the system; SID and duration are always 0 (This is generated by the MainObj instantiation of MMCombo).
micRawEGID  reserved for future use
micFFTEGID  reserved for future use
micPitchEGID  Sends a PitchEvent when a particular frequency is detected; SID is a pointer to the PitchDetector, magnitude is product of amplitude and confidence.
motmanEGID  Sends events when a MotionCommand is added or removed, SID is is the MotionManager::MC_ID, duration is always 0; individual MotionCommands may throw status events to signal intermediary status.
pilotEGID  Sends events when position of agent is updated or pilot request is completed.
powerEGID  Sends events for low power warnings, temperature, etc. see PowerSourceID::PowerSourceID_t.
sensorEGID  Sends a status event when new sensor readings are available. see SensorSourceID::SensorSourceID_t.
stateMachineEGID  Sends an event upon entering and leaving a StateNode; SID is pointer to the StateNode; duration is always 0; some state will throw a status event when they have completed their task and are now idling.
stateSignalEGID  Sends a DataEvent that can be monitored by a SignalTrans for triggering a state transition.
stateTransitionEGID  Sends an event each time a transition is triggered; SID is a pointer to the transition; type is always status, duration is always 0; guaranteed to occur immediately *before* the transition actually occurs.
textmsgEGID  Sends status events when a text msg is received on console; generated by the Controller, SID is 0 if broadcast from ControllerGUI, 1 if "private" from BehaviorSwitchControl; duration is always 0 (see Controller for more information).
timerEGID  Sends timer events; you set timers explicitly, you don't have to listen as well. (See EventRouter::addTimer()) There's no cross-talk, only the listener which requested the timer will receive it; SID is whatever you requested it to be; duration is the time (since boot, in ms) that the timer was supposed to go off; these are always status.
visOFbkEGID  Sends a DataEvent < OFbkImageVectorData > for every camera image received from the system; SID and duration are always 0 (This is generated by the MainObj instantiation of MMCombo).
visRawCameraEGID  Sends a FilterBankEvent when new raw camera images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visInterleaveEGID  Sends a FilterBankEvent when new interleaved images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visJPEGEGID  Sends a FilterBankEvent when JPEG compressed images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visPNGEGID  Sends a FilterBankEvent when PNG compressed images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visSegmentEGID  Sends a SegmentedColorFilterBankEvent when color segmentated images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visRLEEGID  Sends a SegmentedColorFilterBankEvent when RLE encoded color segmentated images are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visRegionEGID  Sends a SegmentedColorFilterBankEvent when color regions are available; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
visObjEGID  Sends VisionObjectEvents for objects detected in camera images; SID is whatever value you gave during setup (typically in StartupBehavior_SetupVision.cc), duration is always 0.
wmVarEGID  Sends an event when a watched memory is changed; source id is pointer to WMEntry.
worldModelEGID  not being used, yet (for when objects are detected/lost?)
remoteStateEGID  Sent when remote state is updated.
numEGIDs  the number of generators available

Definition at line 80 of file EventBase.h.

an event type id is used to denote whether it's the first in a sequence (button down), in a sequence (button still down), or last (button up)

Enumerator:
activateETID  Start of an event sequence, e.g. button down.
statusETID  Indicates a value has changed, e.g. new sensor readings.
deactivateETID  Last of a series of events, e.g. button up.
numETIDs  the number of different event types

Definition at line 122 of file EventBase.h.

values to pass to setSaveFormat()

Enumerator:
BINARY  saves will be in packed binary, loads will try binary first
XML  saves will be in xml, loads will try xml first

Definition at line 254 of file EventBase.h.


Constructor & Destructor Documentation

EventBase::EventBase (  ) 

constructor

See also:
EventRouter::postEvent()

Definition at line 54 of file EventBase.cc.

Referenced by clone().

EventBase::EventBase ( EventGeneratorID_t  gid,
unsigned int  sid,
EventTypeID_t  tid,
unsigned int  dur = 0 
)

constructor

See also:
EventRouter::postEvent()

EventBase::EventBase ( EventGeneratorID_t  gid,
unsigned int  sid,
EventTypeID_t  tid,
unsigned int  dur,
const std::string &  n 
)

constructor

See also:
EventRouter::postEvent()

EventBase::EventBase ( EventGeneratorID_t  gid,
unsigned int  sid,
EventTypeID_t  tid,
unsigned int  dur,
const std::string &  n,
float  mag 
)

constructor

See also:
EventRouter::postEvent()


Member Function Documentation

virtual EventBase* EventBase::clone (  )  const [inline, virtual]

allows a copy to be made of an event, supporting polymorphism

Must be overridden by all subclasses to allow this to happen

I would like to switch this over to the cloneable interface once the compiler gets updated out of the 3.3 branch... see Cloneable::clone() for a discussion of the issue and implementation notes.

Reimplemented in DataEvent< T >, FilterBankEvent, LocomotionEvent, LookoutPointAtEvent, LookoutSketchEvent, LookoutIREvent, LookoutScanEvent, PitchEvent, SegmentedColorFilterBankEvent, TextMsgEvent, TimerEvent, and VisionObjectEvent.

Definition at line 151 of file EventBase.h.

virtual unsigned int EventBase::getClassTypeID (  )  const [inline, virtual]

All subclasses should override this and return a unique ID for their class.

All IDs corresponding to all-capital letters are reserved for future framework expansion. (Thus, user subclasses should contain at least one lower-case letter.) This code can be used when serializing to allow quick identification of the class type by the receiver.

Reimplemented in LocomotionEvent, LookoutPointAtEvent, LookoutIREvent, TextMsgEvent, TimerEvent, and VisionObjectEvent.

Definition at line 218 of file EventBase.h.

Referenced by EventTranslator::encodeEvent().

std::string EventBase::getDescription ( bool  showTypeSpecific = true,
unsigned int  verbosity = 0 
) const [virtual]

generates a description of the event with variable verbosity

Parameters:
showTypeSpecific should be read by subclasses to add additional information
verbosity can be one of the following values:
  • 0 - Basic: event_name \t generator_id \t source_id \t type_id
  • 1 - Numerics: event_name \t generator_id \t source_id \t type_id
  • 2 - Timing: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp
  • 3 and above - Full: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp \t magnitude if showTypeSpecific, additional fields will be added after the common fields listed above.

Reimplemented in LocomotionEvent, LookoutPointAtEvent, LookoutIREvent, PitchEvent, TextMsgEvent, TimerEvent, and VisionObjectEvent.

Definition at line 115 of file EventBase.cc.

Referenced by VisionObjectEvent::getDescription(), TimerEvent::getDescription(), TextMsgEvent::getDescription(), PitchEvent::getDescription(), LookoutPointAtEvent::getDescription(), LocomotionEvent::getDescription(), EventLogger::processEvent(), and EventLogger::processStateMachineEvent().

virtual unsigned int EventBase::getDuration (  )  const [inline, virtual]

gets the time since the beginning of this sequence (the timestamp of the activate event)

See also:
duration

Definition at line 177 of file EventBase.h.

Referenced by EventRouter::addTimer(), and getDescription().

virtual EventGeneratorID_t EventBase::getGeneratorID (  )  const [inline, virtual]

gets the generator ID for this event

See also:
EventGeneratorID_t

Definition at line 164 of file EventBase.h.

Referenced by EventRouter::addListener(), EventRouter::addRemoteListener(), EventRouter::addTrapper(), getDescription(), EventRouter::EventMapper::getMapping(), EventRouter::hasListeners(), EventRouter::isListening(), EventRouter::isTrapping(), TorqueCalibrate::TakeMeasurementControl::processEvent(), TimeOutTrans::processEvent(), SensorObserverControl::processEvent(), SegmentedColorGenerator::processEvent(), SegCamBehavior::processEvent(), RLEGenerator::processEvent(), RemoteRouter::processEvent(), RegionGenerator::processEvent(), RawCameraGenerator::processEvent(), PostureEditor::processEvent(), PNGGenerator::processEvent(), PitchDetector::processEvent(), MotionSequenceNode< SIZE >::processEvent(), MicrophoneServer::processEvent(), LostTargetTrans::processEvent(), JPEGGenerator::processEvent(), InterleavedYUVGenerator::processEvent(), FreeMemReportControl::processEvent(), FilterBankGenerator::processEvent(), EventProxy::processEvent(), EventGeneratorBase::processEvent(), DeadReckoningBehavior< ParticleT >::processEvent(), CDTGenerator::processEvent(), CameraStreamBehavior::processEvent(), BatteryMonitorBehavior::processEvent(), BallDetectionGenerator::processEvent(), AutoGetupBehavior::processEvent(), EventLogger::processStateMachineEvent(), EventRouter::removeListener(), EventRouter::removeRemoteListener(), EventRouter::removeTimer(), EventRouter::removeTrapper(), EventRouter::EventMapper::verifyMapping(), RawCamBehavior::writeColor(), and RawCamBehavior::writeSingleChannel().

virtual unsigned int EventBase::loadBuffer ( const char  buf[],
unsigned int  len 
) [inline, virtual]

no longer need to override this -- will automatically call either loadXML() or loadBinaryBuffer() based on saveFormat

tries to be smart so if the load based on the current saveFormat fails, retries with the alternative format

Reimplemented from XMLLoadSave.

Definition at line 228 of file EventBase.h.

Referenced by EventTranslator::decodeEvent().

virtual unsigned int EventBase::loadFile ( const char *  filename  )  [inline, virtual]

automatically calls either XMLLoadSave::loadFile or LoadSave::loadFile based on saveFormat

tries to be smart so if the load based on the current saveFormat fails, retries with the alternative format

Reimplemented from XMLLoadSave.

Definition at line 239 of file EventBase.h.

static unsigned int EventBase::makeClassTypeID ( const char *  str  )  [inline, static, protected]

converts the first 4 characters of str to an unsigned int, should ensure consistent byte ordering across platforms

The numeric value may differ between platforms, but it will be consistent with the IDs on that platform, which is the real key since we aren't doing math, just equality

Definition at line 267 of file EventBase.h.

Referenced by VisionObjectEvent::getClassTypeID(), TimerEvent::getClassTypeID(), TextMsgEvent::getClassTypeID(), LookoutIREvent::getClassTypeID(), LookoutPointAtEvent::getClassTypeID(), LocomotionEvent::getClassTypeID(), and getClassTypeID().

virtual EventBase& EventBase::setDuration ( unsigned int  d  )  [inline, virtual]

sets the time since the beginning of this sequence (the timestamp of the activate event)

See also:
duration

Definition at line 178 of file EventBase.h.

virtual EventBase& EventBase::setGeneratorID ( EventGeneratorID_t  gid  )  [inline, virtual]

sets the generator ID for this event

See also:
EventGeneratorID_t

Definition at line 165 of file EventBase.h.

virtual EventBase& EventBase::setSourceID ( unsigned int  sid  )  [inline, virtual]

sets the source ID for this event

See also:
sourceID

Definition at line 168 of file EventBase.h.

virtual EventBase& EventBase::setTypeID ( EventTypeID_t  tid  )  [inline, virtual]

sets the type ID

See also:
EventTypeID_t

Definition at line 171 of file EventBase.h.

Referenced by RegionGenerator::processEvent(), PNGGenerator::processEvent(), and JPEGGenerator::processEvent().


Member Data Documentation

const char *const EventBase::EventTypeNames [static]

Initial value:

 {
  "activate",
  "status",
  "deactivate"
}
holds string versions of EventTypeID_t

Definition at line 130 of file EventBase.h.

Referenced by loadXML(), and Controller::takeLine().


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

Tekkotsu v3.0
Generated Fri May 11 20:08:03 2007 by Doxygen 1.4.7