eventstatus.h
#ifndef XF_EVENTSTATUS_H
#define XF_EVENTSTATUS_H
class XFEventStatus
{
public:
typedef enum
{
Unknown = 0,
Consumed = 0x0001,
NotConsumed = 0x0002,
RegionFinished = 0x0004,
Terminate = 0x0008
} eEventStatus;
XFEventStatus(eEventStatus eventStatus = Unknown) : status_(eventStatus) {}
bool operator == (const XFEventStatus::eEventStatus & eventStatus) const
{
return (this->status_ == eventStatus);
}
void operator |= (const XFEventStatus & eventStatus)
{
unsigned int s1 = status_, s2 = eventStatus.status_;
s1 |= s2;
status_ = (eEventStatus)s1;
}
bool is(const eEventStatus eventStatus) const
{
unsigned int mask = (unsigned int)eventStatus;
return ((((unsigned int)status_) & mask) == mask);
}
public:
eEventStatus status_;
};
typedef XFEventStatus::eEventStatus eEventStatus;
// end of xf_core group
#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