cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::util::impl::SharedObjectMemoryPool< T > Class Template Reference

Class of memory pools of shared objects. More...

#include <msgpack_rpc/util/impl/shared_objects.h>

Inheritance diagram for msgpack_rpc::util::impl::SharedObjectMemoryPool< T >:
Collaboration diagram for msgpack_rpc::util::impl::SharedObjectMemoryPool< T >:

Public Member Functions

 SharedObjectMemoryPool (const SharedObjectMemoryPool &)=delete
 SharedObjectMemoryPool (SharedObjectMemoryPool &&)=delete
 SharedObjectMemoryPool (std::size_t num_buffers)
 Constructor.
 ~SharedObjectMemoryPool ()=default
 Destructor.
template<typename... Args>
SharedObject< T > create (Args &&... args)
 Create a shared object.
SharedObjectMemoryPooloperator= (const SharedObjectMemoryPool &)=delete
SharedObjectMemoryPooloperator= (SharedObjectMemoryPool &&)=delete

Static Public Member Functions

static std::shared_ptr< SharedObjectMemoryPool< T > > create (std::size_t num_buffers)
 Create a memory pool.

Private Attributes

std::vector< SharedObjectBuffer< T > > buffers_
 Buffers.
std::size_t next_buffer_index_ {0}
 Index of the next buffer.

Detailed Description

template<typename T>
class msgpack_rpc::util::impl::SharedObjectMemoryPool< T >

Class of memory pools of shared objects.

Template Parameters
TType of shared objects.

Definition at line 218 of file shared_objects.h.

Constructor & Destructor Documentation

◆ SharedObjectMemoryPool()

template<typename T>
msgpack_rpc::util::impl::SharedObjectMemoryPool< T >::SharedObjectMemoryPool ( std::size_t num_buffers)
inlineexplicit

Constructor.

Parameters
[in]num_buffersNumber of buffers.

Definition at line 237 of file shared_objects.h.

Member Function Documentation

◆ create() [1/2]

template<typename T>
template<typename... Args>
SharedObject< T > msgpack_rpc::util::impl::SharedObjectMemoryPool< T >::create ( Args &&... args)
inlinenodiscard

Create a shared object.

Template Parameters
ArgsTypes of arguments.
Parameters
[in]argsArguments.
Returns
Created object.

Definition at line 258 of file shared_objects.h.

◆ create() [2/2]

template<typename T>
std::shared_ptr< SharedObjectMemoryPool< T > > msgpack_rpc::util::impl::SharedObjectMemoryPool< T >::create ( std::size_t num_buffers)
inlinestatic

Create a memory pool.

Parameters
[in]num_buffersNumber of buffers.
Returns
Created memory pool.

Definition at line 227 of file shared_objects.h.

Member Data Documentation

◆ buffers_

template<typename T>
std::vector<SharedObjectBuffer<T> > msgpack_rpc::util::impl::SharedObjectMemoryPool< T >::buffers_
private

Buffers.

Definition at line 283 of file shared_objects.h.

◆ next_buffer_index_

template<typename T>
std::size_t msgpack_rpc::util::impl::SharedObjectMemoryPool< T >::next_buffer_index_ {0}
private

Index of the next buffer.

Definition at line 286 of file shared_objects.h.


The documentation for this class was generated from the following file: