Apollo 10.0
自动驾驶开放平台
apollo::cyber::transport 命名空间参考

命名空间

namespace  dispatcher
 
namespace  rtps
 

class  ArenaAddressAllocator
 
union  ArenaAddressAllocatorMeta
 
struct  ArenaAddressNode
 
class  ArenaSegment
 
struct  ArenaSegmentBlock
 
union  ArenaSegmentBlockDescriptor
 
struct  ArenaSegmentBlockInfo
 
union  ArenaSegmentState
 
class  AttributesFiller
 
class  Block
 
class  ChannelChain
 
class  ConditionNotifier
 
class  Dispatcher
 
class  Endpoint
 
union  ExtendedStruct
 
class  History
 
struct  HistoryAttributes
 
class  HybridReceiver
 
class  HybridTransmitter
 
class  Identity
 
class  IntraDispatcher
 
class  IntraReceiver
 
class  IntraTransmitter
 
class  ListenerHandler
 
class  ListenerHandlerBase
 
class  MessageInfo
 
class  MulticastNotifier
 
class  NotifierBase
 
class  NotifierFactory
 
class  Participant
 
class  PosixSegment
 
class  ProtobufArenaManager
 
union  ProtobufArenaManagerMeta
 
class  Publisher
 
class  QosFiller
 
class  QosProfileConf
 
class  ReadableInfo
 
class  Receiver
 
class  RtpsDispatcher
 
class  RtpsReceiver
 
class  RtpsTransmitter
 
class  Segment
 
class  SegmentFactory
 
class  ShmConf
 
class  ShmDispatcher
 
class  ShmReceiver
 
class  ShmTransmitter
 
class  State
 
class  Subscriber
 
class  Transmitter
 
class  Transport
 
struct  type_check
 
class  UnderlayMessage
 This class represents the structure UnderlayMessage defined by the user in the IDL file. 更多...
 
class  UnderlayMessageType
 This class represents the TopicDataType of the type UnderlayMessage defined by the user in the IDL file. 更多...
 
struct  WritableBlock
 
class  XsiSegment
 

类型定义

using EndpointPtr = std::shared_ptr< Endpoint >
 
using DispatcherPtr = std::shared_ptr< Dispatcher >
 
template<typename MessageT >
using MessageListener = std::function< void(const std::shared_ptr< MessageT > &, const MessageInfo &)>
 
using IntraDispatcherPtr = IntraDispatcher *
 
using ChannelChainPtr = std::shared_ptr< ChannelChain >
 
using RtpsDispatcherPtr = RtpsDispatcher *
 
using ParticipantPtr = std::shared_ptr< Participant >
 
using ShmDispatcherPtr = ShmDispatcher *
 
using ListenerHandlerBasePtr = std::shared_ptr< ListenerHandlerBase >
 
using PublisherPtr = std::shared_ptr< Publisher >
 
using NotifierPtr = NotifierBase *
 
using ReadableInfoPtr = std::shared_ptr< ReadableInfo >
 
using SegmentPtr = std::shared_ptr< Segment >
 
using ReadableBlock = WritableBlock
 

函数

bool GetDefaultPubAttributes (const std::string &channel_name, const QosProfile &qos, eprosima::fastrtps::PublisherAttributes *pub_attr)
 
bool GetDefaultSubAttributes (const std::string &channel_name, const QosProfile &qos, eprosima::fastrtps::SubscriberAttributes *sub_attr)
 
bool GetDefaultTopicAttributes (const std::string &channel_name, const QosProfile &qos, eprosima::fastrtps::TopicAttributes *topic_attr)
 

变量

constexpr uint8_t ID_SIZE = 8
 
const uint32_t kBufLength = 4096
 

类型定义说明

◆ ChannelChainPtr

using apollo::cyber::transport::ChannelChainPtr = typedef std::shared_ptr<ChannelChain>

在文件 intra_dispatcher.h43 行定义.

◆ DispatcherPtr

using apollo::cyber::transport::DispatcherPtr = typedef std::shared_ptr<Dispatcher>

在文件 dispatcher.h49 行定义.

◆ EndpointPtr

using apollo::cyber::transport::EndpointPtr = typedef std::shared_ptr<Endpoint>

在文件 endpoint.h32 行定义.

◆ IntraDispatcherPtr

◆ ListenerHandlerBasePtr

在文件 listener_handler.h42 行定义.

◆ MessageListener

template<typename MessageT >
using apollo::cyber::transport::MessageListener = typedef std::function<void(const std::shared_ptr<MessageT>&, const MessageInfo&)>

在文件 dispatcher.h52 行定义.

◆ NotifierPtr

在文件 notifier_base.h29 行定义.

