vulp
2.3.0
|
Memory map to shared memory. More...
#include <AgentInterface.h>
Public Member Functions | |
AgentInterface (const std::string &name, size_t size) | |
Open interface to the agent at a given shared-memory file. More... | |
~AgentInterface () | |
Unmap memory and unlink shared memory object. More... | |
void | set_request (Request request) |
Set current request in shared memory. More... | |
void | write (char *data, size_t size) |
Write data to the data buffer in shared memory. More... | |
Request | request () const |
Get current request from shared memory. More... | |
uint32_t | size () const |
Get size of current data buffer. More... | |
const char * | data () const |
Get pointer to data buffer. More... | |
Memory map to shared memory.
On memory mapping, shared memory and memory-mapped files: https://w3.cs.jmu.edu/kirkpams/OpenCSF/Books/csf/html/MMap.html
Definition at line 32 of file AgentInterface.h.
vulp.spine::AgentInterface::AgentInterface | ( | const std::string & | name, |
size_t | size | ||
) |
Open interface to the agent at a given shared-memory file.
[in] | name | Name of the shared memory file (e.g. "/vulp"). |
[in] | size | Size in bytes. |
Shared memory objects are available as files in /dev/shm
.
Definition at line 32 of file AgentInterface.cpp.
vulp.spine::AgentInterface::~AgentInterface | ( | ) |
Unmap memory and unlink shared memory object.
Definition at line 76 of file AgentInterface.cpp.
|
inline |
Get pointer to data buffer.
Definition at line 66 of file AgentInterface.h.
|
inline |
Get current request from shared memory.
Definition at line 60 of file AgentInterface.h.
void vulp.spine::AgentInterface::set_request | ( | Request | request | ) |
Set current request in shared memory.
[in] | request | New request. |
Definition at line 85 of file AgentInterface.cpp.
|
inline |
Get size of current data buffer.
Definition at line 63 of file AgentInterface.h.
void vulp.spine::AgentInterface::write | ( | char * | data, |
size_t | size | ||
) |
Write data to the data buffer in shared memory.
[in] | data | Data to write. |
[in] | size | Number of bytes to write. |
Definition at line 89 of file AgentInterface.cpp.