コード例 #1
0
  public Object serialized_sample_to_key(
      Object endpoint_data,
      Object sample,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_key,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_key) {
      BaseValueType typedDst = (BaseValueType) sample;

      typedDst.longMember1 = src.readInt();
    }

    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return sample;
  }
コード例 #2
0
  public void serialized_sample_to_keyhash(
      Object endpoint_data,
      CdrInputStream src,
      KeyHash_t keyhash,
      boolean include_encapsulation,
      Object endpoint_plugin_qos) {
    int position = 0;

    DefaultEndpointData endpointData = (DefaultEndpointData) endpoint_data;
    Object sample = null;

    sample = endpointData.get_sample();

    if (sample == null) {
      throw new RETCODE_ERROR("Missing intermediate sample");
    }

    BaseValueType typedDst = (BaseValueType) sample;

    if (include_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    typedDst.longMember1 = src.readInt();

    if (include_encapsulation) {
      src.restoreAlignment(position);
    }

    instance_to_keyhash(endpoint_data, keyhash, sample);
  }
コード例 #3
0
  public void skip(
      Object endpoint_data,
      CdrInputStream src,
      boolean skip_encapsulation,
      boolean skip_sample,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (skip_encapsulation) {
      src.skipEncapsulation();

      position = src.resetAlignment();
    }

    if (skip_sample) {

      src.skipString();

      src.skipString();

      org.openfmb.model.dds.rti.openfmb.commonmodule.EndDeviceControlTypeTypeSupport.get_instance()
          .skip(endpoint_data, src, false, true, endpoint_plugin_qos);

      org.openfmb.model.dds.rti.openfmb.commonmodule.DateTimeIntervalTypeSupport.get_instance()
          .skip(endpoint_data, src, false, true, endpoint_plugin_qos);

      org.openfmb.model.dds.rti.openfmb.commonmodule.SequenceOfEndDeviceControlSetPointsTypeSupport
          .get_instance()
          .skip(endpoint_data, src, false, true, endpoint_plugin_qos);
    }

    if (skip_encapsulation) {
      src.restoreAlignment(position);
    }
  }
  public Object serialized_sample_to_key(
      Object endpoint_data,
      Object sample,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_key,
      Object endpoint_plugin_qos) {

    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_key) {

      SequenceOfGenerationControlSetPoints typedDst = (SequenceOfGenerationControlSetPoints) sample;

      org.openfmb.model.dds.rti.common.SetPointTypeSupport.get_instance()
          .deserialize_sequence(
              endpoint_data,
              typedDst.userData,
              src,
              ((org.openfmb.model.dds.rti.generation.MaxLengthGenerationControlSetPoints.VALUE)),
              endpoint_plugin_qos);
    }

    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return sample;
  }
コード例 #5
0
  public Object serialized_sample_to_key(
      Object endpoint_data,
      Object sample,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_key,
      Object endpoint_plugin_qos) {

    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_key) {

      EndDeviceControl typedDst = (EndDeviceControl) sample;

      deserialize_sample(endpoint_data, sample, src, false, true, endpoint_plugin_qos);
    }

    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return sample;
  }
コード例 #6
0
  public void skip(
      Object endpoint_data,
      CdrInputStream src,
      boolean skip_encapsulation,
      boolean skip_sample,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (skip_encapsulation) {
      src.skipEncapsulation();

      position = src.resetAlignment();
    }

    if (skip_sample) {

      src.skipLong();

      src.skipFloat();
    }

    if (skip_encapsulation) {
      src.restoreAlignment(position);
    }
  }
コード例 #7
0
  public Object deserialize_key_sample(
      Object endpoint_data,
      Object dst,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_key,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_key) {

      SunRadiationData typedDst = (SunRadiationData) dst;

      deserialize_sample(endpoint_data, dst, src, false, true, endpoint_plugin_qos);
    }
    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return dst;
  }
コード例 #8
0
  @Override
  public void serialized_sample_to_keyhash(
      Object endpoint_data,
      CdrInputStream src,
      KeyHash_t keyhash,
      boolean include_encapsulation,
      Object endpoint_plugin_qos) {
    int position = 0;

    DefaultEndpointData endpointData = (DefaultEndpointData) endpoint_data;
    Object sample = null;

    sample = endpointData.get_sample();

    if (sample == null) {
      throw new RETCODE_ERROR("Missing intermediate sample");
    }

    MDSConnectivity typedDst = (MDSConnectivity) sample;

    if (include_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    typedDst.unique_device_identifier = src.readString((64));

    if (include_encapsulation) {
      src.restoreAlignment(position);
    }

    instance_to_keyhash(endpoint_data, keyhash, sample);
  }
コード例 #9
0
  public Object serialized_sample_to_key(
      Object endpoint_data,
      Object sample,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_key,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_key) {
      MDSConnectivity typedDst = (MDSConnectivity) sample;

      typedDst.unique_device_identifier = src.readString((64));

      src.skipString();
    }

    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return sample;
  }
  public void skip(
      Object endpoint_data,
      CdrInputStream src,
      boolean skip_encapsulation,
      boolean skip_sample,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (skip_encapsulation) {
      src.skipEncapsulation();

      position = src.resetAlignment();
    }

    if (skip_sample) {

      org.openfmb.model.dds.rti.common.SetPointTypeSupport.get_instance()
          .skip_sequence(endpoint_data, src, endpoint_plugin_qos);
    }

    if (skip_encapsulation) {
      src.restoreAlignment(position);
    }
  }
