|
RADLib
RADical C++ application framework
|
Base class for event receivers, senders, and thread-affinity aware objects. More...
#include <RADCore.h>
Inheritance diagram for RADCore::RADObject:Public Member Functions | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Base class for event receivers, senders, and thread-affinity aware objects.
| RADCore::RADObject::RADObject | ( | ) |
Creates a RADObject bound to the current thread.
|
virtual |
Disconnects tracked event links and releases lifetime token.
| EventLoop* RADCore::RADObject::associatedEventLoop | ( | ) | const |
Returns the associated event loop, if any.
| std::weak_ptr<void> RADCore::RADObject::lifetimeToken | ( | ) | const |
Returns a weak token used to drop queued callbacks after destruction.
| void RADCore::RADObject::moveToThread | ( | std::thread::id | tId, |
| EventLoop * | loop = nullptr |
||
| ) |
Moves the object's affinity to tId and optional loop.
| void RADCore::RADObject::registerLink | ( | const ConnectionRecord & | record | ) |
Registers a connection for cleanup when this object is destroyed.
| ThreadAffinity RADCore::RADObject::threadAffinity | ( | ) | const |
Returns both thread id and associated loop atomically.
| std::thread::id RADCore::RADObject::threadId | ( | ) | const |
Returns the thread id this object is currently associated with.