Cbeam
Loading...
Searching...
No Matches
TestThreadedObject Class Reference
Inheritance diagram for TestThreadedObject:
Collaboration diagram for TestThreadedObject:

Public Member Functions

 TestThreadedObject (typename cbeam::concurrency::threaded_object< TestThreadedObject, int >::construction_token)
 
void on_start () override
 
void on_exit () override
 
- Public Member Functions inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int >
 threaded_object ()=default
 
virtual ~threaded_object () noexcept
 Destructor. Safely shuts down the managed thread by setting _running to false, notifying the condition variable, and then joining the thread.Catches and logs any std::system_error thrown by thread::join. Asserts in debug mode if such an exception is caught, as it indicates a serious bug that must be addressed.
 

Public Attributes

std::atomic< bool > _has_run {false}
 
std::atomic< bool > _finished {false}
 

Additional Inherited Members

- Static Public Member Functions inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int >
static std::unique_ptr< TestThreadedObjectcreate (std::shared_ptr< std::mutex > mtx, std::shared_ptr< std::condition_variable > cv, Args &&... args)
 
- Protected Member Functions inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int >
virtual bool is_message_available ()
 
virtual int get_message ()
 
virtual void on_message (const int &) noexcept
 
- Protected Attributes inherited from cbeam::concurrency::threaded_object< TestThreadedObject, int >
std::shared_ptr< std::mutex > _mtx
 
std::shared_ptr< std::condition_variable > _cv
 

Constructor & Destructor Documentation

◆ TestThreadedObject()

TestThreadedObject::TestThreadedObject ( typename cbeam::concurrency::threaded_object< TestThreadedObject, int >::construction_token )
inline

Member Function Documentation

◆ on_exit()

void TestThreadedObject::on_exit ( )
inlineoverridevirtual

◆ on_start()

void TestThreadedObject::on_start ( )
inlineoverridevirtual

Member Data Documentation

◆ _finished

std::atomic<bool> TestThreadedObject::_finished {false}

◆ _has_run

std::atomic<bool> TestThreadedObject::_has_run {false}

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