| 336 | template <typename MessageType> |
| 337 | struct Writer { |
| 338 | Writer(const Publisher_var& pub, const char* topic_name, |
| 339 | const DomainParticipant_var& other_participant) |
| 340 | : ts_(new typename ::OpenDDS::DCPS::DDSTraits<MessageType>::TypeSupportImplType()) |
| 341 | { |
| 342 | DomainParticipant_var dp = pub->get_participant(); |
| 343 | check_rc(ts_->register_type(dp, ""), "register type", DDSTraits<MessageType>::type_name()); |
| 344 | check_rc(ts_->register_type(other_participant, ""), "register type", DDSTraits<MessageType>::type_name()); |
| 345 | CORBA::String_var type_name = ts_->get_type_name(); |
| 346 | |
| 347 | TopicQos topic_qos; |
| 348 | other_participant->get_default_topic_qos(topic_qos); |
| 349 | topic_qos.latency_budget.duration.sec = 1; |
| 350 | topic_qos.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS; |
| 351 | // topic2 is created first so that if the discovery mechanism supports |
| 352 | // topic propagation then it's the one seen by the find_topic operation |
| 353 | // that's part of creating the MultiTopic reader. If there is no topic |
| 354 | // propagation then the relative order of topic vs. topic2 doesn't matter. |
| 355 | Topic_var topic2 = other_participant->create_topic(topic_name, type_name, |
| 356 | topic_qos, 0, DEFAULT_STATUS_MASK); |
| 357 | |
| 358 | Topic_var topic = dp->create_topic(topic_name, type_name, |
| 359 | TOPIC_QOS_DEFAULT, 0, DEFAULT_STATUS_MASK); |
| 360 | |
| 361 | dw_ = pub->create_datawriter(topic, |
| 362 | DATAWRITER_QOS_DEFAULT, 0, DEFAULT_STATUS_MASK); |
| 363 | } |
| 364 | |
| 365 | typename OpenDDS::DCPS::DDSTraits<MessageType>::TypeSupportType::_var_type ts_; |
| 366 | DataWriter_var dw_; |
nothing calls this directly
no test coverage detected