45 template <
typename Data>
68 template <
typename Data>
92 template <
typename Data>
99 block_->data_.queue = &queue;
101 { (void)block.queue->PushBytes(payload_addr); };
121 template <
typename Data>
128 block_->data_.queue = &queue;
132 Message<Data> message{timestamp, *
reinterpret_cast<Data*
>(payload_addr)};
133 (void)block.queue->PushBytes(&message);
162 other.block_ =
nullptr;
180 other.block_ =
nullptr;
数据节点模板,继承自 BaseNode,用于存储具体数据类型。 Template data node that inherits from BaseNode to store specific data...
Data data_
存储的数据。 The stored data.
微秒时间戳 / Microsecond timestamp
Data data_
存储的数据 (Stored data).
单生产者单消费者字节队列内核 / Single-producer single-consumer byte-queue core
topic 所属的命名域 / Naming domain that groups topics
每次发布都往队列里塞一份数据的订阅者 / Subscriber that pushes one entry into a queue on each publish
QueuedSubscriber(const char *name, SPSCQueue< Message< Data > > &queue, Domain *domain=nullptr)
通过主题名称构造带时间戳消息队列订阅者 / Construct a queue subscriber for timestamped messages by topic name
LockFreeList::Node< QueueBlock > * block_
订阅者数据块。Subscriber data block.
QueuedSubscriber(QueuedSubscriber &&other) noexcept
移动构造队列订阅者 / Move-construct one queued subscriber
QueuedSubscriber(Topic topic, SPSCQueue< Data > &queue)
使用 Topic 和无锁队列构造订阅者 / Construct a subscriber from a Topic and a lock-free queue
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
QueuedSubscriber(const char *name, SPSCQueue< Data > &queue, Domain *domain=nullptr)
通过主题名称构造队列订阅者 / Construct a queue subscriber by topic name
QueuedSubscriber(Topic topic, SPSCQueue< Message< Data > > &queue)
使用 Topic 和带时间戳消息队列构造订阅者 / Construct a subscriber from a Topic and a timestamped message queue
发布订阅主题 / 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
带时间戳和 payload 副本的消息对象 / Message object carrying a timestamp and a payload copy
队列订阅者自己挂的数据块 / Data block owned by one queued subscriber
void(* fun)(MicrosecondTimestamp, void *, QueueBlock &)
SPSCQueueBase * queue
指向订阅队列基类。Pointer to the subscribed queue base.
所有订阅块共用的公共头 / Common header shared by all subscriber blocks