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

Method init

tests/DCPS/FooTest3_0/SubDriver.cpp:119–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119void
120SubDriver::init(int& argc, ACE_TCHAR* argv[])
121{
122 ::DDS::DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc, argv);
123
124 parse_args(argc, argv);
125
126 participant_ =
127 dpf->create_participant(MY_DOMAIN,
128 PARTICIPANT_QOS_DEFAULT,
129 ::DDS::DomainParticipantListener::_nil(),
130 ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
131 TEST_CHECK (! CORBA::is_nil (participant_.in ()));
132 if (participant_->contains_entity(participant_->get_instance_handle()))
133 {
134 ACE_ERROR ((LM_ERROR,
135 ACE_TEXT("(%P|%t) ERROR: participant_ should not contain itself\n")));
136 }
137
138 ::Xyz::FooTypeSupport_var fts (new ::Xyz::FooTypeSupportImpl);
139
140 if (::DDS::RETCODE_OK != fts->register_type(participant_.in (), MY_TYPE))
141 {
142 ACE_ERROR ((LM_ERROR,
143 ACE_TEXT ("Failed to register the FooTypeSupport.")));
144 }
145
146 ::DDS::TopicQos default_topic_qos;
147 participant_->get_default_topic_qos(default_topic_qos);
148
149 ::DDS::TopicQos new_topic_qos = default_topic_qos;
150 new_topic_qos.reliability.kind = ::DDS::RELIABLE_RELIABILITY_QOS;
151
152 participant_->set_default_topic_qos(new_topic_qos);
153
154 topic_ = participant_->create_topic (MY_TOPIC,
155 MY_TYPE,
156 TOPIC_QOS_DEFAULT,
157 ::DDS::TopicListener::_nil(),
158 ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
159 TEST_CHECK (! CORBA::is_nil (topic_.in ()));
160 if (!participant_->contains_entity(topic_->get_instance_handle()))
161 {
162 ACE_ERROR ((LM_ERROR,
163 ACE_TEXT("(%P|%t) ERROR: participant_ should indicated it contains topic_\n")));
164 }
165
166 subscriber_ =
167 participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT,
168 ::DDS::SubscriberListener::_nil(),
169 ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
170 TEST_CHECK (! CORBA::is_nil (subscriber_.in ()));
171 if (!participant_->contains_entity(subscriber_->get_instance_handle()))
172 {
173 ACE_ERROR ((LM_ERROR,
174 ACE_TEXT("(%P|%t) ERROR: participant_ should indicated it contains subscriber_\n")));
175 }
176

Callers

nothing calls this directly

Calls 14

contains_entityMethod · 0.80
get_default_topic_qosMethod · 0.80
set_default_topic_qosMethod · 0.80
set_qcMethod · 0.80
parse_argsFunction · 0.50
create_participantMethod · 0.45
inMethod · 0.45
get_instance_handleMethod · 0.45
register_typeMethod · 0.45
create_topicMethod · 0.45
create_subscriberMethod · 0.45
create_datareaderMethod · 0.45

Tested by

no test coverage detected