17 #ifndef CYBER_TRANSPORT_SHM_SEGMENT_H_ 18 #define CYBER_TRANSPORT_SHM_SEGMENT_H_ 23 #include <unordered_map> 39 uint8_t*
buf =
nullptr;
45 explicit Segment(uint64_t channel_id);
48 bool AcquireBlockToWrite(std::size_t msg_size,
WritableBlock* writable_block);
49 void ReleaseWrittenBlock(
const WritableBlock& writable_block);
55 virtual bool Destroy();
56 virtual void Reset() = 0;
57 virtual bool Remove() = 0;
58 virtual bool OpenOnly() = 0;
59 virtual bool OpenOrCreate() = 0;
73 bool Recreate(
const uint64_t& msg_size);
74 uint32_t GetNextWritableBlockIndex();
81 #endif // CYBER_TRANSPORT_SHM_SEGMENT_H_ uint64_t channel_id_
Definition: segment.h:63
void * managed_shm_
Definition: segment.h:67
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
State * state_
Definition: segment.h:65
Block * blocks_
Definition: segment.h:66
uint8_t * buf
Definition: segment.h:39
ShmConf conf_
Definition: segment.h:62
std::shared_ptr< Segment > SegmentPtr
Definition: segment.h:34
bool init_
Definition: segment.h:61
std::unordered_map< uint32_t, uint8_t * > block_buf_addrs_
Definition: segment.h:69
virtual ~Segment()
Definition: segment.h:46
uint32_t index
Definition: segment.h:37
Definition: shm_conf.h:27
Block * block
Definition: segment.h:38
std::mutex block_buf_lock_
Definition: segment.h:68