|
cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
|
Class of buffers of shared objects. More...
#include <msgpack_rpc/util/impl/shared_objects.h>
Public Member Functions | |
| SharedObjectBuffer () noexcept=default | |
| Constructor. | |
| void | add_reference () noexcept |
| Increase the reference count. | |
| template<typename... Args> | |
| void | emplace (Args &&... args) |
| Construct an object. | |
| T * | get () noexcept |
| Access the object. | |
| void | release () noexcept |
| Decrease the reference count and destruct the object if needed. | |
| bool | try_start_use () noexcept |
| Try to start to use. | |
Private Attributes | |
| std::optional< T > | buffer_ {} |
| Buffer. | |
| std::atomic< int > | reference_count_ {-1} |
| Reference count. (-1 for unused buffer.) | |
Class of buffers of shared objects.
| T | Type of the shared objects. |
Definition at line 37 of file shared_objects.h.
|
inlinenoexcept |
Increase the reference count.
Definition at line 73 of file shared_objects.h.
|
inline |
Construct an object.
| Args | Types of arguments. |
| [in] | args | Arguments. |
Definition at line 66 of file shared_objects.h.
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
Decrease the reference count and destruct the object if needed.
Definition at line 80 of file shared_objects.h.
|
inlinenodiscardnoexcept |
Try to start to use.
| true | Succeeded. |
| false | Failed. |
Definition at line 50 of file shared_objects.h.
|
private |
Buffer.
Definition at line 104 of file shared_objects.h.
|
private |
Reference count. (-1 for unused buffer.)
Definition at line 101 of file shared_objects.h.