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

Method initialize

tests/DCPS/FooTest3_0/PubDriver.cpp:128–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126
127
128void
129PubDriver::initialize(int& argc, ACE_TCHAR *argv[])
130{
131 ::DDS::DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc, argv);
132
133 ::DDS::ReturnCode_t ret = ::DDS::RETCODE_OK;
134
135 ::Xyz::FooTypeSupport_var fts (new ::Xyz::FooTypeSupportImpl);
136
137 participant_ =
138 dpf->create_participant(MY_DOMAIN,
139 PARTICIPANT_QOS_DEFAULT,
140 ::DDS::DomainParticipantListener::_nil(),
141 ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
142 TEST_CHECK (! CORBA::is_nil (participant_.in ()));
143 // NOTE: A participant may not contain itself
144 TEST_CHECK (!participant_->contains_entity(participant_->get_instance_handle()));
145
146 if (::DDS::RETCODE_OK != fts->register_type(participant_.in (), MY_TYPE))
147 {
148 ACE_ERROR ((LM_ERROR,
149 ACE_TEXT ("Failed to register the FooTypeSupport.")));
150 }
151
152
153 ::DDS::TopicQos default_topic_qos;
154 participant_->get_default_topic_qos(default_topic_qos);
155
156 ::DDS::TopicQos new_topic_qos = default_topic_qos;
157 new_topic_qos.reliability.kind = ::DDS::RELIABLE_RELIABILITY_QOS;
158
159 TEST_CHECK (! (new_topic_qos == default_topic_qos));
160
161 participant_->set_default_topic_qos(new_topic_qos);
162
163 topic_ = participant_->create_topic (MY_TOPIC,
164 MY_TYPE,
165 TOPIC_QOS_DEFAULT,
166 ::DDS::TopicListener::_nil(),
167 ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
168 TEST_CHECK (! CORBA::is_nil (topic_.in ()));
169 TEST_CHECK (participant_->contains_entity(topic_->get_instance_handle()));
170
171 publisher_ =
172 participant_->create_publisher(PUBLISHER_QOS_DEFAULT,
173 ::DDS::PublisherListener::_nil(),
174 ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);
175 TEST_CHECK (! CORBA::is_nil (publisher_.in ()));
176
177 {
178 OpenDDS::DCPS::RestoreOutputStreamState ross(std::cout);
179 std::cout << std::hex << "0x" << publisher_->get_instance_handle() << std::endl;
180 }
181
182 TEST_CHECK (participant_->contains_entity(publisher_->get_instance_handle()));
183
184 ::DDS::PublisherQos pub_qos_got;
185 publisher_->get_qos (pub_qos_got);

Callers 3

TestSystemMethod · 0.45
SubscriberMethod · 0.45
PublisherMethod · 0.45

Calls 15

contains_entityMethod · 0.80
get_default_topic_qosMethod · 0.80
set_default_topic_qosMethod · 0.80
delete_datawriterMethod · 0.80
get_publisherMethod · 0.80
create_participantMethod · 0.45
inMethod · 0.45
get_instance_handleMethod · 0.45
register_typeMethod · 0.45
create_topicMethod · 0.45

Tested by 1

TestSystemMethod · 0.36