Simplified XF 1.1.0

eventstatus.h
1#ifndef XF_EVENTSTATUS_H
2#define XF_EVENTSTATUS_H
3
15 class XFEventStatus
16{
17 public:
23 typedef enum
24 {
25 Unknown = 0,
26 Consumed = 0x0001,
27 NotConsumed = 0x0002,
28 RegionFinished = 0x0004,
29 Terminate = 0x0008
30 } eEventStatus;
31
37 XFEventStatus(eEventStatus eventStatus = Unknown) : status_(eventStatus) {}
38
42 bool operator == (const XFEventStatus::eEventStatus & eventStatus) const
43 {
44 return (this->status_ == eventStatus);
45 }
46
52 void operator |= (const XFEventStatus & eventStatus)
53 {
54 unsigned int s1 = status_, s2 = eventStatus.status_;
55 s1 |= s2;
56 status_ = (eEventStatus)s1;
57 }
58
62 bool is(const eEventStatus eventStatus) const
63 {
64 unsigned int mask = (unsigned int)eventStatus;
65 return ((((unsigned int)status_) & mask) == mask);
66 }
67
68 public:
69 eEventStatus status_;
70};
71
72 typedef XFEventStatus::eEventStatus eEventStatus;
73 // end of xf_core group
75#endif // XF_EVENTSTATUS_H
XFEventStatus
Event status returned after event processing.
Definition: eventstatus.h:16
XFEventStatus::is
bool is(const eEventStatus eventStatus) const
Checks if the given event status (r-value) is present in the actual (l-value).
Definition: eventstatus.h:62
XFEventStatus::status_
eEventStatus status_
Attribute containing the status of the event.
Definition: eventstatus.h:69
XFEventStatus::operator==
bool operator==(const XFEventStatus::eEventStatus &eventStatus) const
Definition: eventstatus.h:42
XFEventStatus::operator|=
void operator|=(const XFEventStatus &eventStatus)
OR assignment.
Definition: eventstatus.h:52
XFEventStatus::XFEventStatus
XFEventStatus(eEventStatus eventStatus=Unknown)
Definition: eventstatus.h:37
XFEventStatus::eEventStatus
eEventStatus
Definition: eventstatus.h:24
XFEventStatus::NotConsumed
@ NotConsumed
Event not consumed.
Definition: eventstatus.h:27
XFEventStatus::RegionFinished
@ RegionFinished
Composite state machine finished.
Definition: eventstatus.h:28
XFEventStatus::Terminate
@ Terminate
Terminate state machine.
Definition: eventstatus.h:29
XFEventStatus::Consumed
@ Consumed
Event consumed.
Definition: eventstatus.h:26