Ocean
|
Definition of scoped worker object. More...
Public Member Functions | |
ScopedWorker ()=default | |
Creates an empty scoped worker object. More... | |
ScopedWorker (ScopedWorker &&object) noexcept | |
Move constructor. More... | |
ScopedWorker (Worker *worker) noexcept | |
Creates a new scoped worker object. More... | |
~ScopedWorker () | |
Destructs a scoped worker object and unlocks the internal worker object automatically. More... | |
Worker * | worker () const |
Returns the internal worker object. More... | |
void | release () |
Explicitly releases the object and does not wait until the scope ends. More... | |
ScopedWorker & | operator= (ScopedWorker &&object) noexcept |
Move a scoped worker object. More... | |
Worker * | operator() () const |
Returns the internal worker object. More... | |
operator bool () const | |
Returns whether this scoped objects holds an internal worker object. More... | |
Private Member Functions | |
ScopedWorker (const ScopedWorker &scopedWorker)=delete | |
Disabled copy constructor. More... | |
ScopedWorker & | operator= (const ScopedWorker &scopedWorker)=delete |
Disabled copy operator. More... | |
Private Attributes | |
Worker * | worker_ = nullptr |
Internal worker object. More... | |
Definition of scoped worker object.
|
default |
Creates an empty scoped worker object.
|
inlinenoexcept |
Move constructor.
object | The object to move |
|
inlineexplicitnoexcept |
Creates a new scoped worker object.
worker | The worker object of this scoped object. |
|
inline |
Destructs a scoped worker object and unlocks the internal worker object automatically.
|
privatedelete |
Disabled copy constructor.
scopedWorker | Object which would be copied |
|
inlineexplicit |
Returns whether this scoped objects holds an internal worker object.
|
inline |
Returns the internal worker object.
Beware: Do not store this object outside this scoped object. The internal object will exist as long this scoped objects exist.
|
privatedelete |
Disabled copy operator.
scopedWorker | Object which would be copied |
|
inlinenoexcept |
Move a scoped worker object.
object | The object to move |
|
inline |
Explicitly releases the object and does not wait until the scope ends.
The internal worker object will be returned to the worker pool and cannot be accessed anymore by this object.
|
inline |
Returns the internal worker object.
Beware: Do not store this object outside this scoped object. The internal object will exist as long this scoped objects exist.
|
private |
Internal worker object.