Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

DataEvent< T, TID > Class Template Reference

#include <DataEvent.h>

Inheritance diagram for DataEvent< T, TID >:

List of all members.


Detailed Description

template<class T, int TID = -1>
class DataEvent< T, TID >

for passing around data (or pointers to data)

Definition at line 9 of file DataEvent.h.


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 DataEventoperator= (const DataEvent &evt)
 assignment
virtual EventBaseclone () 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

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())

Constructor & Destructor Documentation

template<class T, int TID = -1>
DataEvent< T, TID >::DataEvent (  )  [inline]

Definition at line 13 of file DataEvent.h.

template<class T, int TID = -1>
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.

template<class T, int TID = -1>
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.

template<class T, int TID = -1>
DataEvent< T, TID >::DataEvent ( const DataEvent< T, TID > &  evt  )  [inline]

copy constructor

Definition at line 18 of file DataEvent.h.


Member Function Documentation

template<class T, int TID = -1>
const DataEvent& DataEvent< T, TID >::operator= ( const DataEvent< T, TID > &  evt  )  [inline]

assignment

Definition at line 21 of file DataEvent.h.

template<class T, int TID = -1>
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.

template<class T, int TID = -1>
void DataEvent< T, TID >::setData ( const T &  d  )  [inline]

assigns d to the internal data

Definition at line 26 of file DataEvent.h.

template<class T, int TID = -1>
const T& DataEvent< T, TID >::getData (  )  const [inline]

template<class T, int TID = -1>
T& DataEvent< T, TID >::getData (  )  [inline]

returns data

Definition at line 28 of file DataEvent.h.

template<class T, int TID = -1>
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.

template<class T, int TID = -1>
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.


Member Data Documentation

template<class T, int TID = -1>
T DataEvent< T, TID >::data [protected]

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().

template<class T, int TID = -1>
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().


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

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