MapModule Class Reference

Practical module implementation object using maps to generate parsers and functions. More...

#include <mapmodule.h>

Inherits Module.

List of all members.

Protected Types

typedef std::function< Parser
*(const ObjectType &, Object
&, const Module &)> 
ParserGenerator
typedef std::function< int64_t(const
ObjectType &, const Module &)> 
FixedSizeGenerator
typedef std::function
< Variable(Scope &, const
Module &)> 
Functor

Protected Member Functions

virtual ~MapModule ()
void addParser (const std::string &name, const ParserGenerator &parserGenerator)
 Define a parser generator for the type template with this name.
void addParser (const std::string &name)
 Define a null parser generator for the type template with this name.
void setFixedSize (const std::string &name, const FixedSizeGenerator &fixedSizeFunction)
 Define a function to compute the fixed size for the types of the type template with this name.
void setFixedSize (const std::string &name, int64_t fixedSize)
 Define a fixed size for all types of the type template with this name.
void setFixedSizeFromArg (const std::string &name, int arg)
 Link size for all types of the type template with this name with one of the arguments (.
void addFunction (const std::string &name, const std::vector< std::string > &parameterNames, const std::vector< bool > &parameterModifiables, const std::vector< Variant > &parameterDefaults, const Functor &functor)
 Define a function signature and define a functor to execute the function.

Detailed Description

Practical module implementation object using maps to generate parsers and functions.


Member Typedef Documentation

typedef std::function<int64_t (const ObjectType &, const Module &)> MapModule::FixedSizeGenerator [protected]
typedef std::function<Variable (Scope&, const Module &)> MapModule::Functor [protected]
typedef std::function<Parser* (const ObjectType &, Object &, const Module &)> MapModule::ParserGenerator [protected]

Constructor & Destructor Documentation

virtual MapModule::~MapModule ( ) [inline, protected, virtual]

Member Function Documentation

void MapModule::addFunction ( const std::string &  name,
const std::vector< std::string > &  parameterNames,
const std::vector< bool > &  parameterModifiables,
const std::vector< Variant > &  parameterDefaults,
const Functor functor 
) [protected]

Define a function signature and define a functor to execute the function.

void MapModule::addParser ( const std::string &  name,
const ParserGenerator parserGenerator 
) [protected]

Define a parser generator for the type template with this name.

void MapModule::addParser ( const std::string &  name) [protected]

Define a null parser generator for the type template with this name.

void MapModule::setFixedSize ( const std::string &  name,
const FixedSizeGenerator fixedSizeFunction 
) [protected]

Define a function to compute the fixed size for the types of the type template with this name.

void MapModule::setFixedSize ( const std::string &  name,
int64_t  fixedSize 
) [protected]

Define a fixed size for all types of the type template with this name.

void MapModule::setFixedSizeFromArg ( const std::string &  name,
int  arg 
) [protected]

Link size for all types of the type template with this name with one of the arguments (.

For instance the size of an integer is given by the first argument : int(16), int(32), int(64)...


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