This
method is the constructor for the OMTimerManager class.
SignatureRP_FRAMEWORK_DLL OMTimerManager (int ticktime =
OMTimerManagerDefaults::defaultTicktime,
unsigned int maxTM =
OMTimerManagerDefaults::defaultMaxTM,
OMBoolean isRealTimeModel = TRUE);
Parametersticktime
Specifies the basic system tick, in
milliseconds. At every tick, the Rational® Rhapsody® framework and user
application are notified that the time was advanced.
The defaultTicktime specifies
the default tick time, defined in timer.h as follows:
static
const unsigned defaultTicktime;
The
default value is specified in oxf.cpp as follows:
const
unsigned OMTimerManagerDefaults::
defaultTicktime = 100;
maxTM
Specifies the maximum number of timeouts
that can exist simultaneously in the system. The value for maxTM is
used to construct the heap and the matured list for storing timeouts.
The defaultMaxTM is defined in timer.h as
follows:
static const unsigned defaultMaxTM;
The default value is specified in oxf.cpp as
follows:
const unsigned OMTimerManagerDefaults::
defaultMaxTM = 100;
isRealTimeModel
Specifies whether the time model is
real (TRUE) or simulated (FALSE).
Notes- The defaultTicktime is 100 milliseconds.
As you decrease ticktime (for example, to 50 ms)
you get a "finer" timer accuracy, but the thread consumes more CPU
time (because it's a separate thread). In addition, the actions
that your application performs every ticktime also
take time. If you specify a very small ticktime,
the system might get into conflicts. You should use 100 milliseconds
for this value.
- You can change the default
clock tick of 100 milliseconds
by editing the value assigned to defaultTicktime in
the constructor and then recompiling the OXF libraries.
- You can override the default tick time
by setting the TimerResolution property (under <lang>_CG::Framework).
- The framework uses maxTM to construct
a heap and a matured list of timeouts. The defaultMaxTM is 100. maxTM enables
the dynamic framework to provide a static architecture, thereby avoid
dynamic memory allocation during run time. In addition, a static run-time
architecture enables you to easily analyze the system. Rational Rhapsody static
events facilitate real-time and safety-critical systems that do not
require (or allow) dynamic memory management during run time. Note,
however, that Rational Rhapsody requires malloc during
initialization and your application must support dynamic memory management.
- The OMTimeout class macro creates the memory pool for timeouts.
The new operator
gets memory from the memory pool. The Delete operation
returns memory to the memory pool.
- To
change the value of maxTM for your application, change
the defaultMaxTM attribute. You can also override
the default maximum number of timeouts by setting the TimerMaxTimeouts property
(under <lang>_CG::Framework).
- If your application exceeds maxTM and
tries to create additional timeouts, the return value will be NULL.
You must specify, in advance, the maximum number of timeouts that
can exist together in the system.