Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TimerEvent Class Reference

Adds a target field to EventBase so listeners can resolve source ID conflict between different behaviors. More...

#include <TimerEvent.h>

Inheritance diagram for TimerEvent:

Detailed Description

Adds a target field to EventBase so listeners can resolve source ID conflict between different behaviors.

See EventRouter's class documentation for discussion of how to request and use timers.

Definition at line 12 of file TimerEvent.h.

List of all members.

Public Member Functions

 TimerEvent ()
 empty constructor, initializes target to NULL
 TimerEvent (EventListener *tgt, EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur=0)
 the full specification constructor, pass original requester tgt, generator gid (probably should always be EventBase::timerEGID), source sid, type tid (typically EventBase::statusETID), and duration dur
 TimerEvent (const TimerEvent &te)
 copy constructor, does a shallow copy (copies pointer value, doesn't try to clone target!)
TimerEventoperator= (const TimerEvent &te)
 assignment operator, does a shallow copy (copies pointer value, doesn't try to clone target!)
virtual EventBaseclone () const
 allows a copy to be made of an event, supporting polymorphism
virtual unsigned int getClassTypeID () const
 All subclasses should override this and return a unique ID for their class.
EventListenergetTarget () const
 returns target
void setTarget (EventListener *tgt)
 assigns tgt to target
std::string getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const
 generates a description of the event with variable verbosity
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

Protected Attributes

EventListenertarget
 indicates the listener for which the timer was created

Static Protected Attributes

static const
EventBase::classTypeID_t 
autoRegisterTimerEvent = getTypeRegistry().registerType<TimerEvent>(makeClassTypeID("TIMR"))
 causes class type id to automatically be regsitered with EventBase's FamilyFactory (getTypeRegistry())

Constructor & Destructor Documentation

TimerEvent::TimerEvent (  ) 

empty constructor, initializes target to NULL

Definition at line 15 of file TimerEvent.h.

Referenced by clone().

TimerEvent::TimerEvent ( EventListener tgt,
EventGeneratorID_t  gid,
size_t  sid,
EventTypeID_t  tid,
unsigned int  dur = 0 
)

the full specification constructor, pass original requester tgt, generator gid (probably should always be EventBase::timerEGID), source sid, type tid (typically EventBase::statusETID), and duration dur

Definition at line 17 of file TimerEvent.h.

TimerEvent::TimerEvent ( const TimerEvent te  ) 

copy constructor, does a shallow copy (copies pointer value, doesn't try to clone target!)

Definition at line 19 of file TimerEvent.h.


Member Function Documentation

virtual EventBase* TimerEvent::clone (  )  const [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 from EventBase.

Definition at line 23 of file TimerEvent.h.

unsigned int TimerEvent::getBinSize (  )  const [virtual]

should return the minimum size needed if using binary format (i.e. not XML)

Reimplemented from EventBase.

Definition at line 25 of file TimerEvent.cc.

virtual unsigned int TimerEvent::getClassTypeID (  )  const [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 from EventBase.

Definition at line 25 of file TimerEvent.h.

std::string TimerEvent::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 from EventBase.

Definition at line 11 of file TimerEvent.cc.

EventListener* TimerEvent::getTarget (  )  const

returns target

Definition at line 27 of file TimerEvent.h.

unsigned int TimerEvent::loadBinaryBuffer ( const char  buf[],
unsigned int  len 
) [virtual]

load from binary format

Reimplemented from EventBase.

Definition at line 36 of file TimerEvent.cc.

void TimerEvent::loadXML ( xmlNode node  )  [virtual]

load from XML format

Reimplemented from EventBase.

Definition at line 55 of file TimerEvent.cc.

TimerEvent& TimerEvent::operator= ( const TimerEvent te  ) 

assignment operator, does a shallow copy (copies pointer value, doesn't try to clone target!)

Definition at line 21 of file TimerEvent.h.

unsigned int TimerEvent::saveBinaryBuffer ( char  buf[],
unsigned int  len 
) const [virtual]

save to binary format

Reimplemented from EventBase.

Definition at line 47 of file TimerEvent.cc.

void TimerEvent::saveXML ( xmlNode node  )  const [virtual]

save to XML format

Reimplemented from EventBase.

Definition at line 81 of file TimerEvent.cc.

void TimerEvent::setTarget ( EventListener tgt  ) 

assigns tgt to target

Definition at line 28 of file TimerEvent.h.


Member Data Documentation

const EventBase::classTypeID_t TimerEvent::autoRegisterTimerEvent = getTypeRegistry().registerType<TimerEvent>(makeClassTypeID("TIMR")) [static, protected]

causes class type id to automatically be regsitered with EventBase's FamilyFactory (getTypeRegistry())

Definition at line 42 of file TimerEvent.h.

Referenced by getClassTypeID().

indicates the listener for which the timer was created

Definition at line 39 of file TimerEvent.h.

Referenced by getBinSize(), getDescription(), getTarget(), loadBinaryBuffer(), loadXML(), operator=(), saveBinaryBuffer(), saveXML(), and setTarget().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:17 2016 by Doxygen 1.6.3