コード例 #1
0
const MetaStruct&
MultiTopicDataReaderBase::metaStructFor(DDS::DataReader_ptr reader)
{
  DDS::TopicDescription_var td = reader->get_topicdescription();
  TopicDescriptionImpl* tdi = dynamic_cast<TopicDescriptionImpl*>(td.in());
  TypeSupportImpl* ts = dynamic_cast<TypeSupportImpl*>(tdi->get_type_support());
  return ts->getMetaStructForType();
}
コード例 #2
0
ファイル: Factory.cpp プロジェクト: FlavioFalcao/DDS-1
DDS::DataReader_var
Factory::reader(const DDS::Subscriber_var& sub, const DDS::Topic_var& topic, const DDS::DataReaderListener_var& drl) const
{
  // Create the data readers
  DDS::DataReaderQos dr_qos;
  sub->get_default_datareader_qos(dr_qos);

  dr_qos.durability.kind = opts_.durability_kind;
  dr_qos.liveliness.kind = opts_.liveliness_kind;
  dr_qos.liveliness.lease_duration = opts_.LEASE_DURATION;
  dr_qos.reliability.kind = opts_.reliability_kind;

  DDS::DomainParticipant_var dp = sub->get_participant();
  CORBA::String_var tn = topic->get_name();
  DDS::TopicDescription_var description = dp->lookup_topicdescription(tn);
  TEST_ASSERT(!CORBA::is_nil(description.in()));

  DDS::DataReader_var rd(sub->create_datareader(description.in(),
                                                dr_qos,
                                                drl.in(),
                                                ::OpenDDS::DCPS::DEFAULT_STATUS_MASK));

  // Initialize the transport configuration for the appropriate entity
  TEST_ASSERT(!opts_.configuration_str.empty());
  if (opts_.configuration_str != "none" && opts_.entity_str == "rw")
    {

      OpenDDS::DCPS::TransportRegistry::instance()->bind_config(opts_.configuration_str,
                                                                rd.in());
      if (!opts_.entity_autoenable)
        {
          TEST_ASSERT(DDS::RETCODE_OK == rd->enable());
        }
    }

  return rd;
}