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 (Long interval)
 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
 

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() [1/2]

EThreadEventTimer::EThreadEventTimer ( )
inline

Default class constructor.

◆ EThreadEventTimer() [2/2]

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::~EThreadEventTimer ( )
inline

Class destructor.

Member Function Documentation

◆ destroy()

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.

◆ getId()

Long EThreadEventTimer::getId ( )
inline

Returns the unique timer id.

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

◆ getInterval()

Long EThreadEventTimer::getInterval ( )
inline

Returns the timer interval in milliseconds.

◆ isInitialized()

Bool EThreadEventTimer::isInitialized ( )
inline

Indicates if this timer object has been initialized.

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

◆ setInterval()

Void EThreadEventTimer::setInterval ( Long  interval)
inline

sets the timer interval

Parameters
intervalthe timer interval in milliseconds.

◆ setOneShot()

Void EThreadEventTimer::setOneShot ( Bool  oneshot)
inline

sets the type of timer

Parameters
oneshotTrue - one shot timer, False - periodic (recurring timer)

◆ start()

Void EThreadEventTimer::start ( )
inline

Starts the timer.

Exceptions
EThreadTimerError_NotInitializedtimer not initialized
EThreadTimerError_UnableToStartunable to start the timer

◆ stop()

Void EThreadEventTimer::stop ( )
inline

Stops the timer.

Friends And Related Function Documentation

◆ EThreadEvent

template<class TQueue , class TMessage >
friend class EThreadEvent
friend

◆ EThreadEventTimerHandler

friend class EThreadEventTimerHandler
friend

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