Shared object storage with custom construction and destruction hooks.
More...
#include <src/thread_safe.h>
|
| struct | ptr_t |
| | Pointer wrapper state protected by synchronization. More...
|
| |
|
|
using | construct_f = std::function<int(element_type &)> |
| | Callback signature used to construct the protected object.
|
| |
|
using | destruct_f = std::function<void(element_type &)> |
| | Callback signature used to destroy the protected object.
|
| |
|
using | element_type = T |
| | Object type stored in shared protected storage.
|
| |
|
| ptr_t | ref () |
| | Return a shared reference to the protected object.
|
| |
| template<class FC , class FD > |
| | shared_t (FC &&fc, FD &&fd) |
| | Construct a shared protected object with custom close and destruction hooks.
|
| |
template<class T>
class safe::shared_t< T >
Shared object storage with custom construction and destruction hooks.
◆ shared_t()
template<class T >
template<class FC , class FD >
Construct a shared protected object with custom close and destruction hooks.
- Parameters
-
| fc | Callable invoked when the shared object is closed. |
| fd | Callable invoked when the shared object is destroyed. |
◆ ref()
Return a shared reference to the protected object.
- Returns
- Reference handle that keeps the protected object alive.
The documentation for this class was generated from the following file: