|
libxr
1.0
Want to be the best embedded framework
|
调用 Wait() 收消息的订阅者 / Subscriber that receives messages by calling Wait()
More...
#include <sync.hpp>
Public Member Functions | |
| SyncSubscriber (const char *name, Data &data, Domain *domain=nullptr) | |
| 通过主题名称构造同步订阅者 / Construct a synchronous subscriber by topic name | |
| SyncSubscriber (Topic topic, Data &data) | |
通过 Topic 句柄构造同步订阅者 / Construct a synchronous subscriber using a Topic handle | |
| SyncSubscriber (const SyncSubscriber &other)=delete | |
| 禁止拷贝同步订阅者 / Copy construction is disabled for synchronous subscribers | |
| SyncSubscriber & | operator= (const SyncSubscriber &other)=delete |
| 禁止拷贝赋值同步订阅者 / Copy assignment is disabled for synchronous subscribers | |
| SyncSubscriber (SyncSubscriber &&other) noexcept | |
| 移动构造同步订阅者 / Move-construct one synchronous subscriber | |
| SyncSubscriber & | operator= (SyncSubscriber &&other) noexcept |
| 移动赋值同步订阅者 / Move-assign one synchronous subscriber | |
| ErrorCode | Wait (uint32_t timeout=UINT32_MAX) |
| 等待接收数据 / Wait for data reception | |
| MicrosecondTimestamp | GetTimestamp () const |
| 获取最近一次接收的消息时间戳 / Get the latest received message timestamp | |
Data Fields | |
| LockFreeList::Node< SyncBlock > * | block_ = nullptr |
| 订阅者数据块。Subscriber data block. | |
调用 Wait() 收消息的订阅者 / Subscriber that receives messages by calling Wait()
通过 Wait() 接收消息的同步订阅者 / Synchronous subscriber receiving messages via Wait()
| Data | 订阅的数据类型 / Type of data being subscribed to |
| Data | 订阅的数据类型 / Subscribed data type |
|
inline |
通过主题名称构造同步订阅者 / Construct a synchronous subscriber by topic name
| name | 主题名称 / Topic name |
| data | 用来接收消息的对象 / Destination object receiving subscribed data |
| domain | 可选的主题域 / Optional topic domain |
data;data 必须至少活到订阅者不再使用为止 / Synchronous subscribers do not allocate their own receive buffer; they write incoming data directly into data, which must outlive the subscriber's use of it Definition at line 60 of file sync.hpp.
|
inline |
通过 Topic 句柄构造同步订阅者 / Construct a synchronous subscriber using a Topic handle
| topic | 订阅的主题 / Topic being subscribed to |
| data | 用来接收消息的对象 / Destination object receiving subscribed data |
data;data 必须至少活到订阅者不再使用为止 / Synchronous subscribers do not allocate their own receive buffer; they write incoming data directly into data, which must outlive the subscriber's use of it Definition at line 76 of file sync.hpp.
|
delete |
禁止拷贝同步订阅者 / Copy construction is disabled for synchronous subscribers
| other | 待拷贝的同步订阅者 / Synchronous subscriber to copy from |
|
inlinenoexcept |
移动构造同步订阅者 / Move-construct one synchronous subscriber
| other | 被转移的同步订阅者 / Synchronous subscriber to move from |
other 会被清成空句柄 / This moves only the local handle pointer; the underlying subscriber block stays registered in the topic list and other becomes empty
|
inline |
|
delete |
禁止拷贝赋值同步订阅者 / Copy assignment is disabled for synchronous subscribers
| other | 待拷贝的同步订阅者 / Synchronous subscriber to copy from |
|
inlinenoexcept |
移动赋值同步订阅者 / Move-assign one synchronous subscriber
| other | 被转移的同步订阅者 / Synchronous subscriber to move from |
other 会被清成空句柄 / This only changes which subscriber block the current wrapper points to and does not unregister the old block; the underlying subscriber blocks stay in the topic list and other becomes empty Definition at line 127 of file sync.hpp.
|
inline |
等待接收数据 / Wait for data reception
| timeout | 超时时间,默认为 UINT32_MAX / Timeout period, default UINT32_MAX |
ErrorCode::BUSY / Only one waiter is allowed at a time; if another wait is already pending, this returns ErrorCode::BUSY OK,不会把 这次唤醒漏给下一次 Wait() / If a publish arrives right at the timeout boundary, the current waiter still keeps that wakeup and eventually returns OK instead of leaking the wakeup to a later Wait() Definition at line 151 of file sync.hpp.
| LockFreeList::Node<SyncBlock>* LibXR::Topic::SyncSubscriber< Data >::block_ = nullptr |