|
libxr
1.0
Want to be the best embedded framework
|
先 StartWaiting(),再自己来取数据的订阅者 / Subscriber that first calls StartWaiting() and later pulls the data itself
More...
#include <async.hpp>
Public Member Functions | |
| ASyncSubscriber (const char *name, Domain *domain=nullptr) | |
| 通过主题名称构造异步订阅者 / Construct an asynchronous subscriber by topic name | |
| ASyncSubscriber (Topic topic) | |
通过 Topic 句柄构造异步订阅者 / Construct an asynchronous subscriber from a Topic handle | |
| ASyncSubscriber (const ASyncSubscriber &other)=delete | |
| 禁止拷贝异步订阅者 / Copy construction is disabled for asynchronous subscribers | |
| ASyncSubscriber & | operator= (const ASyncSubscriber &other)=delete |
| 禁止拷贝赋值异步订阅者 / Copy assignment is disabled for asynchronous subscribers | |
| ASyncSubscriber (ASyncSubscriber &&other) noexcept | |
| 移动构造异步订阅者 / Move-construct one asynchronous subscriber | |
| ASyncSubscriber & | operator= (ASyncSubscriber &&other) noexcept |
| 移动赋值异步订阅者 / Move-assign one asynchronous subscriber | |
| bool | Available () |
| 检查数据是否可用 / Check whether data is available | |
| Data & | GetData () |
| 获取当前数据 / Retrieve the current data | |
| MicrosecondTimestamp | GetTimestamp () const |
| 获取最近一次接收的消息时间戳 / Get the latest received message timestamp | |
| void | StartWaiting () |
| 开始等待数据更新 / Start waiting for a data update | |
Data Fields | |
| LockFreeList::Node< ASyncBlock > * | block_ = nullptr |
| 订阅者数据块。Subscriber data block. | |
先 StartWaiting(),再自己来取数据的订阅者 / Subscriber that first calls StartWaiting() and later pulls the data itself
先等待再主动取数据的异步订阅者 / Asynchronous subscriber that waits first and then pulls data explicitly
| Data | 订阅的数据类型 / Subscribed data type |
|
inline |
通过主题名称构造异步订阅者 / Construct an asynchronous subscriber by topic name
| name | 订阅的主题名称 / Name of the subscribed topic |
| domain | 可选的域指针 / Optional domain pointer |
Definition at line 48 of file async.hpp.
|
inline |
通过 Topic 句柄构造异步订阅者 / Construct an asynchronous subscriber from a Topic handle
| topic | 订阅的主题 / Subscribed topic |
Definition at line 59 of file async.hpp.
|
delete |
禁止拷贝异步订阅者 / Copy construction is disabled for asynchronous subscribers
| other | 待拷贝的异步订阅者 / Asynchronous subscriber to copy from |
|
inlinenoexcept |
移动构造异步订阅者 / Move-construct one asynchronous subscriber
| other | 被转移的异步订阅者 / Asynchronous 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 |
|
inline |
获取当前数据 / Retrieve the current data
DATA_READY,本次读取会把状态清回 IDLE;之后新的发布需要 重新调用 StartWaiting() 才会继续接收 / If the local buffer is currently DATA_READY, this read clears the state back to IDLE; later publishes are ignored again until StartWaiting() is called Definition at line 139 of file async.hpp.
|
inline |
|
inlinenoexcept |
移动赋值异步订阅者 / Move-assign one asynchronous subscriber
| other | 被转移的异步订阅者 / Asynchronous 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 109 of file async.hpp.
|
delete |
禁止拷贝赋值异步订阅者 / Copy assignment is disabled for asynchronous subscribers
| other | 待拷贝的异步订阅者 / Asynchronous subscriber to copy from |
|
inline |
开始等待数据更新 / Start waiting for a data update
WAITING 状态下的下一次发布;IDLE 或 DATA_READY 状态下的新发布会被忽略 / Async subscribers only capture the next publish while in WAITING state; new publishes in IDLE or DATA_READY state are ignored Definition at line 161 of file async.hpp.
| LockFreeList::Node<ASyncBlock>* LibXR::Topic::ASyncSubscriber< Data >::block_ = nullptr |