FACT++  1.0
ServiceDim.h
Go to the documentation of this file.
1 // **************************************************************************
14 // **************************************************************************
15 #ifndef FACT_ServiceDim
16 #define FACT_ServiceDim
17 
18 #include "EventImp.h"
19 #include "dic.hxx"
20 
21 class ServiceDim : public EventImp, public DimStampedInfo
22 {
23 public:
24  ServiceDim(const std::string &name, DimInfoHandler *handler)
25  : EventImp(), DimStampedInfo(name.c_str(), (void*)NULL, 0, handler)
26  {
27  }
28  std::string GetName() const { return const_cast<ServiceDim*>(this)->getName(); }
29  std::string GetFormat() const { return const_cast<ServiceDim*>(this)->getFormat(); }
30 
31  const void *GetData() const { return const_cast<ServiceDim*>(this)->getData(); }
32  size_t GetSize() const { return const_cast<ServiceDim*>(this)->getSize(); }
33 
34  Time GetTime() const
35  {
36  // Must be in exactly this order!
37  const int tsec = const_cast<ServiceDim*>(this)->getTimestamp();
38  const int tms = const_cast<ServiceDim*>(this)->getTimestampMillisecs();
39 
40  return Time(tsec, tms*1000);
41  }
42 
43  int GetQoS() const { return const_cast<ServiceDim*>(this)->getQuality(); }
44 };
45 
46 #endif
char * getFormat()
Definition: diccpp.cxx:120
A general base-class describing events issues in a state machine.
Definition: EventImp.h:11
int getQuality()
Definition: diccpp.cxx:102
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
int getTimestampMillisecs()
Definition: diccpp.cxx:114
int getSize()
Definition: dic.hxx:100
int getTimestamp()
Definition: diccpp.cxx:107
Time GetTime() const
Definition: ServiceDim.h:34
const void * GetData() const
Definition: ServiceDim.h:31
int GetQoS() const
Definition: ServiceDim.h:43
ServiceDim(const std::string &name, DimInfoHandler *handler)
Definition: ServiceDim.h:24
void * getData()
Definition: diccpp.cxx:213
std::string GetFormat() const
Definition: ServiceDim.h:29
size_t GetSize() const
Definition: ServiceDim.h:32
static void handler(int conn_id, char *packet, int size, int status)
Definition: webServer.c:635
std::string GetName() const
Definition: ServiceDim.h:28
char * getName()
Definition: dic.hxx:101