Esempio n. 1
0
  /** Clear (put to default) the information. */
  public void clear() {
    m_expectsInlineQos = false;
    m_guid.copy(new GUID());
    m_unicastLocatorList.clear();
    m_multicastLocatorList.clear();
    m_key.copy(new InstanceHandle());
    m_RTPSParticipantKey.copy(new InstanceHandle());
    m_typeName = "";
    m_topicName = "";
    m_userDefinedId = 0;
    m_qos.copy(new ReaderQos());
    m_isAlive = true;
    m_topicKind = NO_KEY;

    m_parameterList.deleteParams();
    m_parameterList.resetList();
  }
Esempio n. 2
0
  /**
   * Convert the data to a parameter list to send this information as a RTPS message.
   *
   * @return The ParameterList
   */
  public ParameterList toParameterList() {
    m_parameterList.deleteParams();
    for (Locator lit : m_unicastLocatorList) {
      ParameterLocator p = new ParameterLocator(PID_UNICAST_LOCATOR, PARAMETER_LOCATOR_LENGTH, lit);
      m_parameterList.addParameter(p);
    }
    for (Locator lit : m_multicastLocatorList) {
      ParameterLocator p =
          new ParameterLocator(PID_MULTICAST_LOCATOR, PARAMETER_LOCATOR_LENGTH, lit);
      m_parameterList.addParameter(p);
    }
    {
      ParameterBool p =
          new ParameterBool(PID_EXPECTS_INLINE_QOS, PARAMETER_BOOL_LENGTH, m_expectsInlineQos);
      m_parameterList.addParameter(p);
    }
    {
      ParameterGuid p =
          new ParameterGuid(PID_PARTICIPANT_GUID, PARAMETER_GUID_LENGTH, m_RTPSParticipantKey);
      m_parameterList.addParameter(p);
    }
    {
      ParameterString p = new ParameterString(PID_TOPIC_NAME, (short) 0, m_topicName);
      m_parameterList.addParameter(p);
    }
    {
      ParameterString p = new ParameterString(PID_TYPE_NAME, (short) 0, m_typeName);
      m_parameterList.addParameter(p);
    }
    {
      ParameterKey p = new ParameterKey(PID_KEY_HASH, (short) 16, m_key);
      m_parameterList.addParameter(p);
    }
    {
      ParameterGuid p = new ParameterGuid(PID_ENDPOINT_GUID, (short) 16, m_guid);
      m_parameterList.addParameter(p);
    }
    {
      ParameterProtocolVersion p = new ParameterProtocolVersion(PID_PROTOCOL_VERSION, (short) 4);
      m_parameterList.addParameter(p);
    }
    {
      ParameterVendorId p = new ParameterVendorId(PID_VENDORID, (short) 4);
      m_parameterList.addParameter(p);
    }
    if (m_qos.durability.parent.getSendAlways() || m_qos.durability.parent.hasChanged) {
      DurabilityQosPolicy p = new DurabilityQosPolicy();
      p.copy(m_qos.durability);
      m_parameterList.addParameter(p);
    }
    if (m_qos.durabilityService.parent.getSendAlways()
        || m_qos.durabilityService.parent.hasChanged) {
      DurabilityServiceQosPolicy p = new DurabilityServiceQosPolicy();
      p.copy(m_qos.durabilityService);
      m_parameterList.addParameter(p);
    }
    if (m_qos.deadline.parent.getSendAlways() || m_qos.deadline.parent.hasChanged) {
      DeadLineQosPolicy p = new DeadLineQosPolicy();
      p.copy(m_qos.deadline);
      m_parameterList.addParameter(p);
    }
    if (m_qos.latencyBudget.parent.getSendAlways() || m_qos.latencyBudget.parent.hasChanged) {
      LatencyBudgetQosPolicy p = new LatencyBudgetQosPolicy();
      p.copy(m_qos.latencyBudget);
      m_parameterList.addParameter(p);
    }
    if (m_qos.liveliness.parent.getSendAlways() || m_qos.liveliness.parent.hasChanged) {
      LivelinessQosPolicy p = new LivelinessQosPolicy();
      p.copy(m_qos.liveliness);
      m_parameterList.addParameter(p);
    }
    if (m_qos.reliability.parent.getSendAlways() || m_qos.reliability.parent.hasChanged) {
      ReliabilityQosPolicy p = new ReliabilityQosPolicy();
      p.copy(m_qos.reliability);
      m_parameterList.addParameter(p);
    }
    if (m_qos.lifespan.parent.getSendAlways() || m_qos.lifespan.parent.hasChanged) {
      LifespanQosPolicy p = new LifespanQosPolicy();
      p.copy(m_qos.lifespan);
      m_parameterList.addParameter(p);
    }
    if (m_qos.userData.parent.getSendAlways() || m_qos.userData.parent.hasChanged) {
      UserDataQosPolicy p = new UserDataQosPolicy();
      p.copy(m_qos.userData);
      m_parameterList.addParameter(p);
    }
    if (m_qos.timeBasedFilter.parent.getSendAlways() || m_qos.timeBasedFilter.parent.hasChanged) {
      TimeBasedFilterQosPolicy p = new TimeBasedFilterQosPolicy();
      p.copy(m_qos.timeBasedFilter);
      m_parameterList.addParameter(p);
    }
    if (m_qos.ownership.parent.getSendAlways() || m_qos.ownership.parent.hasChanged) {
      OwnershipQosPolicy p = new OwnershipQosPolicy();
      p.copy(m_qos.ownership);
      m_parameterList.addParameter(p);
    }
    if (m_qos.destinationOrder.parent.getSendAlways() || m_qos.destinationOrder.parent.hasChanged) {
      DestinationOrderQosPolicy p = new DestinationOrderQosPolicy();
      p.copy(m_qos.destinationOrder);
      m_parameterList.addParameter(p);
    }
    if (m_qos.presentation.parent.getSendAlways() || m_qos.presentation.parent.hasChanged) {
      PresentationQosPolicy p = new PresentationQosPolicy();
      p.copy(m_qos.presentation);
      m_parameterList.addParameter(p);
    }
    if (m_qos.partition.parent.getSendAlways() || m_qos.partition.parent.hasChanged) {
      PartitionQosPolicy p = new PartitionQosPolicy();
      p.copy(m_qos.partition);
      m_parameterList.addParameter(p);
    }
    if (m_qos.topicData.parent.getSendAlways() || m_qos.topicData.parent.hasChanged) {
      TopicDataQosPolicy p = new TopicDataQosPolicy();
      p.copy(m_qos.topicData);
      m_parameterList.addParameter(p);
    }
    if (m_qos.groupData.parent.getSendAlways() || m_qos.groupData.parent.hasChanged) {
      GroupDataQosPolicy p = new GroupDataQosPolicy();
      p.copy(m_qos.groupData);
      m_parameterList.addParameter(p);
    }
    if (m_qos.timeBasedFilter.parent.getSendAlways() || m_qos.timeBasedFilter.parent.hasChanged) {
      TimeBasedFilterQosPolicy p = new TimeBasedFilterQosPolicy();
      p.copy(m_qos.timeBasedFilter);
      m_parameterList.addParameter(p);
    }
    this.m_parameterList.addSentinel();

    logger.debug(
        "DiscoveredReaderData converted to ParameterList with {} parameters",
        m_parameterList.getParameters().size());
    return this.m_parameterList;
  }