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

Function createTopic

DevGuideExamples/DCPS/Messenger.minimal/Boilerplate.cpp:31–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31DDS::Topic_var
32createTopic(DDS::DomainParticipant_var participant)
33{
34 // Register TypeSupport (Messenger::Message)
35 Messenger::MessageTypeSupport_var ts =
36 new Messenger::MessageTypeSupportImpl;
37
38 if (ts->register_type(participant, "") != DDS::RETCODE_OK) {
39 throw std::string("failed to register type support");
40 }
41
42 // Create Topic (Movie Discussion List)
43 CORBA::String_var type_name = ts->get_type_name();
44 DDS::Topic_var topic =
45 participant->create_topic("Movie Discussion List",
46 type_name,
47 TOPIC_QOS_DEFAULT,
48 0,
49 OpenDDS::DCPS::DEFAULT_STATUS_MASK);
50
51 // Check for failure
52 if (!topic) {
53 throw std::string("failed to create topic");
54 }
55 return topic;
56}
57
58DDS::Publisher_var
59createPublisher(DDS::DomainParticipant_var participant)

Callers 2

ACE_TMAINFunction · 0.70
ACE_TMAINFunction · 0.70

Calls 3

register_typeMethod · 0.45
get_type_nameMethod · 0.45
create_topicMethod · 0.45

Tested by

no test coverage detected