cxWidgets 1.0
Public Member Functions | List of all members
cx::cxTimer Class Reference

Represents a timer that will run a function after. More...

#include <cxTimer.h>

Collaboration diagram for cx::cxTimer:
Collaboration graph

Public Member Functions

 cxTimer (const std::shared_ptr< cxFunction > &pFuncPtr, unsigned int pDelayMS, bool pWaitInSeparateThread=true)
 Constructor.
 
virtual ~cxTimer ()
 
virtual void function (const std::shared_ptr< cxFunction > &pFuncPtr)
 Sets/changes the function pointer.
 
virtual std::shared_ptr< cxFunctionfunction () const
 Returns the function pointer that is set in the object.
 
virtual void delay (unsigned int pDelay)
 Sets the delay (in MS) for the timeout.
 
virtual unsigned int delay () const
 Returns the delay (in MS) that is set in the object.
 
virtual void waitInSeparateThread (bool pWaitInSeparateThread)
 Sets whether or not to wait in a separate thread.
 
virtual bool waitInSeparateThread () const
 Returns the setting for whether or not to wait in a separate thread.
 
virtual void start ()
 Starts the timer.
 
virtual void stop (bool pRunFunction=true)
 Stops the timer.
 
virtual bool isWaiting () const
 Returns whether the timer object is currently waiting for time to elapse.
 
virtual std::string cxTypeStr () const
 Returns the name of the cxWidgets class. This can be used to.
 

Detailed Description

Represents a timer that will run a function after.

a specified number of milliseconds. This class is not

finished yet and currently shouldn't be used.

Constructor & Destructor Documentation

◆ cxTimer()

cx::cxTimer::cxTimer ( const std::shared_ptr< cxFunction > &  pFuncPtr,
unsigned int  pDelayMS,
bool  pWaitInSeparateThread = true 
)

Constructor.

Parameters
pFuncPtrA pointer to the function to run once the time is up
pDelayMSThe amount of time (in milliseconds) to delay before firing the function
pWaitInSeparateThreadWhether or not to wait in a separate thread. Defaults to true.

References start().

◆ ~cxTimer()

cx::cxTimer::~cxTimer ( )
virtual

Member Function Documentation

◆ cxTypeStr()

string cx::cxTimer::cxTypeStr ( ) const
virtual

Returns the name of the cxWidgets class. This can be used to.

determine the type of cxWidgets object that deriving classes

derive from in applications.

Returns
The name of the cxWidgets class.

◆ delay() [1/2]

unsigned int cx::cxTimer::delay ( ) const
virtual

Returns the delay (in MS) that is set in the object.

Returns
The delay (in MS) that is set in the object

◆ delay() [2/2]

void cx::cxTimer::delay ( unsigned int  pDelay)
virtual

Sets the delay (in MS) for the timeout.

Parameters
pDelayThe delay (in MS) for the timeout

◆ function() [1/2]

shared_ptr< cxFunction > cx::cxTimer::function ( ) const
virtual

Returns the function pointer that is set in the object.

Returns
The function pointer that is set in the object

◆ function() [2/2]

virtual void cx::cxTimer::function ( const std::shared_ptr< cxFunction > &  pFuncPtr)
virtual

Sets/changes the function pointer.

Parameters
pFuncPtrA pointer to the function to run once the time is up

◆ isWaiting()

bool cx::cxTimer::isWaiting ( ) const
virtual

Returns whether the timer object is currently waiting for time to elapse.

◆ start()

void cx::cxTimer::start ( )
virtual

Starts the timer.

Referenced by cxTimer().

◆ stop()

void cx::cxTimer::stop ( bool  pRunFunction = true)
virtual

Stops the timer.

Parameters
pRunFunctionBoolean: Whether to still run the function. Defaults to true.

◆ waitInSeparateThread() [1/2]

bool cx::cxTimer::waitInSeparateThread ( ) const
virtual

Returns the setting for whether or not to wait in a separate thread.

Returns
The setting for whether or not to wait in a separate thread

◆ waitInSeparateThread() [2/2]

void cx::cxTimer::waitInSeparateThread ( bool  pWaitInSeparateThread)
virtual

Sets whether or not to wait in a separate thread.

Parameters
pWaitInSeparateThreadWhether or not to wait in a separate thread

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