TIBCO Adapter SDK C++ Reference
|
The timer is started as soon as the MTimer instance is constructed. Applications can deactivate the MTimer by calling MTimer::deactivate().
Timers are used in applications that poll based on a continuous interval instead of, for example, listening for data.
A timer name must be unique across one MApp application manager.
The following code fragment generates a repeating timer, which triggers at 2 second intervals, and the corresponding event listener.
int nInterval = 2; m_pMTimer = new MTimer( this, "my_timer", nInterval, true ); m_pMTimer->addListener( m_pTimerEventHandler );
Parameters | Description |
MApp* pMApp | Pointer to MApp application manager for this MTimer. |
const MString& rsName | Name of this timer. Must be unique. |
const MString& rsSessionName | Name of the TIBCO Rendezvous session in which this timer is created. |
unsigned long iInterval | Interval of this timer activity, in milliseconds. |
Mboolean bRepeating | If set to true (the default), create a repeating timer. A repeating timer reschedules itself each time it triggers; the effect is a potentially endless series of timer events at a regular interval. If set |
Mboolean bMustActivate = Mtrue | When set to true (the default) this timer is created as an active timer. Otherwise, applications have to explicitly call the activate() method. |
only | timer. |
M_ERROR_RV_EVM_ERROR,
MException on any failure to create or activate the timer.
MTimer(MApp* pMApp, const MString& rsName, const MString& rsSessionName, unsigned long iInterval, Mboolean bRepeating, Mboolean bMustActivate = Mtrue) throw(MException);