Homepage Demos Overview Downloads Tutorials Reference
Credits

DataEvent.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_DataEvent_h_
00003 #define INCLUDED_DataEvent_h_
00004 
00005 #include "Events/EventBase.h"
00006 
00007 //! for passing around data (or pointers to data)
00008 template<class T>
00009 class DataEvent : public EventBase {
00010 public:
00011   //!@name Constructors
00012   //!
00013   DataEvent() : EventBase() {}
00014   DataEvent(const T& d, EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur=0) : EventBase(gid,sid,tid,dur), data(d) {}
00015   DataEvent(const T& d, EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur, const std::string& n, float mag) : EventBase(gid,sid,tid,dur,n,mag), data(d) {}
00016   //@}
00017 
00018   void setData(const T& d) { data=d; } //!< assigns @a d to the internal #data
00019   const T& getData() const { return data; } //!< returns #data
00020   T& getData() { return data; } //!< returns #data
00021 
00022 protected:
00023   T data; //!< the data being communicated
00024 
00025 private:
00026   DataEvent(const DataEvent& fbk); //!< don't call
00027   const DataEvent& operator=(const DataEvent& fbk); //!< don't call
00028 };
00029 
00030 /*! @file
00031  * @brief Defines DataEvent, for passing around data (or pointers to data)
00032  * @author ejt (Creator)
00033  *
00034  * $Author: ejt $
00035  * $Name: tekkotsu-2_1 $
00036  * $Revision: 1.2 $
00037  * $State: Exp $
00038  * $Date: 2004/01/18 10:16:57 $
00039  */
00040 
00041 #endif

Tekkotsu v2.1
Generated Tue Mar 16 23:19:13 2004 by Doxygen 1.3.5