RMVL  2.5.0-dev
Robotic Manipulation and Vision Library
载入中...
搜索中...
未找到
rm::LatestBytesSHM类 参考

最新字节流共享内存对象 更多...

#include <rmvl/io/ipc.hpp>

类 rm::LatestBytesSHM 继承关系图:
rm::LatestBytesSHM 的协作图:

Public 成员函数

 LatestBytesSHM (std::string_view name, std::size_t capacity)
 构造或连接到一个最新字节流共享内存对象
bool write (std::string_view data) noexcept
 写入最新字节流
bool read (std::string &data, uint64_t &last_sequence) noexcept
 读取自 last_sequence 之后的最新字节流
bool empty () const noexcept
 判断是否为空(从未写入过)
std::size_t capacity () const noexcept
 获取最大字节容量
Public 成员函数 继承自 rm::SHMBase
 SHMBase (std::string_view name, std::size_t size)
 创建或打开共享内存对象并映射到当前进程地址空间
 ~SHMBase ()
 SHMBase (const SHMBase &)=delete
 SHMBase (SHMBase &&other) noexcept
SHMBaseoperator= (const SHMBase &)=delete
SHMBaseoperator= (SHMBase &&other) noexcept
void * data () noexcept
 获取共享内存映射指针
const void * data () const noexcept
 获取共享内存映射指针
bool isCreator () const noexcept
 是否为创建者

详细描述

最新字节流共享内存对象

构造及析构函数说明

◆ LatestBytesSHM()

rm::LatestBytesSHM::LatestBytesSHM ( std::string_view name,
std::size_t capacity )

构造或连接到一个最新字节流共享内存对象

参数
[in]name共享内存名称
[in]capacity最大字节容量
函数调用图:

成员函数说明

◆ capacity()

std::size_t rm::LatestBytesSHM::capacity ( ) const
inlinenoexcept

获取最大字节容量

函数调用图:

◆ empty()

bool rm::LatestBytesSHM::empty ( ) const
noexcept

判断是否为空(从未写入过)

◆ read()

bool rm::LatestBytesSHM::read ( std::string & data,
uint64_t & last_sequence )
noexcept

读取自 last_sequence 之后的最新字节流

参数
[out]data读取到的数据
[in,out]last_sequence上次成功读取到的序列号
返回
是否读取到新数据
函数调用图:

◆ write()

bool rm::LatestBytesSHM::write ( std::string_view data)
noexcept

写入最新字节流

参数
[in]data待写入的数据
返回
是否写入成功
函数调用图: