42 template <
typename Data>
63 template <
typename Data>
85 template <
typename Data>
92 block_->data_.queue = &queue;
96 (void)queue->
Push(*
reinterpret_cast<Data*
>(payload_addr));
116 template <
typename Data>
123 block_->data_.queue = &queue;
130 Message<Data>{timestamp, *reinterpret_cast<Data*>(payload_addr)});
159 other.block_ =
nullptr;
177 other.block_ =
nullptr;
数据节点模板,继承自 BaseNode,用于存储具体数据类型。 Template data node that inherits from BaseNode to store specific data...
Data data_
存储的数据。 The stored data.
无锁队列实现 / Lock-free queue implementation
ErrorCode Push(ElementData &&item)
向队列中推入数据 / Pushes data into the queue
微秒时间戳 / Microsecond timestamp
Data data_
存储的数据 (Stored data).
topic 所属的命名域 / Naming domain that groups topics
每次发布都往队列里塞一份数据的订阅者 / Subscriber that pushes one entry into a queue on each publish
QueuedSubscriber(Topic topic, LockFreeQueue< Data > &queue)
使用 Topic 和无锁队列构造订阅者 / Construct a subscriber from a Topic and a lock-free queue
QueuedSubscriber(const char *name, LockFreeQueue< Data > &queue, Domain *domain=nullptr)
通过主题名称构造队列订阅者 / Construct a queue subscriber by topic name
LockFreeList::Node< QueueBlock > * block_
订阅者数据块。Subscriber data block.
QueuedSubscriber(QueuedSubscriber &&other) noexcept
移动构造队列订阅者 / Move-construct one queued subscriber
QueuedSubscriber(Topic topic, LockFreeQueue< Message< Data > > &queue)
使用 Topic 和带时间戳消息队列构造订阅者 / Construct a subscriber from a Topic and a timestamped message queue
QueuedSubscriber(const char *name, LockFreeQueue< Message< Data > > &queue, Domain *domain=nullptr)
通过主题名称构造带时间戳消息队列订阅者 / Construct a queue subscriber for timestamped messages by topic name
QueuedSubscriber(const QueuedSubscriber &other)=delete
禁止拷贝队列订阅者 / Copy construction is disabled for queued subscribers
QueuedSubscriber & operator=(QueuedSubscriber &&other) noexcept
移动赋值队列订阅者 / Move-assign one queued subscriber
QueuedSubscriber & operator=(const QueuedSubscriber &other)=delete
禁止拷贝赋值队列订阅者 / Copy assignment is disabled for queued subscribers
发布订阅主题 / Publish-subscribe topic
@ QUEUE
队列转发型订阅者。Queue-forwarding subscriber.
static void CheckSubscriberType(Topic topic)
断言订阅者看到的精确 payload 类型与 topic 契约一致 / Assert that the exact payload type seen by a subscriber matches t...
static TopicHandle WaitTopic(const char *name, uint32_t timeout=UINT32_MAX, Domain *domain=nullptr)
等待指定名称的 topic 出现 / Wait until a topic with the given name exists
TopicHandle block_
当前 topic 视图绑定的状态块。Runtime state block bound to the current topic view.
带时间戳和 payload 副本的消息对象 / Message object carrying a timestamp and a payload copy
队列订阅者自己挂的数据块 / Data block owned by one queued subscriber
void * queue
指向订阅队列实例的擦除指针。Erased pointer to the subscribed queue instance.
void(* fun)(MicrosecondTimestamp, void *, QueueBlock &)
把一条发布转发进具体队列类型的适配函数。Adapter that forwards one publish into the concrete queue type.
所有订阅块共用的公共头 / Common header shared by all subscriber blocks