◆ ParticipantPtr

using apollo::cyber::transport::ParticipantPtr = typedef std::shared_ptr<Participant>

在文件 rtps_dispatcher.h46 行定义.

◆ PublisherPtr

using apollo::cyber::transport::PublisherPtr = typedef std::shared_ptr<Publisher>

在文件 publisher.h41 行定义.

◆ ReadableBlock

在文件 segment.h41 行定义.

◆ ReadableInfoPtr

using apollo::cyber::transport::ReadableInfoPtr = typedef std::shared_ptr<ReadableInfo>

在文件 readable_info.h30 行定义.

◆ RtpsDispatcherPtr

◆ SegmentPtr

using apollo::cyber::transport::SegmentPtr = typedef std::shared_ptr<Segment>

在文件 segment.h34 行定义.

◆ ShmDispatcherPtr

函数说明

◆ GetDefaultPubAttributes()

bool apollo::cyber::transport::GetDefaultPubAttributes ( const std::string &  channel_name,
const QosProfile qos,
eprosima::fastrtps::PublisherAttributes *  pub_attr 
)

在文件 qos_filler.cc35 行定义.

37 {
38 RETURN_VAL_IF_NULL2(pub_attr, false);
39 pub_attr->topic.topicName = channel_name;
40 pub_attr->topic.topicDataType = "UnderlayMessage";
41 pub_attr->topic.topicKind = eprosima::fastrtps::rtps::NO_KEY;
42 switch (qos.history()) {
43 case QosHistoryPolicy::HISTORY_KEEP_LAST:
44 pub_attr->topic.historyQos.kind =
45 eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS;
46 break;
47 case QosHistoryPolicy::HISTORY_KEEP_ALL:
48 pub_attr->topic.historyQos.kind =
49 eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS;
50 break;
51 default:
52 break;
53 }
54 switch (qos.durability()) {
55 case QosDurabilityPolicy::DURABILITY_TRANSIENT_LOCAL:
56 pub_attr->qos.m_durability.kind =
57 eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS;
58 break;
59 case QosDurabilityPolicy::DURABILITY_VOLATILE:
60 pub_attr->qos.m_durability.kind =
61 eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS;
62 break;
63 default:
64 break;
65 }
66
67 switch (qos.reliability()) {
68 case QosReliabilityPolicy::RELIABILITY_BEST_EFFORT:
69 pub_attr->qos.m_reliability.kind =
70 eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS;
71 break;
72 case QosReliabilityPolicy::RELIABILITY_RELIABLE:
73 pub_attr->qos.m_reliability.kind =
74 eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS;
75 break;
76 default:
77 break;
78 }
79 if (qos.depth() != QosProfileConf::QOS_HISTORY_DEPTH_SYSTEM_DEFAULT) {
80 pub_attr->topic.historyQos.depth = static_cast<int32_t>(qos.depth());
81 }
82
83 // ensure the history depth is at least the requested queue size
84 RETURN_VAL_IF2(pub_attr->topic.historyQos.depth < 0, false);
85
86 // tranform messages per second to rtps heartbeat
87 // set default heartbeat period
88 pub_attr->times.heartbeatPeriod.seconds = 0;
89 pub_attr->times.heartbeatPeriod.fraction(300 * 4294967); // 300ms
90 if (qos.mps() != 0) {
91 uint64_t mps = qos.mps();
92
93 // adapt heartbeat period
94 if (mps > 1024) {
95 mps = 1024;
96 } else if (mps < 64) {
97 mps = 64;
98 }
99
100 uint64_t fractions = (256ull << 32) / mps;
101 uint32_t fraction = fractions & 0xffffffff;
102 int32_t seconds = static_cast<int32_t>(fractions >> 32);
103
104 pub_attr->times.heartbeatPeriod.seconds = seconds;
105 pub_attr->times.heartbeatPeriod.fraction(fraction);
106 }
107
108 pub_attr->qos.m_publishMode.kind =
109 eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE;
110 pub_attr->historyMemoryPolicy =
111 eprosima::fastrtps::rtps::DYNAMIC_RESERVE_MEMORY_MODE;
112 AINFO << channel_name << "qos: [history: " << pub_attr->topic.historyQos.kind
113 << "] [durability: " << pub_attr->qos.m_durability.kind
114 << "] [reliability: " << pub_attr->qos.m_reliability.kind
115 << "] [depth: " << pub_attr->topic.historyQos.depth
116 << "] [samples: " << pub_attr->topic.resourceLimitsQos.max_samples
117 << "]";
118
119 return true;
120}
#define RETURN_VAL_IF2(condition, val)
Definition log.h:131
#define RETURN_VAL_IF_NULL2(ptr, val)
Definition log.h:123
#define AINFO
Definition log.h:42
optional QosHistoryPolicy history
optional QosDurabilityPolicy durability
optional QosReliabilityPolicy reliability

