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

Method create_replayer

dds/DCPS/DomainParticipantImpl.cpp:2227–2279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225}
2226
2227Replayer_ptr
2228DomainParticipantImpl::create_replayer(DDS::Topic_ptr a_topic,
2229 const DDS::PublisherQos& publisher_qos,
2230 const DDS::DataWriterQos& datawriter_qos,
2231 const ReplayerListener_rch& a_listener,
2232 DDS::StatusMask mask)
2233{
2234 if (CORBA::is_nil(a_topic)) {
2235 if (DCPS_debug_level > 0) {
2236 ACE_ERROR((LM_ERROR,
2237 ACE_TEXT("(%P|%t) ERROR: ")
2238 ACE_TEXT("DomainParticipantImpl::create_replayer, ")
2239 ACE_TEXT("topic desc is nil.\n")));
2240 }
2241 return 0;
2242 }
2243
2244 DDS::PublisherQos pub_qos = publisher_qos;
2245 DDS::DataWriterQos dw_qos;
2246
2247 if (! this->validate_publisher_qos(pub_qos) ||
2248 ! PublisherImpl::validate_datawriter_qos(datawriter_qos,
2249 TheServiceParticipant->initial_DataWriterQos(),
2250 a_topic,
2251 dw_qos)) {
2252 return 0;
2253 }
2254
2255 TopicImpl* topic_servant = dynamic_cast<TopicImpl*>(a_topic);
2256
2257 ReplayerImpl* replayer(new ReplayerImpl);
2258 Replayer_var result(replayer);
2259
2260 replayer->init(a_topic, topic_servant, dw_qos, a_listener, mask, this, pub_qos);
2261
2262 if (enabled_ && qos_.entity_factory.autoenable_created_entities) {
2263 const DDS::ReturnCode_t ret = replayer->enable();
2264
2265 if (ret != DDS::RETCODE_OK) {
2266 if (DCPS_debug_level > 0) {
2267 ACE_ERROR((LM_ERROR,
2268 ACE_TEXT("(%P|%t) ERROR: ")
2269 ACE_TEXT("DomainParticipantImpl::create_replayer, ")
2270 ACE_TEXT("enable failed.\n")));
2271 }
2272 return 0;
2273 }
2274 }
2275
2276 ACE_Guard<ACE_Recursive_Thread_Mutex> guard(replayers_protector_);
2277 replayers_.insert(result);
2278 return result._retn();
2279}
2280
2281void
2282DomainParticipantImpl::delete_recorder(Recorder_ptr recorder)

Callers

nothing calls this directly

Calls 5

initMethod · 0.45
enableMethod · 0.45
insertMethod · 0.45
_retnMethod · 0.45

Tested by

no test coverage detected