ARC SDK
|
Base class for per-thread object. More...
#include <arc/Thread.h>
Public Member Functions | |
ThreadDataItem (void) | |
Dummy constructor which does nothing. More... | |
ThreadDataItem (std::string &key) | |
Creates instance and attaches it to current thread under key. More... | |
ThreadDataItem (const std::string &key) | |
Creates instance and attaches it to current thread under key. More... | |
void | Attach (std::string &key) |
Attaches object to current thread under key. More... | |
void | Attach (const std::string &key) |
Attaches object to current thread under key. More... | |
virtual void | Dup (void) |
Creates copy of object. More... | |
Static Public Member Functions | |
static ThreadDataItem * | Get (const std::string &key) |
Retrieves object attached to thread under key. More... | |
Friends | |
class | ThreadData |
Base class for per-thread object.
Classes inherited from this one are attached to current thread under specified key and destroyed only when thread ends or object is replaced by another one with same key.
Arc::ThreadDataItem::ThreadDataItem | ( | void | ) |
Dummy constructor which does nothing.
To make object usable one of the Attach(...) methods must be used.
Arc::ThreadDataItem::ThreadDataItem | ( | std::string & | key | ) |
Creates instance and attaches it to current thread under key.
If supplied key is empty random one is generated and stored in key variable.
Arc::ThreadDataItem::ThreadDataItem | ( | const std::string & | key | ) |
Creates instance and attaches it to current thread under key.
void Arc::ThreadDataItem::Attach | ( | std::string & | key | ) |
Attaches object to current thread under key.
If supplied key is empty random one is generated and stored in key variable. This method must be used only if object was created using dummy constructor.
void Arc::ThreadDataItem::Attach | ( | const std::string & | key | ) |
Attaches object to current thread under key.
This method must be used only if object was created using dummy constructor.
|
virtual |
Creates copy of object.
This method is called when a new thread is created from the current thread. It is called in the new thread, so the new object - if created - gets attached to the new thread. If the object is not meant to be inherited by new threads then this method should do nothing.
|
static |
Retrieves object attached to thread under key.