|
libxr
1.0
Want to be the best embedded framework
|
每次发布都往队列里塞一份数据的订阅者 / Subscriber that pushes one entry into a queue on each publish More...
#include <queue.hpp>
Public Member Functions | |
| template<typename Data > | |
| QueuedSubscriber (const char *name, SPSCQueue< Data > &queue, Domain *domain=nullptr) | |
| 通过主题名称构造队列订阅者 / Construct a queue subscriber by topic name | |
| template<typename Data > | |
| QueuedSubscriber (const char *name, SPSCQueue< Message< Data > > &queue, Domain *domain=nullptr) | |
| 通过主题名称构造带时间戳消息队列订阅者 / Construct a queue subscriber for timestamped messages by topic name | |
| template<typename Data > | |
| QueuedSubscriber (Topic topic, SPSCQueue< Data > &queue) | |
使用 Topic 和无锁队列构造订阅者 / Construct a subscriber from a Topic and a lock-free queue | |
| template<typename Data > | |
| QueuedSubscriber (Topic topic, SPSCQueue< Message< Data > > &queue) | |
使用 Topic 和带时间戳消息队列构造订阅者 / Construct a subscriber from a Topic and a timestamped message queue | |
| QueuedSubscriber (const QueuedSubscriber &other)=delete | |
| 禁止拷贝队列订阅者 / Copy construction is disabled for queued subscribers | |
| QueuedSubscriber & | operator= (const QueuedSubscriber &other)=delete |
| 禁止拷贝赋值队列订阅者 / Copy assignment is disabled for queued subscribers | |
| QueuedSubscriber (QueuedSubscriber &&other) noexcept | |
| 移动构造队列订阅者 / Move-construct one queued subscriber | |
| QueuedSubscriber & | operator= (QueuedSubscriber &&other) noexcept |
| 移动赋值队列订阅者 / Move-assign one queued subscriber | |
Private Attributes | |
| LockFreeList::Node< QueueBlock > * | block_ |
| 订阅者数据块。Subscriber data block. | |
每次发布都往队列里塞一份数据的订阅者 / Subscriber that pushes one entry into a queue on each publish
把每次发布推入队列的订阅者 / Subscriber that pushes each publish into a queue
|
inline |
通过主题名称构造队列订阅者 / Construct a queue subscriber by topic name
| Data | 队列存储的数据类型 / Data type stored in the queue |
| name | 订阅的主题名称 / Name of the subscribed topic |
| queue | 订阅的数据队列 / Subscribed data queue |
| domain | 可选的域指针,默认为 nullptr / Optional domain pointer, default nullptr |
queue 的指针;队列对象本身必须至少活到订阅者不再使用 为止 / Queued subscribers keep only a pointer to queue; the queue object itself must outlive the subscriber's use of it SPSCQueueBase::PushBytes();如果 push 不进去, 这次发布就直接丢掉 / Each publish directly calls one underlying SPSCQueueBase::PushBytes(); if that push cannot fit, this publish is dropped immediately Definition at line 46 of file queue.hpp.
|
inline |
通过主题名称构造带时间戳消息队列订阅者 / Construct a queue subscriber for timestamped messages by topic name
| Data | 队列消息的数据类型 / Data type stored in the queue message |
| name | 订阅的主题名称 / Name of the subscribed topic |
| queue | 订阅的消息队列 / Subscribed message queue |
| domain | 可选的域指针,默认为 nullptr / Optional domain pointer, default nullptr |
queue 的指针;队列对象本身必须至少活到订阅者不再使用 为止 / Queued subscribers keep only a pointer to queue; the queue object itself must outlive the subscriber's use of it SPSCQueueBase::PushBytes();如果 push 不进去, 这次发布就直接丢掉 / Each publish directly calls one underlying SPSCQueueBase::PushBytes(); if that push cannot fit, this publish is dropped immediately
|
inline |
使用 Topic 和无锁队列构造订阅者 / Construct a subscriber from a Topic and a lock-free queue
| Data | 队列存储的数据类型 / Data type stored in the queue |
| topic | 订阅的主题 / Subscribed topic |
| queue | 订阅的数据队列 / Subscribed data queue |
queue 的指针;队列对象本身必须至少活到订阅者不再使用 为止 / Queued subscribers keep only a pointer to queue; the queue object itself must outlive the subscriber's use of it SPSCQueueBase::PushBytes();如果 push 不进去, 这次发布就直接丢掉 / Each publish directly calls one underlying SPSCQueueBase::PushBytes(); if that push cannot fit, this publish is dropped immediately Definition at line 93 of file queue.hpp.
|
inline |
使用 Topic 和带时间戳消息队列构造订阅者 / Construct a subscriber from a Topic and a timestamped message queue
| Data | 队列消息的数据类型 / Data type stored in the queue message |
| topic | 订阅的主题 / Subscribed topic |
| queue | 订阅的消息队列 / Subscribed message queue |
queue 的指针;队列对象本身必须至少活到订阅者不再使用 为止 / Queued subscribers keep only a pointer to queue; the queue object itself must outlive the subscriber's use of it SPSCQueueBase::PushBytes();如果 push 不进去, 这次发布就直接丢掉 / Each publish directly calls one underlying SPSCQueueBase::PushBytes(); if that push cannot fit, this publish is dropped immediately Definition at line 122 of file queue.hpp.
|
delete |
禁止拷贝队列订阅者 / Copy construction is disabled for queued subscribers
| other | 待拷贝的队列订阅者 / Queued subscriber to copy from |
|
inlinenoexcept |
移动构造队列订阅者 / Move-construct one queued subscriber
| other | 被转移的队列订阅者 / Queued 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
|
delete |
禁止拷贝赋值队列订阅者 / Copy assignment is disabled for queued subscribers
| other | 待拷贝的队列订阅者 / Queued subscriber to copy from |
|
inlinenoexcept |
移动赋值队列订阅者 / Move-assign one queued subscriber
| other | 被转移的队列订阅者 / Queued 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 175 of file queue.hpp.
|
private |