◆ GetDefaultSubAttributes()

bool apollo::cyber::transport::GetDefaultSubAttributes ( const std::string &  channel_name,
const QosProfile qos,
eprosima::fastrtps::SubscriberAttributes *  sub_attr 
)

在文件 qos_filler.cc122 行定义.

124 {
125 RETURN_VAL_IF_NULL2(sub_attr, false);
126 sub_attr->topic.topicName = channel_name;
127 sub_attr->topic.topicDataType = "UnderlayMessage";
128 sub_attr->topic.topicKind = eprosima::fastrtps::rtps::NO_KEY;
129
130 switch (qos.history()) {
131 case QosHistoryPolicy::HISTORY_KEEP_LAST:
132 sub_attr->topic.historyQos.kind =
133 eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS;
134 break;
135 case QosHistoryPolicy::HISTORY_KEEP_ALL:
136 sub_attr->topic.historyQos.kind =
137 eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS;
138 break;
139 default:
140 break;
141 }
142 switch (qos.durability()) {
143 case QosDurabilityPolicy::DURABILITY_TRANSIENT_LOCAL:
144 sub_attr->qos.m_durability.kind =
145 eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS;
146 break;
147 case QosDurabilityPolicy::DURABILITY_VOLATILE:
148 sub_attr->qos.m_durability.kind =
149 eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS;
150 break;
151 default:
152 break;
153 }
154
155 switch (qos.reliability()) {
156 case QosReliabilityPolicy::RELIABILITY_BEST_EFFORT:
157 sub_attr->qos.m_reliability.kind =
158 eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS;
159 break;
160 case QosReliabilityPolicy::RELIABILITY_RELIABLE:
161 sub_attr->qos.m_reliability.kind =
162 eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS;
163 break;
164 default:
165 break;
166 }
167 if (qos.depth() != QosProfileConf::QOS_HISTORY_DEPTH_SYSTEM_DEFAULT) {
168 sub_attr->topic.historyQos.depth = static_cast<int32_t>(qos.depth());
169 }
170
171 // ensure the history depth is at least the requested queue size
172 RETURN_VAL_IF2(sub_attr->topic.historyQos.depth < 0, false);
173
174 sub_attr->historyMemoryPolicy =
175 eprosima::fastrtps::rtps::DYNAMIC_RESERVE_MEMORY_MODE;
176 AINFO << channel_name << "qos: [history: " << sub_attr->topic.historyQos.kind
177 << "] [durability: " << sub_attr->qos.m_durability.kind
178 << "] [reliability: " << sub_attr->qos.m_reliability.kind
179 << "] [depth: " << sub_attr->topic.historyQos.depth
180 << "] [samples: " << sub_attr->topic.resourceLimitsQos.max_samples
181 << "]";
182
183 return true;
184}

◆ GetDefaultTopicAttributes()

bool apollo::cyber::transport::GetDefaultTopicAttributes ( const std::string &  channel_name,
const QosProfile qos,
eprosima::fastrtps::TopicAttributes *  topic_attr 
)

在文件 qos_filler.cc186 行定义.

188 {
189 RETURN_VAL_IF_NULL2(topic_attr, false);
190 topic_attr->topicName = channel_name;
191 topic_attr->topicDataType = "UnderlayMessage";
192 topic_attr->topicKind = eprosima::fastrtps::rtps::NO_KEY;
193
194 switch (qos.history()) {
195 case QosHistoryPolicy::HISTORY_KEEP_LAST:
196 topic_attr->historyQos.kind =
197 eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS;
198 break;
199 case QosHistoryPolicy::HISTORY_KEEP_ALL:
200 topic_attr->historyQos.kind =
201 eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS;
202 break;
203 default:
204 break;
205 }
206
207 if (qos.depth() != QosProfileConf::QOS_HISTORY_DEPTH_SYSTEM_DEFAULT) {
208 topic_attr->historyQos.depth = static_cast<int32_t>(qos.depth());
209 }
210
211 // ensure the history depth is at least the requested queue size
212 RETURN_VAL_IF2(topic_attr->historyQos.depth < 0, false);
213
214 return true;
215}

变量说明

◆ ID_SIZE

constexpr uint8_t apollo::cyber::transport::ID_SIZE = 8
constexpr

在文件 identity.h28 行定义.

◆ kBufLength

const uint32_t apollo::cyber::transport::kBufLength = 4096

在文件 condition_notifier.h31 行定义.