![]() |
RMVL
2.4.0-dev
Robotic Manipulation and Vision Library
|
MPMC 原子共享内存对象 更多...
#include <rmvl/io/ipc.hpp>
Public 成员函数 | |
| AtomicSHM (std::string_view name) | |
| 构造 MPMC 共享内存对象 | |
| AtomicSHM (const AtomicSHM &)=delete | |
| AtomicSHM (AtomicSHM &&)=delete | |
| AtomicSHM & | operator= (const AtomicSHM &)=delete |
| AtomicSHM & | operator= (AtomicSHM &&)=delete |
| bool | read (T &value) noexcept |
| 原子的获取共享内存中数据,当 empty() 为真时,行为未定义 | |
| void | write (const T &value) noexcept |
| 向共享内存中原子的写入数据 | |
| bool | empty () const noexcept |
| 判断是否为空 (从未写入过) | |
| Public 成员函数 继承自 rm::SHMBase | |
| SHMBase (std::string_view name, std::size_t size) | |
| 创建或打开共享内存对象并映射到当前进程地址空间 | |
| ~SHMBase () | |
| SHMBase (const SHMBase &)=delete | |
| SHMBase (SHMBase &&)=default | |
| SHMBase & | operator= (const SHMBase &)=delete |
| SHMBase & | operator= (SHMBase &&)=default |
| void * | data () noexcept |
| 获取共享内存映射指针 | |
| const void * | data () const noexcept |
| 获取共享内存映射指针 | |
| bool | isCreator () const noexcept |
| 是否为创建者 | |
额外继承的成员函数 | |
| 静态 Public 成员函数 继承自 rm::SHMBase | |
| static void | destroy (std::string_view name) |
| 显式移除指定名称的共享内存对象,Windows 平台下调用该函数无效果 | |
MPMC 原子共享内存对象
| T | 共享内存数据类型 |
| rm::AtomicSHM< T, Enable >::AtomicSHM | ( | std::string_view | name | ) |
构造 MPMC 共享内存对象
MPMC 原子共享内存对象
| [in] | name | 共享内存名称 |
| T | 共享内存数据类型 |
|
delete |
|
delete |
|
noexcept |
判断是否为空 (从未写入过)
|
delete |
|
delete |
|
noexcept |
|
noexcept |
向共享内存中原子的写入数据
| [in] | value | 要写入的数据 |