PVData C++ 8.0.9
Loading...
Searching...
No Matches
epics::pvData::SerializeHelper Class Reference

Serialization helper. More...

#include <misc/pv/serializeHelper.h>

Static Public Member Functions

static void writeSize (std::size_t s, ByteBuffer *buffer, SerializableControl *flusher)
static std::size_t readSize (ByteBuffer *buffer, DeserializableControl *control)
static void serializeString (const std::string &value, ByteBuffer *buffer, SerializableControl *flusher)
static void serializeSubstring (const std::string &value, std::size_t offset, std::size_t count, ByteBuffer *buffer, SerializableControl *flusher)
static std::string deserializeString (ByteBuffer *buffer, DeserializableControl *control, std::size_t max=0x7fffffff)

Detailed Description

Serialization helper.

Definition at line 29 of file serializeHelper.h.

Member Function Documentation

◆ deserializeString()

std::string epics::pvData::SerializeHelper::deserializeString ( ByteBuffer * buffer,
DeserializableControl * control,
std::size_t max = 0x7fffffff )
static

std::string deserialization helper method.

Parameters
[in]bufferdeserialization buffer
[in]controlcontrol
[in]maxlength limit
Returns
deserialized string
Todo
This method cannot return "null", but Java implementation could have serialized "null" value as well. This implementation returns an empty string in that event.
Since
8.0.9 Added the max argument. Test for the DESERIALIZE_STRING_HAS_LIMIT macro to detect. Retroactive default is 2 GiB

◆ readSize()

std::size_t epics::pvData::SerializeHelper::readSize ( ByteBuffer * buffer,
DeserializableControl * control )
static

Deserialize array size. The specified DeserializableControl ensures sufficient bytes are available.

Parameters
[in]bufferdeserialization buffer.
[in]controlthe DeserializableControl.
Returns
array size, or (size_t) -1.

◆ serializeString()

void epics::pvData::SerializeHelper::serializeString ( const std::string & value,
ByteBuffer * buffer,
SerializableControl * flusher )
static

std::string serialization helper method.

Parameters
[in]valuestd::string to serialize
[in]bufferserialization buffer
[in]flusherflusher

◆ serializeSubstring()

void epics::pvData::SerializeHelper::serializeSubstring ( const std::string & value,
std::size_t offset,
std::size_t count,
ByteBuffer * buffer,
SerializableControl * flusher )
static

std::string serialization helper method.

Parameters
[in]valuestd::string to serialize
[in]offsetstart of the substring in value
[in]countthe number of characters to write
[in]bufferserialization buffer
[in]flusherflusher

◆ writeSize()

void epics::pvData::SerializeHelper::writeSize ( std::size_t s,
ByteBuffer * buffer,
SerializableControl * flusher )
static

Serialize the specified array size into the specified buffer, flushing when necessary. The specified SerializableControl manages any flushing required.

Parameters
[in]ssize to encode
[in]bufferserialization buffer
[in]flusherSerializableControl to manage the flushing

The documentation for this class was generated from the following file: