| |
libFAUDES
Sections
Index
|
faudes::FunctionDefinition Class Reference |
Public Member Functions | |
FunctionDefinition (const std::string &name="") | |
Constructor. | |
virtual | ~FunctionDefinition () |
Destructor. | |
void | Clear (void) |
Clear documentation-data and signature (keep prototype). | |
void | MergeDocumentationBody (TokenReader &rTr) |
Merge documentation and signatures from token stream. | |
const Function * | Prototype (void) const |
Return pointer to function object prototype. | |
Function * | NewFunction () const |
Construct function on heap. | |
int | VariantsSize (void) const |
Return number of supported Signature instances. | |
bool | ExistsVariant (const std::string &varname) const |
Test existence of variant by its name. | |
const Signature & | Variant (const std::string &rName) const |
Return reference to Signature by name. | |
const Signature & | Variant (int n) const |
Return reference to Signature by index. | |
Static Public Member Functions | |
template<class T> | |
static FunctionDefinition * | Constructor (const std::string &rFunctName="") |
Construct empty FunctionDefinition object. | |
template<class T> | |
static FunctionDefinition * | FromFile (const std::string &rFileName) |
Construct FunctionDefinition object and get name and docu from file. | |
Protected Member Functions | |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Read configuration data of this object from TokenReader. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write configuration data of this object to TokenWriter. | |
void | AppendVariant (const Signature &pVar) |
Add Signature to function definition. | |
FunctionDefinition (const FunctionDefinition &rOther) | |
Disable Copy Constructor. | |
void | Prototype (Function *pFunc) |
Assign prototype object. | |
Protected Attributes | |
Function * | mpFunction |
Prototype instance. | |
std::vector< faudes::Signature > | mVariants |
Vector containing all supported Signatures. | |
std::map< std::string, int > | mVariantIndexMap |
Variant name to index map. |
faudes::FunctionDefinition::FunctionDefinition | ( | const std::string & | name = "" |
) | [inline] |
Constructor.
The default constructor instantiates an invalid function definition without prototype. To construct a valid type definition, use the static Constructor() template function.
virtual faudes::FunctionDefinition::~FunctionDefinition | ( | ) | [inline, virtual] |
Destructor.
faudes::FunctionDefinition::FunctionDefinition | ( | const FunctionDefinition & | rOther | ) | [inline, protected] |
Disable Copy Constructor.
FunctionDefinition * faudes::FunctionDefinition::Constructor | ( | const std::string & | rFunctName = "" |
) | [inline, static] |
Construct empty FunctionDefinition object.
The given template parameter denotes a Function class. Member variable (mpFunction) is set to a new instance of that class whereas the name is set as specified. No further documentation or signatures are recorded.
T | Actual function class, derived from Function |
rFunctName | Name to identify this faudes-function |
FunctionDefinition * faudes::FunctionDefinition::FromFile | ( | const std::string & | rFileName | ) | [inline, static] |
Construct FunctionDefinition object and get name and docu from file.
The member variable mpFunction is set to a new instance of class T. which must be derived from Function. The function name, any documentation as well as supported signatures are read from the specified file.
T | Actual function class, derived from Function |
rFileName | File to read documentation and signatures from. |
void faudes::FunctionDefinition::Clear | ( | void | ) | [virtual] |
void faudes::FunctionDefinition::MergeDocumentationBody | ( | TokenReader & | rTr | ) |
Merge documentation and signatures from token stream.
This member reads the body of the FunctionDefinition token format and sets the function name, any further documentation and the supported signatures accordingly. An exception is thrown if the current function name differs from the one in the documentation.
rTr | TokenReader to read from. |
const Function * faudes::FunctionDefinition::Prototype | ( | void | ) | const |
Return pointer to function object prototype.
Note: this method is meant for inspection only, control over the prototype remains with the FunctionDefinition. Use NewFunction() to instantiate a new function object.
Function * faudes::FunctionDefinition::NewFunction | ( | ) | const |
int faudes::FunctionDefinition::VariantsSize | ( | void | ) | const |
bool faudes::FunctionDefinition::ExistsVariant | ( | const std::string & | varname | ) | const |
Test existence of variant by its name.
const Signature & faudes::FunctionDefinition::Variant | ( | const std::string & | rName | ) | const |
const Signature & faudes::FunctionDefinition::Variant | ( | int | n | ) | const |
void faudes::FunctionDefinition::DoRead | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Read configuration data of this object from TokenReader.
The section is hardcode to "FunctionDefinition", context ignored.
rTr | TokenReader to read from | |
rLabel | Section to read | |
pContext | Read context to provide contextual information (ignored) |
Exception |
|
Reimplemented from faudes::Documentation.
void faudes::FunctionDefinition::DoWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write configuration data of this object to TokenWriter.
The section is hardcode to "FunctionDefinition", context ignored.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::Documentation.
void faudes::FunctionDefinition::AppendVariant | ( | const Signature & | pVar | ) | [protected] |
void faudes::FunctionDefinition::Prototype | ( | Function * | pFunc | ) | [protected] |
Function* faudes::FunctionDefinition::mpFunction [protected] |
Prototype instance.
std::vector<faudes::Signature> faudes::FunctionDefinition::mVariants [protected] |
Vector containing all supported Signatures.
std::map<std::string,int> faudes::FunctionDefinition::mVariantIndexMap [protected] |
Variant name to index map.
libFAUDES 2.13a c++ source docu by doxygen 1.5.6