Public Member Functions | Private Member Functions | Private Attributes | List of all members
eip::serialization::SerializableBuffer Class Reference

#include <serializable_buffer.h>

Inheritance diagram for eip::serialization::SerializableBuffer:
Inheritance graph
[legend]

Public Member Functions

virtual Readerdeserialize (Reader &reader, size_t length)
 
virtual Readerdeserialize (Reader &reader)
 
virtual mutable_buffer getData () const
 
virtual size_t getLength () const
 
void operator= (mutable_buffer b)
 
 SerializableBuffer ()
 
 SerializableBuffer (mutable_buffer data)
 
virtual Writerserialize (Writer &writer) const
 
virtual void setData (mutable_buffer data)
 
virtual ~SerializableBuffer ()
 

Private Member Functions

void deleteAllocatedBuffer ()
 

Private Attributes

char * allocated_buffer_
 
mutable_buffer data_
 

Detailed Description

Generic buffer of data that can be serialized

Definition at line 45 of file serializable_buffer.h.

Constructor & Destructor Documentation

eip::serialization::SerializableBuffer::SerializableBuffer ( )
inline

Construct an empty serializable buffer

Parameters
dataData to hold in the buffer

Definition at line 53 of file serializable_buffer.h.

eip::serialization::SerializableBuffer::SerializableBuffer ( mutable_buffer  data)
inline

Construct a serializable buffer for the given data buffer

Parameters
dataData to hold in the buffer

Definition at line 59 of file serializable_buffer.h.

virtual eip::serialization::SerializableBuffer::~SerializableBuffer ( )
inlinevirtual

Definition at line 61 of file serializable_buffer.h.

Member Function Documentation

void eip::serialization::SerializableBuffer::deleteAllocatedBuffer ( )
inlineprivate

Helper to delete an allocated buffer if needed

Definition at line 166 of file serializable_buffer.h.

virtual Reader& eip::serialization::SerializableBuffer::deserialize ( Reader reader,
size_t  length 
)
inlinevirtual

Deserialize buffer data from the given reader, up to the length given. Will use the buffer already allocated.

Parameters
readerReader to use for deserialization
lengthLength expected for data
Returns
the reader again
Exceptions
std::length_errorif the given length is greater than allocated data buffer

Implements eip::serialization::Serializable.

Definition at line 118 of file serializable_buffer.h.

virtual Reader& eip::serialization::SerializableBuffer::deserialize ( Reader reader)
inlinevirtual

Deserialize data into this buffer, using the size of the buffer already allocated

Parameters
readerReader to use for deserialization
Returns
the reader again
Exceptions
std::length_errorif the buffer is overrun while deserializing

Implements eip::serialization::Serializable.

Definition at line 148 of file serializable_buffer.h.

virtual mutable_buffer eip::serialization::SerializableBuffer::getData ( ) const
inlinevirtual

Get the data held in this buffer

Returns
current data buffer

Definition at line 80 of file serializable_buffer.h.

virtual size_t eip::serialization::SerializableBuffer::getLength ( ) const
inlinevirtual

Get the length of the current data buffer

Returns
Total length in bytes to be serialized

Implements eip::serialization::Serializable.

Definition at line 71 of file serializable_buffer.h.

void eip::serialization::SerializableBuffer::operator= ( mutable_buffer  b)
inline

Definition at line 154 of file serializable_buffer.h.

virtual Writer& eip::serialization::SerializableBuffer::serialize ( Writer writer) const
inlinevirtual

Serialize the buffer into the writer

Parameters
writerWriter to use for serialization
Returns
the writer again
Exceptions
std::length_errorif the buffer is too small for the header data

Implements eip::serialization::Serializable.

Definition at line 103 of file serializable_buffer.h.

virtual void eip::serialization::SerializableBuffer::setData ( mutable_buffer  data)
inlinevirtual

Set the data for the buffer

Parameters
dataData to assign to the buffer

Definition at line 89 of file serializable_buffer.h.

Member Data Documentation

char* eip::serialization::SerializableBuffer::allocated_buffer_
private

Definition at line 161 of file serializable_buffer.h.

mutable_buffer eip::serialization::SerializableBuffer::data_
private

Definition at line 160 of file serializable_buffer.h.


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


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Mon Jun 10 2019 14:00:16