BasicComposer< T > Class Template Reference

#include <Pt/Composer.h>

Manages the composition of types during serialization.

Inherits Composer.

Public Member Functions

 BasicComposer (SerializationContext *context=0)
 Construct with context.
 
void begin (T &type)
 Begin composing a type.
 
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

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

Member Function Documentation

void setTypeName ( const std::string &  type)
inherited

This is only supported by formats that save typename information.

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

This is only supported by formats that save typename information.

void setId ( const std::string &  id)
inherited

This is only supported by formats that support references.

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

This is only supported by formats that support references.

void setInt ( Pt::int64_t  value)
inherited

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)
inherited

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

Composer* beginDictElement ( )
inherited

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.