30 cxTimer(
const std::shared_ptr<cxFunction>& pFuncPtr,
unsigned int pDelayMS,
bool pWaitInSeparateThread =
true);
39 virtual void function(
const std::shared_ptr<cxFunction>& pFuncPtr);
46 virtual std::shared_ptr<cxFunction>
function()
const;
53 virtual void delay(
unsigned int pDelay);
60 virtual unsigned int delay()
const;
86 virtual void stop(
bool pRunFunction =
true);
103 std::shared_ptr<cxFunction> mFunction;
105 bool mWaitInSeparateThread;
107 std::atomic<bool> mIsWaiting{
false};
108 std::atomic<bool> mRunFunctionAfterWaiting{
true};
109 std::mutex mWaitMutex;
Represents a timer that will run a function after.
Definition cxTimer.h:21
virtual unsigned int delay() const
Returns the delay (in MS) that is set in the object.
Definition cxTimer.cpp:46
virtual std::shared_ptr< cxFunction > function() const
Returns the function pointer that is set in the object.
Definition cxTimer.cpp:35
virtual ~cxTimer()
Definition cxTimer.cpp:25
virtual void start()
Starts the timer.
Definition cxTimer.cpp:62
virtual bool isWaiting() const
Returns whether the timer object is currently waiting for time to elapse.
Definition cxTimer.cpp:76
virtual std::string cxTypeStr() const
Returns the name of the cxWidgets class. This can be used to.
Definition cxTimer.cpp:81
virtual void function(const std::shared_ptr< cxFunction > &pFuncPtr)
Sets/changes the function pointer.
virtual bool waitInSeparateThread() const
Returns the setting for whether or not to wait in a separate thread.
Definition cxTimer.cpp:57
virtual void stop(bool pRunFunction=true)
Stops the timer.
Definition cxTimer.cpp:70
cxBorderChars.h - Defines border characters to be used in drawing a box (i.e., in cxWindow and all it...
Definition cxApp.cpp:5