File Information
Library: RemotingNG
Package: Serialization
Header: Poco/RemotingNG/SerializerBase.h
Description
SerializerBase is the common base class for Serializer and Deserializer.
This class provides common definitions and member functions for Serializer and Deserializer classes, most importantly properties management.
Properties allow a TypeSerializer or other classes using a Serializer or Deserializer to send additional (meta-)information to the Serializer (or Deserializer), for example XML namespace information for XML elements.
Properties are managed in a stacks -- a separate stack is maintained for every property identified by a name. Users of Serializer and Deserializer classes can push property values onto a stack before serializing a certain object or message, and pop properties from the stack when serialization is completed.
Inheritance
Known Derived Classes: Poco::RemotingNG::REST::FormDeserializer, Poco::RemotingNG::REST::RawSerializer, Poco::RemotingNG::SOAP::Deserializer, Poco::UPnP::GENA::Serializer, Poco::RemotingNG::REST::ScalarDeserializer, Serializer, BinaryDeserializer, Deserializer, Poco::UPnP::GENA::Deserializer, Poco::RemotingNG::JSONRPC::Deserializer, Poco::RemotingNG::REST::ScalarSerializer, Poco::JS::Bridge::TaggedBinarySerializer, Poco::RemotingNG::REST::FormSerializer, Poco::RemotingNG::REST::HeaderSerializer, Poco::RemotingNG::REST::PathSerializer, Poco::RemotingNG::SOAP::Serializer, Poco::RemotingNG::REST::Serializer, Poco::RemotingNG::REST::RawDeserializer, Poco::UPnP::SOAP::Deserializer, Poco::JS::Bridge::Deserializer, Poco::RemotingNG::REST::JSONSerializer, BinarySerializer, Poco::RemotingNG::JSONRPC::Serializer, Poco::RemotingNG::REST::HeaderDeserializer, Poco::RemotingNG::REST::PathDeserializer, Poco::UPnP::SOAP::Serializer, Poco::RemotingNG::REST::JSONDeserializer, Poco::JS::Bridge::Serializer, Poco::RemotingNG::REST::Deserializer
Member Summary
Member Functions: clearProperties, getProperty, hasProperty, popProperty, pushProperty, reset, resetImpl
Enumerations
MessageType
Constructors
SerializerBase
Creates a Serializer.
Destructor
~SerializerBase
virtual ~SerializerBase();
Destroys the Serializer.
Member Functions
getProperty
const std::string & getProperty(
const std::string & name
) const;
Gets the property with the given name from its stack.
Throws an exception if the stack is empty.
getProperty
const std::string & getProperty(
const std::string & name,
const std::string & deflt
) const;
Gets the property with the given name from its stack. Returns the default value if the stack is empty.
Warning: Since this method may return a const reference to the default value, the caller must make sure not to pass a temporary object as default value.
hasProperty
bool hasProperty(
const std::string & name
) const;
Returns true if a property with the given name exists.
popProperty
void popProperty(
const std::string & name
);
Pops a property value from its stack.
Throws an exception if the property stack is empty or does not exist.
pushProperty
void pushProperty(
const std::string & name,
const std::string & value
);
Pushes a property value onto the stack for the property with the given name.
reset
void reset();
Resets the Serializer or Deserializer to a clean state.
clearProperties
void clearProperties();
Clears all properties.
resetImpl
virtual void resetImpl() = 0;
Resets the serializer. Must be implemented by subclasses.
Variables
PROP_ACTION
static const std::string PROP_ACTION;
PROP_CONSUMES
static const std::string PROP_CONSUMES;
PROP_CONTENT_TYPE
static const std::string PROP_CONTENT_TYPE;
PROP_FAULT
static const std::string PROP_FAULT;
PROP_FORMAT
static const std::string PROP_FORMAT;
PROP_HEADER
static const std::string PROP_HEADER;
PROP_LENGTH
static const std::string PROP_LENGTH;
PROP_LOCATION
static const std::string PROP_LOCATION;
PROP_NAMESPACE
static const std::string PROP_NAMESPACE;
PROP_PATH
static const std::string PROP_PATH;
PROP_PRODUCES
static const std::string PROP_PRODUCES;
PROP_REPLY
static const std::string PROP_REPLY;
PROP_REQUEST
static const std::string PROP_REQUEST;
PROP_XSDTYPE
static const std::string PROP_XSDTYPE;
RETURN_PARAM
static const std::string RETURN_PARAM;
The element name used to serialize a function's return value.