Poco::RemotingNG

class BinarySerializer

Library: RemotingNG
Package: Serialization
Header: Poco/RemotingNG/BinarySerializer.h

Description

A generic Serializer using a proprietary binary serialization format based on the Poco::BinaryWriter class.

This class can be used by all Transport implementations using a binary serialization format that does not need to be interoperable with other network protocols.

This serializer uses a Poco::BinaryWriter for serializing data in binary form. Data is always written in the host's native endian format. To allow the deserializer finding out the endianess used by the serializer, a byte order mark is written at the beginning of the message.

Messages created by the BinarySerializer are not self describing and contain only minimal measures for detecting deserialization failures or message version incompatibilities.

Inheritance

Direct Base Classes: Serializer

All Base Classes: Serializer, SerializerBase

Member Summary

Member Functions: resetImpl, serialize, serializeEndPoint, serializeFaultMessage, serializeMessageBegin, serializeMessageEnd, serializeNullableBegin, serializeNullableEnd, serializeSequenceBegin, serializeSequenceEnd, serializeStructBegin, serializeStructEnd, serializeToken, setupImpl

Inherited Functions: clearProperties, getProperty, hasProperty, popProperty, pushAttribute, pushProperty, registerNamespace, reset, resetImpl, serialize, serializeFaultMessage, serializeMessageBegin, serializeMessageEnd, serializeNullableBegin, serializeNullableEnd, serializeOptionalBegin, serializeOptionalEnd, serializeSequenceBegin, serializeSequenceEnd, serializeStructBegin, serializeStructEnd, setup, setupImpl

Enumerations

MessageCode protected

MESSAGE_CODE_REQUEST = 0x01

MESSAGE_CODE_EVENT = 0x02

MESSAGE_CODE_REPLY = 0x11

MESSAGE_CODE_EVENT_REPLY = 0x12

MESSAGE_CODE_FAULT = 0x18

Constructors

BinarySerializer

BinarySerializer();

Creates a BinarySerializer.

Destructor

~BinarySerializer virtual

~BinarySerializer();

Destroys the BinarySerializer.

Member Functions

serialize virtual

void serialize(
    const std::string & name,
    Poco::Int8 value
);

serialize virtual

void serialize(
    const std::string & name,
    Poco::UInt8 value
);

serialize virtual

void serialize(
    const std::string & name,
    Poco::Int16 value
);

serialize virtual

void serialize(
    const std::string & name,
    Poco::UInt16 value
);

serialize virtual

void serialize(
    const std::string & name,
    Poco::Int32 value
);

serialize virtual

void serialize(
    const std::string & name,
    Poco::UInt32 value
);

serialize virtual

void serialize(
    const std::string & name,
    long value
);

serialize virtual

void serialize(
    const std::string & name,
    unsigned long value
);

serialize virtual

void serialize(
    const std::string & name,
    float value
);

serialize virtual

void serialize(
    const std::string & name,
    double value
);

serialize virtual

void serialize(
    const std::string & name,
    bool value
);

serialize virtual

void serialize(
    const std::string & name,
    char value
);

serialize virtual

void serialize(
    const std::string & name,
    const std::string & value
);

serialize virtual

void serialize(
    const std::string & name,
    const std::vector < char > & value
);

serializeEndPoint

void serializeEndPoint(
    const std::string & oid,
    const std::string & tid
);

Serializes the object and type ID of the service object.

serializeFaultMessage virtual

void serializeFaultMessage(
    const std::string & name,
    Poco::Exception & exc
);

serializeMessageBegin virtual

void serializeMessageBegin(
    const std::string & name,
    SerializerBase::MessageType type
);

serializeMessageEnd virtual

void serializeMessageEnd(
    const std::string & name,
    SerializerBase::MessageType type
);

serializeNullableBegin virtual

void serializeNullableBegin(
    const std::string & name,
    bool isNull
);

serializeNullableEnd virtual

void serializeNullableEnd(
    const std::string & name
);

serializeSequenceBegin virtual

void serializeSequenceBegin(
    const std::string & name,
    Poco::UInt32 length
);

serializeSequenceEnd virtual

void serializeSequenceEnd(
    const std::string & name
);

serializeStructBegin virtual

void serializeStructBegin(
    const std::string & name
);

serializeStructEnd virtual

void serializeStructEnd(
    const std::string & name
);

serializeToken inline

template < typename T > void serializeToken(
    T t
);

Serializes the given value, which must be a type directly supported by Poco::BinaryWriter.

resetImpl protected virtual

void resetImpl();

setupImpl protected virtual

void setupImpl(
    std::ostream & ostr
);

Variables

MESSAGE_END_TAG protected static

static const std::string MESSAGE_END_TAG;

MESSAGE_START_TAG protected static

static const std::string MESSAGE_START_TAG;