EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | Friends | List of all members
EThreadEventTimer Class Reference

Thread timer class. More...

#include <etevent.h>

Inheritance diagram for EThreadEventTimer:
EStatic

Public Member Functions

 EThreadEventTimer ()
 Default class constructor. More...
 
 EThreadEventTimer (Long milliseconds, Bool oneshot=False)
 Class constructor with configuration parameters. More...
 
 ~EThreadEventTimer ()
 Class destructor. More...
 
Void destroy ()
 Stops and destroys the underlying timer object. More...
 
Void start ()
 Starts the timer. More...
 
Void stop ()
 Stops the timer. More...
 
Long getInterval ()
 Returns the timer interval in milliseconds. More...
 
Void setInterval (LongLong interval)
 sets the timer interval More...
 
Void setInterval (const ETime &t)
 sets the timer interval. More...
 
Void setOneShot (Bool oneshot)
 sets the type of timer More...
 
Long getId ()
 Returns the unique timer id. More...
 
Bool isInitialized ()
 Indicates if this timer object has been initialized. More...
 
- Public Member Functions inherited from EStatic
virtual Int getInitType ()
 
virtual Void init (EGetOpt &opt)
 Performs class specific initialization. More...
 
virtual Void uninit ()
 Performs uninitialization at system shutdown. More...
 

Friends

class EThreadEventTimerHandler
 
template<class TQueue , class TMessage >
class EThreadEvent
 
template<class TQueue , class TMessage , class TWorker >
class EThreadEventWorkGroup
 

Additional Inherited Members

- Static Public Member Functions inherited from EStatic
static Void Initialize (EGetOpt &opt)
 
static Void UnInitialize ()
 

Detailed Description

Thread timer class.

EThreadBase::Timer represents an individual timer. When the timer expires, the EM_TIMER event will be raised. The application can handle the timer by overrideing the onTimer method.

Constructor & Destructor Documentation

EThreadEventTimer::EThreadEventTimer ( )
inline

Default class constructor.

EThreadEventTimer::EThreadEventTimer ( Long  milliseconds,
Bool  oneshot = False 
)
inline

Class constructor with configuration parameters.

Parameters
millisecondsthe number of milliseconds before the timer expires
oneshotTrue - one shot timer, False - periodic (recurring) timer
EThreadEventTimer::~EThreadEventTimer ( )
inline

Class destructor.

Member Function Documentation

Void EThreadEventTimer::destroy ( )
inline

Stops and destroys the underlying timer object.

Calling destroy() will stop the timer and then delete the underlying timer object. This method is called by the destructor.

Long EThreadEventTimer::getId ( )
inline

Returns the unique timer id.

The timer ID is created internally when the timer object is instantiated.

Long EThreadEventTimer::getInterval ( )
inline

Returns the timer interval in milliseconds.

Bool EThreadEventTimer::isInitialized ( )
inline

Indicates if this timer object has been initialized.

The timer ID is created internally when the timer object is instantiated.

Void EThreadEventTimer::setInterval ( LongLong  interval)
inline

sets the timer interval

Parameters
intervalthe timer interval in milliseconds.
Void EThreadEventTimer::setInterval ( const ETime t)
inline

sets the timer interval.

Parameters
ta reference to an ETime object that represents the absolute expiration time.

The ETime parameter represents either a specific time in the future or a duration (the result of ETime.subtract()). The ETime parameter is assumed to be a duration if the value is less than the current system time.

Void EThreadEventTimer::setOneShot ( Bool  oneshot)
inline

sets the type of timer

Parameters
oneshotTrue - one shot timer, False - periodic (recurring timer)
Void EThreadEventTimer::start ( )
inline

Starts the timer.

Exceptions
EThreadTimerError_NotInitializedtimer not initialized
EThreadTimerError_UnableToStartunable to start the timer
Void EThreadEventTimer::stop ( )
inline

Stops the timer.

Friends And Related Function Documentation

template<class TQueue , class TMessage >
friend class EThreadEvent
friend
friend class EThreadEventTimerHandler
friend
template<class TQueue , class TMessage , class TWorker >
friend class EThreadEventWorkGroup
friend

The documentation for this class was generated from the following file: