vulp  2.3.0
vulp.spine::AgentInterface Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AgentInterface()

vulp.spine::AgentInterface::AgentInterface ( const std::string &  name,
size_t  size 
)

Open interface to the agent at a given shared-memory file.

Parameters
[in]nameName of the shared memory file (e.g. "/vulp").
[in]sizeSize in bytes.

Shared memory objects are available as files in /dev/shm.

Definition at line 32 of file AgentInterface.cpp.

◆ ~AgentInterface()

vulp.spine::AgentInterface::~AgentInterface ( )

Unmap memory and unlink shared memory object.

Definition at line 76 of file AgentInterface.cpp.

Member Function Documentation

◆ data()

const char* vulp.spine::AgentInterface::data ( ) const
inline

Get pointer to data buffer.

Definition at line 66 of file AgentInterface.h.

◆ request()

Request vulp.spine::AgentInterface::request ( ) const
inline

Get current request from shared memory.

Definition at line 60 of file AgentInterface.h.

◆ set_request()

void vulp.spine::AgentInterface::set_request ( Request  request)

Set current request in shared memory.

Parameters
[in]requestNew request.

Definition at line 85 of file AgentInterface.cpp.

◆ size()

uint32_t vulp.spine::AgentInterface::size ( ) const
inline

Get size of current data buffer.

Definition at line 63 of file AgentInterface.h.

◆ write()

void vulp.spine::AgentInterface::write ( char *  data,
size_t  size 
)

Write data to the data buffer in shared memory.

Parameters
[in]dataData to write.
[in]sizeNumber of bytes to write.

Definition at line 89 of file AgentInterface.cpp.


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