MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / add_topic

Method add_topic

dds/InfoRepo/DCPSInfo_i.cpp:231–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231bool
232TAO_DDS_DCPSInfo_i::add_topic(const OpenDDS::DCPS::GUID_t& topicId,
233 DDS::DomainId_t domainId,
234 const OpenDDS::DCPS::GUID_t& participantId,
235 const char* topicName,
236 const char* dataTypeName,
237 const DDS::TopicQos& qos)
238{
239 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, this->lock_, false);
240
241 // Grab the domain.
242 DCPS_IR_Domain_Map::iterator where = this->domains_.find(domainId);
243
244 if (where == this->domains_.end()) {
245 if (OpenDDS::DCPS::DCPS_debug_level > 4) {
246 ACE_DEBUG((LM_WARNING,
247 ACE_TEXT("(%P|%t) WARNING: TAO_DDS_DCPSInfo_i:add_topic: ")
248 ACE_TEXT("invalid domain %d.\n"),
249 domainId));
250 }
251
252 return false;
253 }
254
255 // Grab the participant.
256 DCPS_IR_Participant* participantPtr
257 = where->second->participant(participantId);
258
259 if (0 == participantPtr) {
260 if (OpenDDS::DCPS::DCPS_debug_level > 4) {
261 OpenDDS::DCPS::RepoIdConverter converter(participantId);
262 ACE_DEBUG((LM_WARNING,
263 ACE_TEXT("(%P|%t) WARNING: TAO_DDS_DCPSInfo_i:add_topic: ")
264 ACE_TEXT("invalid participant %C.\n"),
265 std::string(converter).c_str()));
266 }
267
268 return false;
269 }
270
271 OpenDDS::DCPS::TopicStatus topicStatus
272 = where->second->force_add_topic(topicId, topicName, dataTypeName,
273 qos, participantPtr);
274
275 if (topicStatus != OpenDDS::DCPS::CREATED) {
276 return false;
277 }
278
279 OpenDDS::DCPS::RepoIdConverter converter(topicId);
280
281 // See if we are adding a topic that was created within this
282 // repository or a different repository.
283 if (converter.federationId() == federation_.id()) {
284 // Ensure the topic GUID_t values do not conflict.
285 participantPtr->last_topic_key(converter.entityKey());
286 }
287
288 return true;

Callers 5

receive_imageMethod · 0.95
assert_topicMethod · 0.45
addMethod · 0.45
processCreateMethod · 0.45
processDeferredMethod · 0.45

Calls 8

force_add_topicMethod · 0.80
last_topic_keyMethod · 0.80
findMethod · 0.45
endMethod · 0.45
participantMethod · 0.45
federationIdMethod · 0.45
idMethod · 0.45
entityKeyMethod · 0.45

Tested by

no test coverage detected