chrono::ros::ipc::SharedMemory Class Reference

Description

Cross-platform shared memory wrapper.

#include <ChROSSharedMemory.h>

Public Member Functions

 SharedMemory (const std::string &name, size_t size, bool create_new=true)
 Create or open shared memory segment. More...
 
 ~SharedMemory ()
 Destructor.
 
void * GetPtr () const
 Get pointer to mapped memory.
 
size_t GetSize () const
 Get size of mapped memory.
 
bool IsValid () const
 Check if memory is successfully mapped.
 
void Close ()
 Unmap and close shared memory.
 

Constructor & Destructor Documentation

◆ SharedMemory()

chrono::ros::ipc::SharedMemory::SharedMemory ( const std::string &  name,
size_t  size,
bool  create_new = true 
)

Create or open shared memory segment.

Parameters
nameUnique name for the shared memory segment
sizeSize in bytes (only used when creating new segment)
create_newIf true, create new segment; if false, open existing

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_ros/ipc/ChROSSharedMemory.h
  • /builds/uwsbel/chrono/src/chrono_ros/ipc/ChROSSharedMemory.cpp