source: trunk/FACT++/src/EventDim.h@ 10252

Last change on this file since 10252 was 10183, checked in by tbretz, 10 years ago
New import.
File size: 1.4 KB
Line 
1// **************************************************************************
2/** @class EventDim
3
4@brief Concerete implementation of an EventImp as a DimCommand
5
6This is the implementation of an event which can be posted to a state
7machine via the DIM network.
8
9@todo
10- Add reference to DIM docu
11- improve docu
12
13*/
14// **************************************************************************
15#ifndef FACT_EventDim
16#define FACT_EventDim
17
18#include "EventImp.h"
19
20#include "dis.hxx" // DimCommand
21
22class EventDim : public EventImp, public DimCommand
23{
24public:
25 EventDim(int target, const std::string &name, const std::string &format, DimCommandHandler *handler)
26 : EventImp(target), DimCommand(name.c_str(), format.c_str(), handler)
27 {
28 // Initialize these values from DimCommand, because DimCommand
29 // does not yet do it.
30 itsData = 0;
31 itsSize = 0;
32
33 secs = 0;
34 millisecs = 0;
35 }
36
37 std::string GetName() const { return const_cast<EventDim*>(this)->getName(); }
38 std::string GetFormat() const { return const_cast<EventDim*>(this)->getFormat(); }
39
40 const void *GetData() const { return const_cast<EventDim*>(this)->getData(); }
41 int GetSize() const { return const_cast<EventDim*>(this)->getSize(); }
42
43 Time GetTime() const
44 {
45 return Time(const_cast<EventDim*>(this)->getTimestamp(),
46 const_cast<EventDim*>(this)->getTimestampMillisecs());
47 }
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.