Exemplo n.º 1
0
void MinefieldDataPdu::unmarshal(DataStream& dataStream)
{
    MinefieldFamilyPdu::unmarshal(dataStream); // unmarshal information in superclass first
    _minefieldID.unmarshal(dataStream);
    _requestingEntityID.unmarshal(dataStream);
    dataStream >> _minefieldSequenceNumbeer;
    dataStream >> _requestID;
    dataStream >> _pduSequenceNumber;
    dataStream >> _numberOfPdus;
    dataStream >> _numberOfMinesInThisPdu;
    dataStream >> _numberOfSensorTypes;
    dataStream >> _pad2;
    dataStream >> _dataFilter;
    _mineType.unmarshal(dataStream);

     _sensorTypes.clear();
     for(size_t idx = 0; idx < _numberOfSensorTypes; idx++)
     {
        TwoByteChunk x;
        x.unmarshal(dataStream);
        _sensorTypes.push_back(x);
     }
    dataStream >> _pad3;

     _mineLocation.clear();
     for(size_t idx = 0; idx < _numberOfMinesInThisPdu; idx++)
     {
        Vector3Float x;
        x.unmarshal(dataStream);
        _mineLocation.push_back(x);
     }
}
Exemplo n.º 2
0
int MinefieldDataPdu::getMarshalledSize() const
{
   int marshalSize = 0;

   marshalSize = MinefieldFamilyPdu::getMarshalledSize();
   marshalSize = marshalSize + _minefieldID.getMarshalledSize();  // _minefieldID
   marshalSize = marshalSize + _requestingEntityID.getMarshalledSize();  // _requestingEntityID
   marshalSize = marshalSize + 2;  // _minefieldSequenceNumbeer
   marshalSize = marshalSize + 1;  // _requestID
   marshalSize = marshalSize + 1;  // _pduSequenceNumber
   marshalSize = marshalSize + 1;  // _numberOfPdus
   marshalSize = marshalSize + 1;  // _numberOfMinesInThisPdu
   marshalSize = marshalSize + 1;  // _numberOfSensorTypes
   marshalSize = marshalSize + 1;  // _pad2
   marshalSize = marshalSize + 4;  // _dataFilter
   marshalSize = marshalSize + _mineType.getMarshalledSize();  // _mineType

   for(int idx=0; idx < _sensorTypes.size(); idx++)
   {
        TwoByteChunk listElement = _sensorTypes[idx];
        marshalSize = marshalSize + listElement.getMarshalledSize();
    }

   marshalSize = marshalSize + 1;  // _pad3

   for(int idx=0; idx < _mineLocation.size(); idx++)
   {
        Vector3Float listElement = _mineLocation[idx];
        marshalSize = marshalSize + listElement.getMarshalledSize();
    }

    return marshalSize;
}
Exemplo n.º 3
0
int MinefieldQueryPdu::getMarshalledSize() const
{
   int marshalSize = 0;

   marshalSize = MinefieldFamilyPdu::getMarshalledSize();
   marshalSize = marshalSize + _minefieldID.getMarshalledSize();  // _minefieldID
   marshalSize = marshalSize + _requestingEntityID.getMarshalledSize();  // _requestingEntityID
   marshalSize = marshalSize + 1;  // _requestID
   marshalSize = marshalSize + 1;  // _numberOfPerimeterPoints
   marshalSize = marshalSize + 1;  // _pad2
   marshalSize = marshalSize + 1;  // _numberOfSensorTypes
   marshalSize = marshalSize + 4;  // _dataFilter
   marshalSize = marshalSize + _requestedMineType.getMarshalledSize();  // _requestedMineType

   for(int idx=0; idx < _requestedPerimeterPoints.size(); idx++)
   {
        Point listElement = _requestedPerimeterPoints[idx];
        marshalSize = marshalSize + listElement.getMarshalledSize();
    }


   for(int idx=0; idx < _sensorTypes.size(); idx++)
   {
        TwoByteChunk listElement = _sensorTypes[idx];
        marshalSize = marshalSize + listElement.getMarshalledSize();
    }

    return marshalSize;
}
Exemplo n.º 4
0
void MinefieldDataPdu::marshal(DataStream& dataStream) const
{
    MinefieldFamilyPdu::marshal(dataStream); // Marshal information in superclass first
    _minefieldID.marshal(dataStream);
    _requestingEntityID.marshal(dataStream);
    dataStream << _minefieldSequenceNumbeer;
    dataStream << _requestID;
    dataStream << _pduSequenceNumber;
    dataStream << _numberOfPdus;
    dataStream << ( unsigned char )_mineLocation.size();
    dataStream << ( unsigned char )_sensorTypes.size();
    dataStream << _pad2;
    dataStream << _dataFilter;
    _mineType.marshal(dataStream);

     for(size_t idx = 0; idx < _sensorTypes.size(); idx++)
     {
        TwoByteChunk x = _sensorTypes[idx];
        x.marshal(dataStream);
     }

    dataStream << _pad3;

     for(size_t idx = 0; idx < _mineLocation.size(); idx++)
     {
        Vector3Float x = _mineLocation[idx];
        x.marshal(dataStream);
     }

}
Exemplo n.º 5
0
void MinefieldQueryPdu::unmarshal(DataStream& dataStream)
{
    MinefieldFamilyPdu::unmarshal(dataStream); // unmarshal information in superclass first
    _minefieldID.unmarshal(dataStream);
    _requestingEntityID.unmarshal(dataStream);
    dataStream >> _requestID;
    dataStream >> _numberOfPerimeterPoints;
    dataStream >> _pad2;
    dataStream >> _numberOfSensorTypes;
    dataStream >> _dataFilter;
    _requestedMineType.unmarshal(dataStream);

     _requestedPerimeterPoints.clear();
     for(size_t idx = 0; idx < _numberOfPerimeterPoints; idx++)
     {
        Point x;
        x.unmarshal(dataStream);
        _requestedPerimeterPoints.push_back(x);
     }

     _sensorTypes.clear();
     for(size_t idx = 0; idx < _numberOfSensorTypes; idx++)
     {
        TwoByteChunk x;
        x.unmarshal(dataStream);
        _sensorTypes.push_back(x);
     }
}
Exemplo n.º 6
0
void MinefieldQueryPdu::marshal(DataStream& dataStream) const
{
    MinefieldFamilyPdu::marshal(dataStream); // Marshal information in superclass first
    _minefieldID.marshal(dataStream);
    _requestingEntityID.marshal(dataStream);
    dataStream << _requestID;
    dataStream << ( unsigned char )_requestedPerimeterPoints.size();
    dataStream << _pad2;
    dataStream << ( unsigned char )_sensorTypes.size();
    dataStream << _dataFilter;
    _requestedMineType.marshal(dataStream);

     for(size_t idx = 0; idx < _requestedPerimeterPoints.size(); idx++)
     {
        Point x = _requestedPerimeterPoints[idx];
        x.marshal(dataStream);
     }


     for(size_t idx = 0; idx < _sensorTypes.size(); idx++)
     {
        TwoByteChunk x = _sensorTypes[idx];
        x.marshal(dataStream);
     }

}
void GridAxisRecordRepresentation1::marshal(DataStream& dataStream) const
{
    GridAxisRecord::marshal(dataStream); // Marshal information in superclass first
    dataStream << _fieldScale;
    dataStream << _fieldOffset;
    dataStream << ( unsigned short )_dataValues.size();

     for(size_t idx = 0; idx < _dataValues.size(); idx++)
     {
        TwoByteChunk x = _dataValues[idx];
        x.marshal(dataStream);
     }

}
void GridAxisRecordRepresentation1::unmarshal(DataStream& dataStream)
{
    GridAxisRecord::unmarshal(dataStream); // unmarshal information in superclass first
    dataStream >> _fieldScale;
    dataStream >> _fieldOffset;
    dataStream >> _numberOfValues;

     _dataValues.clear();
     for(size_t idx = 0; idx < _numberOfValues; idx++)
     {
        TwoByteChunk x;
        x.unmarshal(dataStream);
        _dataValues.push_back(x);
     }
}
int GridAxisRecordRepresentation1::getMarshalledSize() const
{
   int marshalSize = 0;

   marshalSize = GridAxisRecord::getMarshalledSize();
   marshalSize = marshalSize + 4;  // _fieldScale
   marshalSize = marshalSize + 4;  // _fieldOffset
   marshalSize = marshalSize + 2;  // _numberOfValues

   for(int idx=0; idx < _dataValues.size(); idx++)
   {
        TwoByteChunk listElement = _dataValues[idx];
        marshalSize = marshalSize + listElement.getMarshalledSize();
    }

    return marshalSize;
}