Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
DataEvent< T, TID > Class Template Reference#include <DataEvent.h>
Inheritance diagram for DataEvent< T, TID >:
![]() Detailed Descriptiontemplate<class T, int TID = -1>
for passing around data (or pointers to data)
|
Public Member Functions | |
void | setData (const T &d) |
assigns d to the internal data | |
const T & | getData () const |
returns data | |
T & | getData () |
returns data | |
virtual classTypeID_t | getClassTypeID () const |
All subclasses should override this and return a unique ID for their class. | |
Constructors | |
DataEvent () | |
DataEvent (const T &d, EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur=0) | |
DataEvent (const T &d, EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur, const std::string &n, float mag) | |
DataEvent (const DataEvent &evt) | |
copy constructor | |
const DataEvent & | operator= (const DataEvent &evt) |
assignment | |
virtual EventBase * | clone () const |
allows a copy to be made of an event, supporting polymorphism | |
Static Protected Member Functions | |
static EventBase::classTypeID_t | registerDataType (EventBase::classTypeID_t classid) |
this silliness is to work around parsing issue in gcc 3.3 branch | |
Protected Attributes | |
T | data |
the data being communicated | |
Static Protected Attributes | |
static const EventBase::classTypeID_t | autoRegisterDataEvent = DataEvent<T,TID>::registerDataType(makeClassTypeID("DATA")+(TID<0?getTypeRegistry().getNumTypes():TID)) |
causes class type id to automatically be regsitered with EventBase's FamilyFactory (getTypeRegistry()) |
Definition at line 13 of file DataEvent.h.
DataEvent< T, TID >::DataEvent | ( | const T & | d, | |
EventGeneratorID_t | gid, | |||
size_t | sid, | |||
EventTypeID_t | tid, | |||
unsigned int | dur = 0 | |||
) | [inline] |
Definition at line 14 of file DataEvent.h.
DataEvent< T, TID >::DataEvent | ( | const T & | d, | |
EventGeneratorID_t | gid, | |||
size_t | sid, | |||
EventTypeID_t | tid, | |||
unsigned int | dur, | |||
const std::string & | n, | |||
float | mag | |||
) | [inline] |
Definition at line 15 of file DataEvent.h.
virtual EventBase* DataEvent< T, TID >::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 from EventBase.
Definition at line 23 of file DataEvent.h.
void DataEvent< T, TID >::setData | ( | const T & | d | ) | [inline] |
const T& DataEvent< T, TID >::getData | ( | ) | const [inline] |
returns data
Definition at line 27 of file DataEvent.h.
Referenced by SignalTrans< T >::processEvent(), PitchDetector::processEvent(), MicrophoneServer::processEvent(), and BufferedImageGenerator::processEvent().
T& DataEvent< T, TID >::getData | ( | ) | [inline] |
virtual classTypeID_t DataEvent< T, TID >::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 from EventBase.
Definition at line 30 of file DataEvent.h.
static EventBase::classTypeID_t DataEvent< T, TID >::registerDataType | ( | EventBase::classTypeID_t | classid | ) | [inline, static, protected] |
this silliness is to work around parsing issue in gcc 3.3 branch
Definition at line 36 of file DataEvent.h.
the data being communicated
Definition at line 33 of file DataEvent.h.
Referenced by DataEvent< T, TID >::getData(), DataEvent< T, TID >::operator=(), and DataEvent< T, TID >::setData().
const EventBase::classTypeID_t DataEvent< T, TID >::autoRegisterDataEvent = DataEvent<T,TID>::registerDataType(makeClassTypeID("DATA")+(TID<0?getTypeRegistry().getNumTypes():TID)) [inline, static, protected] |
causes class type id to automatically be regsitered with EventBase's FamilyFactory (getTypeRegistry())
Definition at line 46 of file DataEvent.h.
Referenced by DataEvent< T, TID >::getClassTypeID().
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:17 2007 by Doxygen 1.5.4 |