Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

DataEvent< T, TID > Class Template Reference

Event type for passing around data (or pointers to data). In a state machine, use a SignalTrans to test for a specific data value and make the sid the address of the node posting the event. More...

#include <DataEvent.h>

Inheritance diagram for DataEvent< T, TID >:

Detailed Description

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

Event type for passing around data (or pointers to data). In a state machine, use a SignalTrans to test for a specific data value and make the sid the address of the node posting the event.

Definition at line 11 of file DataEvent.h.

List of all members.

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 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 classTypeID_t getClassTypeID () const
 All subclasses should override this and return a unique ID for their class.
virtual void getDataFromString (std::stringstream &s)
virtual void sendDataToString (std::stringstream &s) const
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void getDataFromString (std::stringstream &ss)
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
template<>
void sendDataToString (std::stringstream &ss) const
Constructors

 DataEvent ()
 copy constructor
 DataEvent (const T &d, EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur=0)
 copy constructor
 DataEvent (const T &d, EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur, const std::string &n, float mag)
 copy constructor
 DataEvent (const DataEvent &evt)
 copy constructor
const DataEventoperator= (const DataEvent &evt)
 assignment
virtual EventBaseclone () const
 copy constructor

Static Public Member Functions

static unsigned int encode (const T &x, char buf[], unsigned int cap)
static unsigned int decode (T &x, const char buf[], unsigned int cap)

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?static_cast<EventBase::classTypeID_t>(getTypeRegistry().getNumTypes()):static_cast<EventBase::classTypeID_t>(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 (  ) 

copy constructor

Definition at line 15 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 
)

copy constructor

Definition at line 16 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 
)

copy constructor

Definition at line 17 of file DataEvent.h.

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

copy constructor

Definition at line 20 of file DataEvent.h.


Member Function Documentation

template<class T, int TID = -1>
virtual EventBase* DataEvent< T, TID >::clone (  )  const [virtual]

copy constructor

Reimplemented from EventBase.

Definition at line 25 of file DataEvent.h.

template<class T, int TID = -1>
static unsigned int DataEvent< T, TID >::decode ( T &  x,
const char  buf[],
unsigned int  cap 
) [static]

Definition at line 33 of file DataEvent.h.

Referenced by DataEvent< T, TID >::loadBinaryBuffer().

template<class T, int TID = -1>
static unsigned int DataEvent< T, TID >::encode ( const T &  x,
char  buf[],
unsigned int  cap 
) [static]

Definition at line 32 of file DataEvent.h.

Referenced by DataEvent< T, TID >::saveBinaryBuffer().

template<class T , int TID>
unsigned int DataEvent< T, TID >::getBinSize (  )  const [virtual]

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

Reimplemented from EventBase.

Definition at line 85 of file DataEvent.h.

template<class T, int TID = -1>
virtual classTypeID_t DataEvent< T, TID >::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 41 of file DataEvent.h.

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

returns data

Definition at line 30 of file DataEvent.h.

template<>
void DataEvent< double,-1 >::getDataFromString ( std::stringstream &  ss  ) 
template<>
void DataEvent< float,-1 >::getDataFromString ( std::stringstream &  ss  ) 
template<>
void DataEvent< int,-1 >::getDataFromString ( std::stringstream &  ss  ) 
template<>
void DataEvent< unsigned int,-1 >::getDataFromString ( std::stringstream &  ss  ) 
template<>
void DataEvent< unsigned short int,-1 >::getDataFromString ( std::stringstream &  ss  ) 
template<>
void DataEvent< unsigned char,-1 >::getDataFromString ( std::stringstream &  ss  ) 
template<>
void DataEvent< double,-1 >::getDataFromString ( std::stringstream &  ss  ) 

Definition at line 8 of file DataEvent.cc.

template<>
void DataEvent< float,-1 >::getDataFromString ( std::stringstream &  ss  ) 

Definition at line 7 of file DataEvent.cc.

template<>
void DataEvent< int,-1 >::getDataFromString ( std::stringstream &  ss  ) 

Definition at line 6 of file DataEvent.cc.

template<>
void DataEvent< unsigned int,-1 >::getDataFromString ( std::stringstream &  ss  ) 

Definition at line 5 of file DataEvent.cc.

