Composer Class Referenceabstract

#include <Pt/Composer.h>

Composes types during serialization.

Inherited by BasicComposer< A1 >, BasicComposer< A10 >, BasicComposer< A2 >, BasicComposer< A3 >, BasicComposer< A4 >, BasicComposer< A5 >, BasicComposer< A6 >, BasicComposer< A7 >, BasicComposer< A8 >, BasicComposer< A9 >, BasicComposer< Pt::XmlRpc::Fault >, BasicComposer< R >, BasicComposer< V1 >, BasicComposer< V10 >, BasicComposer< V2 >, BasicComposer< V3 >, BasicComposer< V4 >, BasicComposer< V5 >, BasicComposer< V6 >, BasicComposer< V7 >, BasicComposer< V8 >, BasicComposer< V9 >, and BasicComposer< T >.

Public Member Functions

virtual ~Composer ()
 Destructor.
 
ComposerbeginDictElement ()
 Begins composition of a dict key. More...
 
ComposerbeginDictKey ()
 Begins composition of a dict key.
 
ComposerbeginDictValue ()
 Begins composition of a dict value.
 
ComposerbeginElement ()
 Begins composition of a sequence member.
 
ComposerbeginMember (const std::string &name)
 Begins composition of a struct member.
 
ComposerbeginMember (const char *name, std::size_t len)
 Begins composition of a struct member.
 
Composerfinish ()
 Finishes composition of a struct or sequence member.
 
Composerparent () const
 Returns the parent composer.
 
void setBinary (const char *data, std::size_t length)
 Composes a binary value.
 
void setBool (bool value)
 Composes a boolean value.
 
void setChar (const Pt::Char &ch)
 Composes a char value.
 
void setFloat (long double value)
 Composes a float value.
 
void setId (const std::string &id)
 Sets the reference id of the type to compose. More...
 
void setId (const char *id, std::size_t len)
 Sets the reference id of the type to compose. More...
 
void setInt (Pt::int64_t value)
 Composes a signed integer type. More...
 
void setParent (Composer *parent)
 Sets the parent composer.
 
void setReference (const std::string &id)
 Composes a reference.
 
void setReference (const char *id, std::size_t len)
 Composes a reference.
 
void setString (const Pt::String &value)
 Composes a string value.
 
void setString (const Pt::Char *value, std::size_t len)
 Composes a string value.
 
void setTypeName (const std::string &type)
 Sets the type name of the type to compose. More...
 
void setTypeName (const char *type, std::size_t len)
 Sets the type name of the type to compose. More...
 
void setUInt (Pt::int64_t value)
 Composes an unsigned integer type. More...
 

Protected Member Functions

 Composer ()
 Constructor.
 
virtual ComposeronBeginDictElement ()
 Begins composition of a dict key.
 
virtual ComposeronBeginDictKey ()
 Begins composition of a dict key.
 
virtual ComposeronBeginDictValue ()
 Begins composition of a dict value.
 
virtual ComposeronBeginElement ()
 Begins composition of a sequence member.
 
virtual ComposeronBeginMember (const char *, std::size_t)
 Begin composition os a struct member.
 
virtual ComposeronFinish ()
 Finishes composition of a struct or sequence member.
 
virtual void onSetBinary (const char *, std::size_t)
 Compose a binary value.
 
virtual void onSetBool (bool)
 Compose a bool value.
 
virtual void onSetChar (const Pt::Char &)
 Compose a character value.
 
virtual void onSetFloat (long double)
 Compose a floating point value.
 
virtual void onSetId (const char *id, std::size_t len)=0
 Set reference ID.
 
virtual void onSetInt (Pt::int64_t)
 Compose a integer value.
 
virtual void onSetReference (const char *, std::size_t)
 Compose a reference.
 
virtual void onSetString (const Pt::Char *, std::size_t)
 Compose a string value.
 
virtual void onSetTypeName (const char *, std::size_t)
 Set type name.
 
virtual void onSetUInt (Pt::uint64_t)
 Compose a unsigned integer value.
 

Member Function Documentation

void setTypeName ( const std::string &  type)

This is only supported by formats that save typename information.

void setTypeName ( const char *  type,
std::size_t  len 
)

This is only supported by formats that save typename information.

void setId ( const std::string &  id)

This is only supported by formats that support references.

void setId ( const char *  id,
std::size_t  len 
)

This is only supported by formats that support references.

void setInt ( Pt::int64_t  value)

There is only one method for all sizes of signed integer types, because that type information is not required for composition.

void setUInt ( Pt::int64_t  value)

There is only one method for all sizes of unsigned integer types, because that type information is not required for composition.

Composer* beginDictElement ( )

Returns a composer for the key of the dict element. A subsequent call of beginDictValue returns a composer to the value of the dict element. For both finish() has to be called, after the value was completely composed.