本文整理汇总了C++中Packet::GetReadPos方法的典型用法代码示例。如果您正苦于以下问题:C++ Packet::GetReadPos方法的具体用法?C++ Packet::GetReadPos怎么用?C++ Packet::GetReadPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet::GetReadPos方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadMessageBody
int AnalogVideoSensorConfiguration::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
packet.Read(mSensorId);
packet.Read(mAnalogFormat);
return packet.GetReadPos() - startPos;
}
示例2: ReadMessageBody
int DigitalVideoSensor::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
packet.Read(mSensorId);
packet.Read(mStreamState);
return packet.GetReadPos() - startPos;
}
示例3: ReadMessageBody
int ReportVisualSensorCapabilities::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
UShort count = 0;
packet.Read(count);
for(int i = 0; i < (int)count; i++)
{
VisualSensorCapabilities vsc = VisualSensorCapabilities();
vsc.ReadMessageBody(packet);
mSensorList.push_back(vsc);
}
return packet.GetReadPos() - startPos;
}
示例4: ReadMessageBody
int ReportAnalogVideoSensorCapabilities::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
UShort count = 0;
packet.Read(count);
for(int i = 0; i < (int)count; i++)
{
AnalogVideoSensorCapabilities avsc = AnalogVideoSensorCapabilities();
avsc.ReadMessageBody(packet);
mSensorList.push_back(avsc);
}
return packet.GetReadPos() - startPos;
}
示例5: ReadMessageBody
int StillImageSensorCapabilities::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
packet.Read(mPresenceVector);
packet.Read(mSensorId);
if((mPresenceVector & StillImageSensorCapabilities::PresenceVector::SupportedFrameSizes) > 0)
{
packet.Read(mSupportedFrameSizes);
}
if((mPresenceVector & StillImageSensorCapabilities::PresenceVector::SupportedImageFormats) > 0)
{
packet.Read(mSupportedImageFormats);
}
return packet.GetReadPos() - startPos;
}
示例6: ReadMessageBody
int SetVisualSensorConfigurations::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
Byte requestId = 0;
UShort count = 0;
packet.Read(requestId);
packet.Read(count);
for(int i = 0; i < (int)count; i++)
{
VisualSensorConfiguration vsc = VisualSensorConfiguration();
vsc.ReadMessageBody(packet);
mSensorList.push_back(vsc);
}
return packet.GetReadPos() - startPos;
}
示例7: ReadMessageBody
int QueryRangeSensorCapabilities::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
UShort count = 0;
packet.Read(count);
for(int i = 0; i < (int)count; i++)
{
UShort sensorID = 0;
UShort presenceVector = 0;
packet.Read(sensorID);
packet.Read(presenceVector);
RangeSensorCapabilities rsc = RangeSensorCapabilities(presenceVector, sensorID);
mSensorList.push_back(rsc);
}
return packet.GetReadPos() - startPos;
}
示例8: ReadMessageBody
int QueryStillImageSensorConfigurations::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
UShort count = 0;
packet.Read(count);
for(int i = 0; i < (int)count; i++)
{
UShort sensorID = 0;
Byte presenceVector = 0;
packet.Read(sensorID);
packet.Read(presenceVector);
StillImageSensorConfiguration sisc = StillImageSensorConfiguration(presenceVector,sensorID);
mSensorList.push_back(sisc);
}
return packet.GetReadPos() - startPos;
}
示例9: ReadMessageBody
int GeometricProperties::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
packet.Read(mSensorId);
packet.Read(mGeometricVariant);
if(mGeometricVariant == 0)
{
//Do nothing because the sensor doesn't know anything abou it's geometric properties
}
if(mGeometricVariant == 1) //Set the static property
{
mStaticGeometric.ReadMessageBody(packet);
}
if(mGeometricVariant == 2) //Set the Manipulatible property
{
mManipulatorGeometric.ReadMessageBody(packet);
}
return packet.GetReadPos() - startPos;
}
示例10: ReadMessageBody
int SetAnalogVideoSensorConfigurations::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
Byte requestId = 0;
UShort count = 0;
packet.Read(requestId);
packet.Read(count);
mRequestId = requestId;
for(int i = 0; i < (int)count; i++)
{
UShort sensorID = 0;
Byte analogFormat = 0;
packet.Read(sensorID);
packet.Read(analogFormat);
AnalogVideoSensorConfiguration avsc = AnalogVideoSensorConfiguration(sensorID, analogFormat);
mSensorList.push_back(avsc);
}
return packet.GetReadPos() - startPos;
}
示例11: Read
////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Reads transport header and payload data from packet, saving to
/// data members of class.
///
/// \param[in] packet Serialized JAUS packet data to read.
/// \param[in] transportHeader Transport header data in front of general
/// transport header.
///
/// \return Number of bytes read on success, FAILURE on error.
///
////////////////////////////////////////////////////////////////////////////////////
int Message::Read(const Packet& packet,
const Packet* transportHeader)
{
unsigned int readPos = packet.GetReadPos();
Header header;
int total = 0;
if(transportHeader && transportHeader->Length() > 0)
{
packet.SetReadPos(readPos + transportHeader->Length());
total = transportHeader->Length();
}
// Try read message transport header data
if(header.Read(packet) > 0)
{
UShort messageCode;
total += Header::MinSize;
total += packet.Read(messageCode);
// Verify this is a message we can actually read.
if(messageCode == mMessageCode)
{
int payloadSize = 0;
if( (payloadSize = ReadMessageBody(packet)) >= 0)
{
total += payloadSize;
mSourceID = header.mSourceID;
mDestinationID = header.mDestinationID;
mPriority = header.mPriorityFlag;
return total;
}
}
}
// Reset read position on failure.
packet.SetReadPos(readPos);
return FAILURE;
}
示例12: ReadMessageBody
int VisualSensorConfiguration::ReadMessageBody(const Packet& packet)
{
UInt startPos = packet.GetReadPos();
packet.Read(mPresenceVector);
packet.Read(mSensorId);
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::SensorState) > 0)
{
packet.Read(mSensorState);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::ZoomMode) > 0)
{
packet.Read(mZoomMode);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::ZoomLevel) > 0)
{
packet.Read(mZoomLevel);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::FocalLength) > 0)
{
packet.Read(mFocalLength);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::HorizontalFieldOfView) > 0)
{
packet.Read(mHorizontalFieldOfView);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::VerticalFieldOfView) > 0)
{
packet.Read(mVerticalFieldOfView);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::FocusMode) > 0)
{
packet.Read(mFocusMode);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::FocusValue) > 0)
{
packet.Read(mFocusValue);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::WhiteBalance) > 0)
{
packet.Read(mWhiteBalance);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::ImagingMode) > 0)
{
packet.Read(mImagingMode);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::ExposureMode) > 0)
{
packet.Read(mExposureMode);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::MeteringMode) > 0)
{
packet.Read(mMeteringMode);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::ShutterSpeed) > 0)
{
packet.Read(mShutterSpeed);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::Aperture) > 0)
{
packet.Read(mAperture);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::LightSensitivity) > 0)
{
packet.Read(mLightSensitivity);
}
if((mPresenceVector & VisualSensorConfiguration::PresenceVector::ImageStabilization) > 0)
{
packet.Read(mImageStabilization);
}
return packet.GetReadPos() - startPos;
}