|
join 1.0
lightweight network framework library
|
shared memory base class. More...
#include <shared.hpp>


Public Member Functions | |
| BasicQueue (const std::string &name, uint64_t elementSize=1472, uint64_t capacity=144) | |
| create instance. | |
| BasicQueue (const BasicQueue &other)=delete | |
| copy constructor. | |
| BasicQueue & | operator= (const BasicQueue &other)=delete |
| copy assignment operator. | |
| virtual | ~BasicQueue () |
| destroy the instance. | |
| int | open () override |
| open or create the shared memory segment. | |
| void | close () noexcept override |
| close the shared memory segment. | |
| const void * | get (uint64_t offset=0) const override |
| get a const pointer to the shared memory data region at a given offset. | |
| void * | get (uint64_t offset=0) override |
| get a pointer to the shared memory data region at a given offset. | |
| uint64_t | elementSize () const noexcept |
| get the element size of the shared memory region. | |
| uint64_t | capacity () const noexcept |
| get the capacity of the shared memory region. | |
| uint64_t | size () const noexcept override |
| get the size of the shared memory region. | |
Public Member Functions inherited from join::SharedMemory | |
| SharedMemory (const std::string &name, uint64_t size) | |
| create instance. | |
| virtual | ~SharedMemory () |
| destroy the instance. | |
| bool | opened () const noexcept |
| check if shared memory is opened. | |
Protected Attributes | |
| Policy | _policy |
| shared memory segment policy. | |
| uint64_t | _elementSize = 0 |
| shared memory segment element size. | |
| uint64_t | _capacity = 0 |
| shared memory segment capacity. | |
| uint64_t | _totalSize = 0 |
| total shared memory size. | |
| uint64_t | _userSize = 0 |
| user shared memory size. | |
| SharedSegment * | _segment = nullptr |
| shared memory segment. | |
Protected Attributes inherited from join::SharedMemory | |
| std::string | _name |
| shared memory name. | |
| uint64_t | _size = 0 |
| shared memory size. | |
| void * | _ptr = nullptr |
| pointer to mapped shared memory. | |
| int | _fd = -1 |
| shared memory file descriptor. | |
Additional Inherited Members | |
Static Public Member Functions inherited from join::SharedMemory | |
| static int | unlink (const std::string &name) noexcept |
| destroy synchronization primitives and unlink the shared memory segment. | |
shared memory base class.
|
inline |
create instance.
| name | shared memory segment name. |
| elementSize | shared memory segment element size. |
| capacity | shared memory segment capacity. |
|
delete |
copy constructor.
| other | other object to copy. |
|
inlinevirtual |
destroy the instance.
|
inlinenoexcept |
get the capacity of the shared memory region.
|
inlineoverridevirtualnoexcept |
close the shared memory segment.
Reimplemented from join::SharedMemory.
|
inlinenoexcept |
get the element size of the shared memory region.
|
inlineoverridevirtual |
get a const pointer to the shared memory data region at a given offset.
| offset | byte offset from the start of the data region. |
| std::out_of_range | if offset is out of bounds. |
Reimplemented from join::SharedMemory.
|
inlineoverridevirtual |
get a pointer to the shared memory data region at a given offset.
| offset | byte offset from the start of the data region. |
| std::out_of_range | if offset is out of bounds. |
Reimplemented from join::SharedMemory.
|
inlineoverridevirtual |
open or create the shared memory segment.
Reimplemented from join::SharedMemory.
|
delete |
copy assignment operator.
| other | other object to assign. |
|
inlineoverridevirtualnoexcept |
get the size of the shared memory region.
Reimplemented from join::SharedMemory.
|
protected |
shared memory segment capacity.
|
protected |
shared memory segment element size.
|
protected |
shared memory segment policy.
|
protected |
shared memory segment.
|
protected |
total shared memory size.
|
protected |
user shared memory size.