55 auto map = std::make_unique<shmem::SharedMemory>();
98 auto newMap = std::make_unique<shmem::SharedMemory>();
105 auto* pNewHeader =
static_cast<ShmemHeader_t*
>(newMap->data());
106 char* pNewData =
reinterpret_cast<char*
>(pNewHeader + 1);
108 pNewHeader->
size = newsize;
109 pNewHeader->newsize = newsize;
110 pNewHeader->resize =
false;
112 pNewHeader->attached =
false;
114 pNewHeader->tail = 0;
134 m_pMap = std::move(newMap);
171 if (!
Resize((
int)required)) {
const yarp::os::LogComponent & SHMEMCARRIER()
bool write(const yarp::os::Bytes &b)
bool open(int port, int size=4096)
shmem::NamedSemaphore m_WaitDataSem
shmem::NamedSemaphore m_AccessMutex
std::vector< std::unique_ptr< shmem::SharedMemory > > m_OldMaps
ShmemHeader_t * m_pHeader
std::unique_ptr< shmem::SharedMemory > m_pMap
bool wait()
Wait until the semaphore is available.
static void unlink(const std::string &name)
Remove the name of the semaphore (no-op on Windows)
bool create(const std::string &name, unsigned int initial, unsigned int max)
Create a new semaphore (removing any stale semaphore with the same name)
static void unlink(const std::string &name)
Remove the name of the segment (no-op on Windows)
A simple abstraction for a block of bytes.
#define yCError(component,...)
#define yCDebug(component,...)
std::string objectName(const char *kind, int port, int index=-1)
Build the name of a named inter-process object.