| 152 | } |
| 153 | |
| 154 | DDS::DataReader_var |
| 155 | Factory::reader(const DDS::Subscriber_var& sub, const DDS::Topic_var& topic, const DDS::DataReaderListener_var& drl) const |
| 156 | { |
| 157 | // Create the data readers |
| 158 | DDS::DataReaderQos dr_qos; |
| 159 | sub->get_default_datareader_qos(dr_qos); |
| 160 | |
| 161 | dr_qos.durability.kind = opts_.durability_kind; |
| 162 | dr_qos.liveliness.kind = opts_.liveliness_kind; |
| 163 | dr_qos.liveliness.lease_duration = opts_.LEASE_DURATION; |
| 164 | dr_qos.reliability.kind = opts_.reliability_kind; |
| 165 | |
| 166 | DDS::DomainParticipant_var dp = sub->get_participant(); |
| 167 | CORBA::String_var tn = topic->get_name(); |
| 168 | DDS::TopicDescription_var description = dp->lookup_topicdescription(tn); |
| 169 | TEST_ASSERT(!CORBA::is_nil(description.in())); |
| 170 | |
| 171 | DDS::DataReader_var rd(sub->create_datareader(description.in(), |
| 172 | dr_qos, |
| 173 | drl.in(), |
| 174 | ::OpenDDS::DCPS::DEFAULT_STATUS_MASK)); |
| 175 | |
| 176 | // Initialize the transport configuration for the appropriate entity |
| 177 | TEST_ASSERT(!opts_.configuration_str.empty()); |
| 178 | if (opts_.configuration_str != "none" && opts_.entity_str == "rw") |
| 179 | { |
| 180 | |
| 181 | OpenDDS::DCPS::TransportRegistry::instance()->bind_config(opts_.configuration_str, |
| 182 | rd.in()); |
| 183 | if (!opts_.entity_autoenable) |
| 184 | { |
| 185 | TEST_ASSERT(DDS::RETCODE_OK == rd->enable()); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | return rd; |
| 190 | } |
no test coverage detected