Wolframe, 0.0.3

_Wolframe::serialize::StructDescription< Structure > Class Template Reference

Intrusive description of a filter/form map. More...

#include <structDescription.hpp>

Inheritance diagram for _Wolframe::serialize::StructDescription< Structure >:
_Wolframe::serialize::StructDescriptionBase

Public Member Functions

 StructDescription ()
 Constructor. More...
 
template<typename Element >
StructDescriptionoperator() (const char *tag, Element Structure::*eptr)
 Operator to build the structure description element by element. More...
 
StructDescriptionmandatory ()
 Define the last structure element defined to be mandatory always (independent of validation mode) More...
 
StructDescriptionoptional ()
 Define the last structure element defined to be optional always (independent of validation mode) More...
 
StructDescriptionoperator-- (int)
 Define the elements defined until now to be attributes and the subsequent elements defined to be content elements (e.g. for XML validation). By default all elements are content elements. More...
 
- Public Member Functions inherited from _Wolframe::serialize::StructDescriptionBase
Parse parse () const
 Non intrusive parser call function of this sructure. More...
 
Fetch fetch () const
 Non intrusive serializer call (fetch the next element) function of this sructure. More...
 
 StructDescriptionBase (Constructor c, Destructor d, const char *tn, std::size_t os, std::size_t sz, ElementType t, Parse pa, Fetch pr, ElementRequirement req_)
 Constructor. More...
 
 StructDescriptionBase (const char *tn, std::size_t os, std::size_t sz, ElementType t, Parse pa, Fetch pr, ElementRequirement req_)
 Constructor. More...
 
 StructDescriptionBase (const StructDescriptionBase &o)
 Copy constructor. More...
 
 StructDescriptionBase ()
 Default constructor. More...
 
bool parse (void *obj, langbind::TypedInputFilter &in, Context &ctx, ParseStateStack &stk) const
 Call of parser of the serialization passed to fill an object and validate the serialization sequence. More...
 
bool setAtomicValue (void *obj, std::size_t idx, const std::string &value) const
 Initializes an atomic element in a structure. More...
 
bool init (void *obj) const
 Initialize the structure referenced with 'obj'. More...
 
void done (void *obj) const
 Destroy the structure referenced with 'obj'. More...
 
std::size_t size () const
 Get the allocation size of this structure in bytes. More...
 
std::size_t ofs () const
 Get the offset of this structure inside the holding parent structure. More...
 
ElementType type () const
 Get the element kind (type of access) of this structure or atomic element. More...
 
Map::const_iterator find (const std::string &name) const
 Find an element in this structure by name. More...
 
Map::const_iterator find_cis (const std::string &name) const
 Case insensitive find an element in this structure by name. More...
 
std::string names (const char *sep) const
 Return the element names of this structure as string for error messages. More...
 
Map::const_iterator begin () const
 Get the start iterator on the elements of this structure. More...
 
Map::const_iterator end () const
 Get the end iterator on the elements of this structure. More...
 
void define (const std::string &name, const StructDescriptionBase &dd)
 Define an element of this structure. More...
 
std::size_t nof_attributes () const
 Get the number of attributes of a struct. More...
 
void defineEndOfAttributes ()
 Define the number of attributes of a struct. More...
 
std::size_t nof_elements () const
 Get the number of elements in the structure or array. More...
 
const char * typeName () const
 Get the type name of this structure. More...
 
bool mandatory () const
 Find out if the element in the structure is mandatory. More...
 
bool optional () const
 Find out if the element in the structure is optional. More...
 
void requirement (ElementRequirement requirement_)
 Set element occurrence requirement. More...
 

Static Public Member Functions

static bool constructor (void *obj)
 Construct an object of this kind at an allocated location (with base pointer 'obj') More...
 
static void destructor (void *obj)
 Destroy an object of this kind allocated with 'constructor(void*)' at the location 'obj'. More...
 
template<class Element >
static const char * getTypename ()
 Get the name of the type 'Element' if available. More...
 

Additional Inherited Members

- Public Types inherited from _Wolframe::serialize::StructDescriptionBase
enum  ElementType { Atomic, Struct, Vector }
 Type of a structure element. More...
 
enum  ElementRequirement { NoRequirement, Mandatory, Optional }
 Constraints definition of a structure element. More...
 
typedef std::vector< std::pair
< std::string,
StructDescriptionBase > > 
Map
 
typedef bool(* Parse )(langbind::TypedInputFilter &flt, Context &ctx, ParseStateStack &stk)
 
typedef bool(* Fetch )(Context &ctx, SerializeStateStack &stk)
 
typedef bool(* Constructor )(void *obj)
 
typedef void(* Destructor )(void *obj)
 
- Protected Member Functions inherited from _Wolframe::serialize::StructDescriptionBase
StructDescriptionBaselast ()
 

Detailed Description

template<class Structure>
class _Wolframe::serialize::StructDescription< Structure >

Intrusive description of a filter/form map.

Template Parameters
Structurestructure that is represented by this description

Constructor & Destructor Documentation

template<class Structure >
_Wolframe::serialize::StructDescription< Structure >::StructDescription ( )
inline

Constructor.

Member Function Documentation

template<class Structure >
static bool _Wolframe::serialize::StructDescription< Structure >::constructor ( void *  obj)
inlinestatic

Construct an object of this kind at an allocated location (with base pointer 'obj')

create operator new for Structure on an already allocated chunk to call it's constructor

template<class Structure >
static void _Wolframe::serialize::StructDescription< Structure >::destructor ( void *  obj)
inlinestatic

Destroy an object of this kind allocated with 'constructor(void*)' at the location 'obj'.

template<class Structure >
template<class Element >
static const char* _Wolframe::serialize::StructDescription< Structure >::getTypename ( )
inlinestatic

Get the name of the type 'Element' if available.

template<class Structure >
StructDescription& _Wolframe::serialize::StructDescription< Structure >::mandatory ( )
inline

Define the last structure element defined to be mandatory always (independent of validation mode)

template<class Structure >
template<typename Element >
StructDescription& _Wolframe::serialize::StructDescription< Structure >::operator() ( const char *  tag,
Element Structure::*  eptr 
)
inline

Operator to build the structure description element by element.

Template Parameters
Elementelement type
Parameters
[in]tagname of the element
[in]eptrpointer to member of the element
template<class Structure >
StructDescription& _Wolframe::serialize::StructDescription< Structure >::operator-- ( int  )
inline

Define the elements defined until now to be attributes and the subsequent elements defined to be content elements (e.g. for XML validation). By default all elements are content elements.

template<class Structure >
StructDescription& _Wolframe::serialize::StructDescription< Structure >::optional ( )
inline

Define the last structure element defined to be optional always (independent of validation mode)


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