YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
shmem::SharedMemory Class Reference

A named shared memory segment. More...

#include <shmem_carrier/ShmemPlatform.h>

Public Member Functions

 SharedMemory ()=default
 
 ~SharedMemory ()
 
 SharedMemory (const SharedMemory &)=delete
 
SharedMemory & operator= (const SharedMemory &)=delete
 
bool create (const std::string &name, size_t size)
 Create a new segment (removing any stale segment with the same name)
 
bool open (const std::string &name)
 Open an existing segment.
 
void close ()
 Unmap the segment.
 
void * data () const
 

Static Public Member Functions

static void unlink (const std::string &name)
 Remove the name of the segment (no-op on Windows)
 

Detailed Description

A named shared memory segment.

Definition at line 32 of file ShmemPlatform.h.

Constructor & Destructor Documentation

◆ SharedMemory() [1/2]

shmem::SharedMemory::SharedMemory ( )
default

◆ ~SharedMemory()

shmem::SharedMemory::~SharedMemory ( )

Definition at line 157 of file ShmemPlatform.cpp.

◆ SharedMemory() [2/2]

shmem::SharedMemory::SharedMemory ( const SharedMemory &  )
delete

Member Function Documentation

◆ close()

void shmem::SharedMemory::close ( )

Unmap the segment.

Definition at line 307 of file ShmemPlatform.cpp.

◆ create()

bool shmem::SharedMemory::create ( const std::string &  name,
size_t  size 
)

Create a new segment (removing any stale segment with the same name)

Definition at line 244 of file ShmemPlatform.cpp.

◆ data()

void * shmem::SharedMemory::data ( ) const
inline

Definition at line 50 of file ShmemPlatform.h.

◆ open()

bool shmem::SharedMemory::open ( const std::string &  name)

Open an existing segment.

Definition at line 277 of file ShmemPlatform.cpp.

◆ operator=()

SharedMemory & shmem::SharedMemory::operator= ( const SharedMemory &  )
delete

◆ unlink()

void shmem::SharedMemory::unlink ( const std::string &  name)
static

Remove the name of the segment (no-op on Windows)

Definition at line 316 of file ShmemPlatform.cpp.


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