Changeset 13831 for trunk/FACT++/src
- Timestamp:
- 05/23/12 16:57:06 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Event.cc
r10183 r13831 17 17 18 18 using namespace std; 19 20 // --------------------------------------------------------------------------21 //22 //! Propagate the targetstate to the base class EventImp and store the23 //! name in fName and the format in fFormat. Initializes fTime to24 //! an invalid time.25 //!26 //! @param targetstate27 //! Target state to be propagated to the base class constructor28 //!29 //! @param name30 //! Name given to the event31 //!32 //! @param fmt33 //! If the event has data attached (like arguments of commands)34 //! the format can be given here. How the format string is defined35 //! is defined within the dim libarary. It is used in console36 //! and shell access to properly format the data sent with the event37 //!38 //! <B>From the dim manual:</B>39 //! The format parameter specifies the contents of the structure in40 //! the form T:N[;T:N]*[;T] where T is the item type: (I)nteger,41 //! (C)haracter, (L)ong, (S)hort, (F)loat, (D)ouble, and N is the42 //! number of such items. The type alone at the end means all43 //! following items are of the same type. Example: "I:3;F:2;C" means44 //! 3 Integers, 2 Floats and Characters until the end. The format45 //! parameter is used for communicating between different platforms.46 //!47 //48 Event::Event(int targetstate, const char *name, const char *fmt) : EventImp(targetstate),49 fName(name), fFormat(fmt), fTime(Time::none)50 {51 }52 19 53 20 // -------------------------------------------------------------------------- … … 76 43 // 77 44 Event::Event(const string &name, const char *fmt) : 78 fName(name), fFormat(fmt), fTime(Time::none) 45 fName(name), fFormat(fmt), fTime(Time::none), fQoS(0) 79 46 { 80 47 } … … 91 58 Event::Event(const EventImp &evt) : EventImp(evt), 92 59 fName(evt.GetName()), fFormat(evt.GetFormat()), 93 fData(evt.GetText(), evt.GetText()+evt.GetSize()), fTime(evt.GetTime()) 60 fData(evt.GetText(), evt.GetText()+evt.GetSize()), fTime(evt.GetTime()), 61 fQoS(evt.GetQoS()) 94 62 { 95 63 const size_t pos = fName.find_first_of('/'); … … 115 83 Event::Event(const EventImp &evt, const char *ptr, size_t siz) : EventImp(evt), 116 84 fName(evt.GetName()), fFormat(evt.GetFormat()), 117 fData(ptr, ptr+siz) 85 fData(ptr, ptr+siz), fTime(evt.GetTime()), fQoS(evt.GetQoS()) 118 86 { 119 87 const size_t pos = fName.find_first_of('/'); -
trunk/FACT++/src/Event.h
r10299 r13831 14 14 15 15 Time fTime; /// Time stamp 16 int fQoS; /// Quality of service 16 17 17 18 public: 18 19 /// Constructs an event as a combination of an EventImp and a DimCommand 19 Event(int targetstate, const char *name="", const char *fmt="");20 20 Event(const std::string &name, const char *fmt=""); 21 21 /// Copy constructor … … 34 34 const void *GetData() const { return &*fData.begin(); } 35 35 /// Return the size of the data 36 intGetSize() const { return fData.size(); }36 size_t GetSize() const { return fData.size(); } 37 37 38 38 /// Return reference to a time stamp 39 39 Time GetTime() const { return fTime; } 40 int GetQoS() const { return fQoS; } 40 41 41 42
Note:
See TracChangeset
for help on using the changeset viewer.