template<>
void DataEvent< unsigned short int,-1 >::getDataFromString ( std::stringstream &  ss  ) 

Definition at line 4 of file DataEvent.cc.

template<>
void DataEvent< unsigned char,-1 >::getDataFromString ( std::stringstream &  ss  ) 

Definition at line 3 of file DataEvent.cc.

template<class T , int TID>
void DataEvent< T, TID >::getDataFromString ( std::stringstream &  s  )  [virtual]

Definition at line 146 of file DataEvent.h.

Referenced by DataEvent< T, TID >::loadXML().

template<class T , int TID>
unsigned int DataEvent< T, TID >::loadBinaryBuffer ( const char  buf[],
unsigned int  len 
) [virtual]

load from binary format

Reimplemented from EventBase.

Definition at line 96 of file DataEvent.h.

template<class T , int TID>
void DataEvent< T, TID >::loadXML ( xmlNode node  )  [virtual]

load from XML format

Reimplemented from EventBase.

Definition at line 116 of file DataEvent.h.

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

assignment

Definition at line 23 of file DataEvent.h.

Referenced by DataEvent< T >::operator=().

template<class T, int TID = -1>
static EventBase::classTypeID_t DataEvent< T, TID >::registerDataType ( EventBase::classTypeID_t  classid  )  [static, protected]

this silliness is to work around parsing issue in gcc 3.3 branch

Definition at line 50 of file DataEvent.h.

template<class T , int TID>
unsigned int DataEvent< T, TID >::saveBinaryBuffer ( char  buf[],
unsigned int  len 
) const [virtual]

save to binary format

Reimplemented from EventBase.

Definition at line 106 of file DataEvent.h.

template<class T , int TID>
void DataEvent< T, TID >::saveXML ( xmlNode node  )  const [virtual]

save to XML format

Reimplemented from EventBase.

Definition at line 170 of file DataEvent.h.

template<>
void DataEvent< double,-1 >::sendDataToString ( std::stringstream &  ss  )  const
template<>
void DataEvent< float,-1 >::sendDataToString ( std::stringstream &  ss  )  const
template<>
void DataEvent< int,-1 >::sendDataToString ( std::stringstream &  ss  )  const
template<>
void DataEvent< unsigned int,-1 >::sendDataToString ( std::stringstream &  ss  )  const
template<>
void DataEvent< unsigned short int,-1 >::sendDataToString ( std::stringstream &  ss  )  const
template<>
void DataEvent< unsigned char,-1 >::sendDataToString ( std::stringstream &  ss  )  const
template<>
void DataEvent< double,-1 >::sendDataToString ( std::stringstream &  ss  )  const

Definition at line 15 of file DataEvent.cc.

template<>
void DataEvent< float,-1 >::sendDataToString ( std::stringstream &  ss  )  const

Definition at line 14 of file DataEvent.cc.

template<>
void DataEvent< int,-1 >::sendDataToString ( std::stringstream &  ss  )  const

Definition at line 13 of file DataEvent.cc.

template<>
void DataEvent< unsigned int,-1 >::sendDataToString ( std::stringstream &  ss  )  const

Definition at line 12 of file DataEvent.cc.

template<>
void DataEvent< unsigned short int,-1 >::sendDataToString ( std::stringstream &  ss  )  const

Definition at line 11 of file DataEvent.cc.

template<>
void DataEvent< unsigned char,-1 >::sendDataToString ( std::stringstream &  ss  )  const

Definition at line 10 of file DataEvent.cc.

template<class T , int TID>
void DataEvent< T, TID >::sendDataToString ( std::stringstream &  s  )  const [virtual]

Definition at line 158 of file DataEvent.h.

Referenced by DataEvent< T, TID >::saveXML().

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

assigns d to the internal data

Definition at line 28 of file DataEvent.h.


Member Data Documentation

template<class T, int TID = -1>
const EventBase::classTypeID_t DataEvent< T, TID >::autoRegisterDataEvent = DataEvent<T,TID>::registerDataType(makeClassTypeID("DATA")+(TID<0?static_cast<EventBase::classTypeID_t>(getTypeRegistry().getNumTypes()):static_cast<EventBase::classTypeID_t>(TID))) [static, protected]

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

Definition at line 61 of file DataEvent.h.

Referenced by DataEvent< T >::getClassTypeID().


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

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