Sese Framework
2.3.0
A cross-platform framework
|
Shared Memory Class. More...
#include <SharedMemory.h>
Public Types | |
using | Ptr = std::unique_ptr<SharedMemory> |
Public Member Functions | |
~SharedMemory () noexcept | |
Destructor. | |
void * | getBuffer () noexcept |
Static Public Member Functions | |
static SharedMemory::Ptr | create (const char *name, size_t size) noexcept |
static Result< Ptr, ErrorCode > | createEx (const char *name, size_t size) noexcept |
static SharedMemory::Ptr | use (const char *name) noexcept |
static Result< Ptr, ErrorCode > | useEx (const char *name) noexcept |
Private Member Functions | |
SharedMemory ()=default | |
Static Private Member Functions | |
static key_t | name2key (const char *name) noexcept |
Private Attributes | |
int | id {} |
void * | buffer = nullptr |
bool | isOwner {} |
Shared Memory Class.
using sese::system::SharedMemory::Ptr = std::unique_ptr<SharedMemory> |
|
privatedefault |
|
staticnoexcept |
Create a shared memory block
name | Shared memory name |
size | Shared memory size |
nullptr | Creation failed |
References MAKE_UNIQUE_PRIVATE.
Referenced by sese::system::IPCChannel::create().
|
staticnoexcept |
References sese::getErrorCode(), and sese::getErrorString().
|
noexcept |
|
staticprivatenoexcept |
|
staticnoexcept |
Use an existing shared memory block
name | Shared memory name |
nullptr | Acquisition failed |
References MAKE_UNIQUE_PRIVATE.
Referenced by sese::system::IPCChannel::use().
|
staticnoexcept |
References sese::getErrorCode(), and sese::getErrorString().
|
private |
Referenced by getBuffer(), and ~SharedMemory().
|
private |
|
private |
Referenced by ~SharedMemory().