Wolframe, 0.0.3

_Wolframe::serialize::StructSerializer Class Reference

Iterator on elements of structures based on a structure description. More...

#include <structSerializer.hpp>

Inheritance diagram for _Wolframe::serialize::StructSerializer:
_Wolframe::langbind::TypedInputFilter _Wolframe::langbind::FilterBase

Public Types

typedef boost::shared_ptr< void > ObjectReference
 
- Public Types inherited from _Wolframe::langbind::TypedInputFilter
typedef InputFilter::State State
 
- Public Types inherited from _Wolframe::langbind::FilterBase
enum  ElementType { OpenTag, Attribute, Value, CloseTag }
 Content element type that describes the role of the element in the structured input. More...
 
enum  Flags { None =0x00, SerializeWithIndices =0x01, PropagateNoCase =0x02, PropagateNoAttr =0x04 }
 

Public Member Functions

 StructSerializer (const ObjectReference &obj, const StructDescriptionBase *descr)
 Constructor. More...
 
 StructSerializer (const void *obj, const StructDescriptionBase *descr)
 Constructor. More...
 
 StructSerializer (const StructSerializer &o)
 Copy constructor. More...
 
virtual ~StructSerializer ()
 Destructor. More...
 
void init (const langbind::TypedOutputFilterR &out, serialize::Flags::Enum flags=serialize::Flags::None)
 Serialize start initialization. More...
 
void reset ()
 
bool call ()
 Call of one processing step the serializer. More...
 
virtual
langbind::TypedInputFilter
copy () const
 Get a self copy. More...
 
virtual bool getNext (langbind::FilterBase::ElementType &type, types::VariantConst &value)
 Get the next element of the serialization, implements langbind::TypedInputFilter::getNext(langbind::FilterBase::ElementType&,types::VariantConst&) More...
 
virtual bool setFlags (FilterBase::Flags f)
 Set the flags stearing the serialization, implements FilterBase::setFlags(FilterBase::Flags) More...
 
- Public Member Functions inherited from _Wolframe::langbind::TypedInputFilter
 TypedInputFilter (const char *name_)
 Constructor. More...
 
 TypedInputFilter (const TypedInputFilter &o)
 Copy constructor. More...
 
virtual ~TypedInputFilter ()
 Destructor. More...
 
State state () const
 Get the current state. More...
 
void setState (State s, const char *msg=0)
 Set input filter state with error message. More...
 
virtual void resetIterator ()
 Set the iterator to the start (if implemented) More...
 
- Public Member Functions inherited from _Wolframe::langbind::FilterBase
 FilterBase (const char *name_)
 
 FilterBase (const FilterBase &o)
 
virtual ~FilterBase ()
 
virtual const char * getError () const
 Get the las error in case of error state. More...
 
void setError (const char *msg=0)
 Set input filter error message. More...
 
bool flag (Flags f) const
 Query a flag (or a set of flags) More...
 
Flags flags () const
 Get all flags. More...
 
virtual bool setFlags (Flags f)
 Set a flag (or a set of flags) More...
 
virtual bool checkSetFlags (Flags) const
 Test if a flag can be set (allowed) More...
 
const char * name () const
 Get the name of the filter. More...
 

Static Public Member Functions

static std::string getElementPath (const SerializeStateStack &stk)
 Get the current element path defined by the stack 'stk' as string for error messages. More...
 
- Static Public Member Functions inherited from _Wolframe::langbind::FilterBase
static const char * elementTypeName (ElementType i)
 Get the name of an ElementType as string. More...
 

Private Attributes

const void * m_ptr
 
const ObjectReference m_obj
 
const StructDescriptionBasem_descr
 
Context m_ctx
 
langbind::TypedOutputFilterR m_out
 
SerializeStateStack m_stk
 

Detailed Description

Iterator on elements of structures based on a structure description.

Member Typedef Documentation

Constructor & Destructor Documentation

_Wolframe::serialize::StructSerializer::StructSerializer ( const ObjectReference obj,
const StructDescriptionBase descr 
)

Constructor.

_Wolframe::serialize::StructSerializer::StructSerializer ( const void *  obj,
const StructDescriptionBase descr 
)

Constructor.

_Wolframe::serialize::StructSerializer::StructSerializer ( const StructSerializer o)

Copy constructor.

virtual _Wolframe::serialize::StructSerializer::~StructSerializer ( )
inlinevirtual

Destructor.

Member Function Documentation

bool _Wolframe::serialize::StructSerializer::call ( )

Call of one processing step the serializer.

Remarks
The processing is finished when the call returns true. In case of false returned you have to inspect the output filter state to determine what is to do next.
Do not mix 'call()' with 'init(const langbind::TypedOutputFilterR&,serialize::Flags)' and 'getNext(langbind::FilterBase::ElementType&,types::VariantConst&)'. Use either one or the other
virtual langbind::TypedInputFilter* _Wolframe::serialize::StructSerializer::copy ( ) const
virtual

Get a self copy.

Returns
allocated pointer to copy of this

Implements _Wolframe::langbind::TypedInputFilter.

static std::string _Wolframe::serialize::StructSerializer::getElementPath ( const SerializeStateStack stk)
static

Get the current element path defined by the stack 'stk' as string for error messages.

virtual bool _Wolframe::serialize::StructSerializer::getNext ( langbind::FilterBase::ElementType type,
types::VariantConst value 
)
virtual

Get the next element of the serialization, implements langbind::TypedInputFilter::getNext(langbind::FilterBase::ElementType&,types::VariantConst&)

Remarks
Do not mix 'call()' with 'init(const langbind::TypedOutputFilterR&,serialize::Flags)' and 'getNext(langbind::FilterBase::ElementType&,types::VariantConst&)'. Use either one or the other

Implements _Wolframe::langbind::TypedInputFilter.

void _Wolframe::serialize::StructSerializer::init ( const langbind::TypedOutputFilterR out,
serialize::Flags::Enum  flags = serialize::Flags::None 
)

Serialize start initialization.

void _Wolframe::serialize::StructSerializer::reset ( )
virtual bool _Wolframe::serialize::StructSerializer::setFlags ( FilterBase::Flags  f)
virtual

Set the flags stearing the serialization, implements FilterBase::setFlags(FilterBase::Flags)

Returns
false, if not all flags have the behaviour implemented and are accepted

Member Data Documentation

Context _Wolframe::serialize::StructSerializer::m_ctx
private
const StructDescriptionBase* _Wolframe::serialize::StructSerializer::m_descr
private
const ObjectReference _Wolframe::serialize::StructSerializer::m_obj
private
langbind::TypedOutputFilterR _Wolframe::serialize::StructSerializer::m_out
private
const void* _Wolframe::serialize::StructSerializer::m_ptr
private
SerializeStateStack _Wolframe::serialize::StructSerializer::m_stk
private

The documentation for this class was generated from the following file: