|
libxr
1.0
Want to be the best embedded framework
|
同步订阅者自己挂的数据块 / Data block owned by one synchronous subscriber More...
#include <sync.hpp>
Public Types | |
| enum | WaitState : uint32_t { WAIT_IDLE = 0 , WAITING = 1 , WAIT_CLAIMED = 2 } |
| 同步等待状态 / Synchronous wait state More... | |
Data Fields | |
| void * | buff_addr |
| 收到消息后要拷到这里。Received payloads are copied here. | |
| void(* | copy_payload )(void *dst, void *payload_addr) |
| 按订阅精确类型执行负载拷贝的适配函数。Adapter that copies one payload using the subscriber's exact type. | |
| MicrosecondTimestamp | timestamp |
| 这里对应那份数据的时间戳。Timestamp paired with the buffered data. | |
| std::atomic< uint32_t > | wait_state = WAIT_IDLE |
当前 Wait() 的挂起状态。Current pending state of Wait(). | |
| Semaphore | sem |
用来唤醒 Wait() 的信号量。Semaphore used to wake Wait(). | |
Data Fields inherited from LibXR::Topic::SuberBlock | |
| SuberType | type |
| 订阅块的具体种类。Concrete kind of this subscriber block. | |
同步订阅者自己挂的数据块 / Data block owned by one synchronous subscriber
同步订阅者挂在 topic 链表里的数据块 / Subscriber block used by one synchronous subscriber inside the topic list
| enum LibXR::Topic::SyncBlock::WaitState : uint32_t |
同步等待状态 / Synchronous wait state
WAIT_CLAIMED 表示这次唤醒已经归超时前那一次 Wait() 所有,直到它把 semaphore post 消费掉为止;否则下一次 Wait() 可能会错误抢走旧唤醒。 WAIT_CLAIMED means the wakeup already belongs to the Wait() that timed out just before the post and must stay reserved until that waiter consumes the semaphore post; otherwise a later Wait() could steal the old wakeup.
Definition at line 23 of file sync.hpp.
| void* LibXR::Topic::SyncBlock::buff_addr |
| void(* LibXR::Topic::SyncBlock::copy_payload) (void *dst, void *payload_addr) |
| Semaphore LibXR::Topic::SyncBlock::sem |
| MicrosecondTimestamp LibXR::Topic::SyncBlock::timestamp |
| std::atomic<uint32_t> LibXR::Topic::SyncBlock::wait_state = WAIT_IDLE |