コード例 #11
0
  @Override
  public Object deserialize_sample(
      Object endpoint_data,
      Object dst,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_sample,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_sample) {
      MDSConnectivity typedDst = (MDSConnectivity) dst;

      typedDst.clear();
      try {

        typedDst.unique_device_identifier = src.readString((64));

        typedDst.partition = src.readString((128));

      } catch (IllegalCdrStateException stateEx) {
        if (src.available() >= CdrEncapsulation.CDR_ENCAPSULATION_PARAMETER_ID_ALIGNMENT) {
          throw new RETCODE_ERROR(
              "Error deserializing sample! Remainder: "
                  + src.available()
                  + "\n"
                  + "Exception caused by: "
                  + stateEx.getMessage());
        }
      } catch (Exception ex) {
        throw new RETCODE_ERROR(ex.getMessage());
      }
    }

    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return dst;
  }
コード例 #12
0
  public Object deserialize_sample(
      Object endpoint_data,
      Object dst,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_sample,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_sample) {

      SunRadiationData typedDst = (SunRadiationData) dst;
      typedDst.clear();
      try {
        typedDst.timestamp = src.readLong();
        typedDst.value = src.readFloat();
      } catch (IllegalCdrStateException stateEx) {
        if (src.available() >= CdrEncapsulation.CDR_ENCAPSULATION_PARAMETER_ID_ALIGNMENT) {
          throw new RETCODE_ERROR(
              "Error deserializing sample! Remainder: "
                  + src.available()
                  + "\n"
                  + "Exception caused by: "
                  + stateEx.getMessage());
        }
      } catch (Exception ex) {
        throw new RETCODE_ERROR(ex.getMessage());
      }
    }
    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return dst;
  }
コード例 #13
0
  public Object deserialize_sample(
      Object endpoint_data,
      Object dst,
      CdrInputStream src,
      boolean deserialize_encapsulation,
      boolean deserialize_sample,
      Object endpoint_plugin_qos) {
    int position = 0;

    if (deserialize_encapsulation) {
      src.deserializeAndSetCdrEncapsulation();

      position = src.resetAlignment();
    }

    if (deserialize_sample) {

      EndDeviceControl typedDst = (EndDeviceControl) dst;
      typedDst.clear();
      try {
        typedDst.issueID = src.readString((255));
        typedDst.name = src.readString((255));
        typedDst.endDeviceControlType =
            (org.openfmb.model.dds.rti.openfmb.commonmodule.EndDeviceControlType)
                org.openfmb.model.dds.rti.openfmb.commonmodule.EndDeviceControlTypeTypeSupport
                    .get_instance()
                    .deserialize_sample(
                        endpoint_data,
                        typedDst.endDeviceControlType,
                        src,
                        false,
                        true,
                        endpoint_plugin_qos);
        typedDst.scheduledInterval =
            (org.openfmb.model.dds.rti.openfmb.commonmodule.DateTimeInterval)
                org.openfmb.model.dds.rti.openfmb.commonmodule.DateTimeIntervalTypeSupport
                    .get_instance()
                    .deserialize_sample(
                        endpoint_data,
                        typedDst.scheduledInterval,
                        src,
                        false,
                        true,
                        endpoint_plugin_qos);
        typedDst.setPoints =
            (org.openfmb.model.dds.rti.openfmb.commonmodule.SequenceOfEndDeviceControlSetPoints)
                org.openfmb.model.dds.rti.openfmb.commonmodule
                    .SequenceOfEndDeviceControlSetPointsTypeSupport.get_instance()
                    .deserialize_sample(
                        endpoint_data, typedDst.setPoints, src, false, true, endpoint_plugin_qos);
      } catch (IllegalCdrStateException stateEx) {
        if (src.available() >= CdrEncapsulation.CDR_ENCAPSULATION_PARAMETER_ID_ALIGNMENT) {
          throw new RETCODE_ERROR(
              "Error deserializing sample! Remainder: "
                  + src.available()
                  + "\n"
                  + "Exception caused by: "
                  + stateEx.getMessage());
        }
      } catch (Exception ex) {
        throw new RETCODE_ERROR(ex.getMessage());
      }
    }
    if (deserialize_encapsulation) {
      src.restoreAlignment(position);
    }

    return dst;
  }