Library: RemotingNG
Package: Serialization
Header: Poco/RemotingNG/Serializer.h
The Serializer interface for transports.
Implementations of the Serializer interface must handle serialization of various message types (request, response, events), as well as basic types. Serialization of complex types is implemented by providing specializations of the TypeSerializer class template.
Direct Base Classes: SerializerBase
All Base Classes: SerializerBase
Known Derived Classes: BinarySerializer, Poco::UPnP::GENA::Serializer, Poco::UPnP::SOAP::Serializer
Member Functions: serialize, serializeFaultMessage, serializeMessageBegin, serializeMessageEnd, serializeNullableBegin, serializeNullableEnd, serializeSequenceBegin, serializeSequenceEnd, serializeStructBegin, serializeStructEnd, setup, setupImpl
Inherited Functions: clearProperties, getProperty, hasProperty, popProperty, pushAttribute, pushProperty, reset, resetImpl
Serializer();
Creates a Serializer.
virtual ~Serializer();
Destroys the Serializer.
virtual void serialize(
const std::string & name,
Poco::Int8 value
) = 0;
Serialize an Int8.
virtual void serialize(
const std::string & name,
Poco::UInt8 value
) = 0;
Serialize an UInt8.
virtual void serialize(
const std::string & name,
Poco::Int16 value
) = 0;
Serialize an Int16.
virtual void serialize(
const std::string & name,
Poco::UInt16 value
) = 0;
Serialize an UInt16.
virtual void serialize(
const std::string & name,
Poco::Int32 value
) = 0;
Serialize an Int32.
virtual void serialize(
const std::string & name,
Poco::UInt32 value
) = 0;
Serialize an UInt32.
virtual void serialize(
const std::string & name,
long value
) = 0;
Serialize a long.
virtual void serialize(
const std::string & name,
unsigned long value
) = 0;
Serialize an unsigned long.
virtual void serialize(
const std::string & name,
bool value
) = 0;
Serialize a boolean.
virtual void serialize(
const std::string & name,
float value
) = 0;
Serialize a float.
virtual void serialize(
const std::string & name,
double value
) = 0;
Serialize a double.
virtual void serialize(
const std::string & name,
char value
) = 0;
Serialize a single character.
virtual void serialize(
const std::string & name,
const std::string & value
) = 0;
Serialize a std::string.
virtual void serialize(
const std::string & name,
const std::vector < char > & value
) = 0;
Serialize binary data.
virtual void serializeFaultMessage(
const std::string & name,
Poco::Exception & exc
) = 0;
Serialize an exception message.
virtual void serializeMessageBegin(
const std::string & name,
SerializerBase::MessageType type
) = 0;
Begin serialization of a message.
virtual void serializeMessageEnd(
const std::string & name,
SerializerBase::MessageType type
) = 0;
End serialization of a message.
virtual void serializeNullableBegin(
const std::string & name,
bool isNull
) = 0;
Begin serialization of a Nullable or pointer which may be NULL.
If isNull is true, the call to serializeNullableBegin() must be immediately followed by a call to serializeNullableEnd().
virtual void serializeNullableEnd(
const std::string & name
) = 0;
End serialization of a Nullable or pointer which may be NULL.
virtual void serializeSequenceBegin(
const std::string & name,
Poco::UInt32 length
) = 0;
Begin serialization of a vector or other sequence.
Length contains the number of elements in the sequence.
virtual void serializeSequenceEnd(
const std::string & name
) = 0;
End serialization of a vector.
virtual void serializeStructBegin(
const std::string & name
) = 0;
Begin serialization of a complex (structured) object.
virtual void serializeStructEnd(
const std::string & name
) = 0;
End serialization of a complex (structured) object.
void setup(
std::ostream & ostr
);
Set up the Serializer for writing to the given output stream.
This must be called before any of the serialize*() methods.
virtual void setupImpl(
std::ostream & ostr
) = 0;
Set up the Serializer for writing to the given output stream.
It is guaranteed that reset was called prior to calling this method so the Serializer is in a clean state.