A timeout is an event used for notification that a specified time interval has expired (that is, it implements a UML time event).
Timeouts
are either created by instances entering states with timeout transitions,
or delay requests from user code. In the latter case, the timeoutDelayId of
this event is as follows:
const short timeoutDelayId
= -1;
The OMTimeout class is declared in the header file event.h.
OMTimeout uses the following comparison
functions to manipulate its heap structure:
int
operator==(OMTimeout& tn)
{OMBoolean matchDest =
getDestination() ==
tn.getDestination();
OMBoolean matchId = ((getTimeoutId() ==
tn.getTimeoutId())
|| (getTimeoutId() ==
OMEventAnyEventId) ||
(OMEventAnyEventId == tn.getTimeoutId()));
return (matchDest &&
matchId);
}
int operator>(OMTimeout&
tn) {return dueTime >
tn.dueTime;}
int
operator<(OMTimeout& tn) {return dueTime <
tn.dueTime;}
This global attribute identifies a delay request from user code. It is defined as follows:
const short timeoutDelayId = -1;
This public macro specifies a set of methods that declare the memory pool for timeouts. The default number of timeouts is 100.
The DECLARE_MEMORY_ALLOCATOR macro is defined in MemAlloc.h as follows:
#define DECLARE_MEMORY_ALLOCATOR (CLASSNAME)
public:
CLASSNAME * OMMemoryPoolNextChunk;
DECLARE_ALLOCATION_OPERATORS
static void OMMemoryPoolIsEmpty();
static void OMMemoryPoolSetIncrement(int value);
static void OMCallMemoryPoolIsEmpty(
OMBoolean flagValue);
static void OMSetMemoryAllocator(
CLASSNAME*(*newAllocator)(int));