41 virtual void Print(std::ostream &out,
bool strip=
false)
const;
42 virtual void Print(
bool strip=
false)
const;
51 virtual std::string
GetName()
const {
return ""; }
52 virtual std::string
GetFormat()
const {
return ""; }
54 virtual const void *
GetData()
const {
return 0; }
55 virtual size_t GetSize()
const {
return 0; }
58 virtual int GetQoS()
const {
return 0; }
66 T
Get(
size_t offset=0)
const 69 throw std::logic_error(
"EventImp::Get - offset out of range.");
70 return *
reinterpret_cast<const T*
>(
GetText()+offset);
74 const T *
Ptr(
size_t offset=0)
const 77 throw std::logic_error(
"EventImp::Ptr - offset out of range.");
78 return reinterpret_cast<const T*
>(
GetText()+offset);
82 const T &
Ref(
size_t offset=0)
const 84 return *Ptr<T>(offset);
88 const char *
GetText()
const {
return reinterpret_cast<const char*
>(
GetData()); }
90 bool GetBool()
const {
return Get<uint8_t>()!=0; }
91 int16_t
GetShort()
const {
return Get<int16_t>(); }
92 uint16_t
GetUShort()
const {
return Get<uint16_t>(); }
93 int32_t
GetInt()
const {
return Get<int32_t>(); }
94 uint32_t
GetUInt()
const {
return Get<uint32_t>(); }
95 int64_t
GetXtra()
const {
return Get<int64_t>(); }
96 uint64_t
GetUXtra()
const {
return Get<int64_t>(); }
97 float GetFloat()
const {
return Get<float>(); }
void AddAllowedStates(const std::string &states)
virtual std::string GetDescription() const
A general base-class describing events issues in a state machine.
const char * GetText() const
EventImp()
Constructor. Stores the target state given.
Adds some functionality to boost::posix_time::ptime for our needs.
EventImp & operator()(int state)
std::vector< int > fAllowedStates
EventImp & operator()(const char *str)
std::string GetString() const
EventImp & operator()(const std::function< int(const EventImp &)> &func)
uint16_t GetUShort() const
virtual void SetDescription(const std::string &)
virtual void Print(std::ostream &out, bool strip=false) const
virtual Time GetTime() const
virtual std::string GetFormat() const
virtual int GetQoS() const
bool IsStateAllowed(int state) const
static const Time None
A none-time, this can be used as a simple representation of an invalid time.
void AddAllowedState(int state)
uint64_t GetJavaDate() const
std::string GetTimeAsStr(const char *fmt) const
EventImp & AssignFunction(const std::function< int(const EventImp &)> &func=std::function< int(const EventImp &)>())
uint64_t GetUXtra() const
EventImp & operator()(const std::string str)
virtual std::string GetName() const
std::vector< char > GetVector() const
T Get(size_t offset=0) const
std::function< int(const EventImp &)> fFunction
List of states in which this event is allowed.
virtual const void * GetData() const
const T & Ref(size_t offset=0) const
virtual bool IsEmpty() const
const T * Ptr(size_t offset=0) const
virtual size_t GetSize() const