My Project
Public Member Functions | Public Attributes | List of all members
NPL::NPLTimer Struct Reference

timer struct More...

#include <NPLCommon.h>

Inheritance diagram for NPL::NPLTimer:

Public Member Functions

 NPLTimer (const string &nplFile, const string &sCode, float fInterval)
 
 NPLTimer (const string &nplFile, const string &sCode, DWORD dwInterval)
 
void Change (int dueTime, int period)
 Changes the start time and the interval between method invocations for a timer, using 32-bit signed integers to measure time intervals. More...
 
bool Tick (NPLRuntimeState_ptr runtime_state, DWORD nTickCount=0)
 set the tick count. More...
 

Public Attributes

const string m_nplFile
 
const string m_sCode
 

Detailed Description

timer struct

Constructor & Destructor Documentation

§ NPLTimer() [1/2]

NPLTimer::NPLTimer ( const string &  nplFile,
const string &  sCode,
float  fInterval 
)
Parameters
fIntervalinterval in seconds

§ NPLTimer() [2/2]

NPLTimer::NPLTimer ( const string &  nplFile,
const string &  sCode,
DWORD  dwInterval 
)
Parameters
nIntervalinterval in milliseconds

Member Function Documentation

§ Change()

void NPL::NPLTimer::Change ( int  dueTime,
int  period 
)

Changes the start time and the interval between method invocations for a timer, using 32-bit signed integers to measure time intervals.

[thread safe]

Parameters
nIDEventSpecifies the timer to be destroyed.For nIDEvent<=0, they are reserved for internal uses can not be killed by this function. This value must be the same as the nIDEvent value passed to the SetTimer function that created the timer.
dueTimeThe amount of time to delay before the invoking the callback method specified when the Timer was constructed, in milliseconds. Specify zero (0) to restart the timer immediately.
period:Thetime interval between invocations of the callback method specified when the Timer was constructed, in milliseconds.

§ Tick()

bool NPL::NPLTimer::Tick ( NPLRuntimeState_ptr  runtime_state,
DWORD  nTickCount = 0 
)

set the tick count.

it will return true, if the timer is activated. call this function regularly with new tick count. [thread safe]

Parameters
runtime_statethe NPL runtime state in which this is called.
nTickCountit should be ::GetTickCount() in millisecond. if 0, we will call the system ::GetTickCount() to get the current tick count.
Returns
true if timer is activated.

The documentation for this struct was generated from the following files: