| |
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. | |
int | VariantIndex (const std::string &rName) const |
Return index of Signature by 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.
Definition at line 334 of file rtifncts.h.
virtual faudes::FunctionDefinition::~FunctionDefinition | ( | ) | [inline, virtual] |
faudes::FunctionDefinition::FunctionDefinition | ( | const FunctionDefinition & | rOther | ) | [inline, protected] |
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 |
Definition at line 885 of file rtifncts.h.
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. |
Definition at line 902 of file rtifncts.h.
void faudes::FunctionDefinition::Clear | ( | void | ) | [virtual] |
Clear documentation-data and signature (keep prototype).
Reimplemented from faudes::Documentation.
Definition at line 162 of file rtifncts.cpp.
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. |
Definition at line 253 of file rtifncts.cpp.
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.
Definition at line 172 of file rtifncts.cpp.
Function * faudes::FunctionDefinition::NewFunction | ( | ) | const |
Construct function on heap.
Return pointer to new instance of assigned Function class.
Note: If no prototype is installed, NULL is returned.
Definition at line 189 of file rtifncts.cpp.
int faudes::FunctionDefinition::VariantsSize | ( | void | ) | const |
Return number of supported Signature instances.
Definition at line 197 of file rtifncts.cpp.
bool faudes::FunctionDefinition::ExistsVariant | ( | const std::string & | varname | ) | const |
Test existence of variant by its name.
Definition at line 202 of file rtifncts.cpp.
int faudes::FunctionDefinition::VariantIndex | ( | const std::string & | rName | ) | const |
Return index of Signature by name.
rName | Name of signature to search. |
Definition at line 207 of file rtifncts.cpp.
const Signature & faudes::FunctionDefinition::Variant | ( | const std::string & | rName | ) | const |
Return reference to Signature by name.
rName | Name of signature to search. |
Exception |
|
Definition at line 229 of file rtifncts.cpp.
const Signature & faudes::FunctionDefinition::Variant | ( | int | n | ) | const |
Return reference to Signature by index.
n | Index to look up |
Exception |
|
Definition at line 241 of file rtifncts.cpp.
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.
Definition at line 308 of file rtifncts.cpp.
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.
Definition at line 329 of file rtifncts.cpp.
void faudes::FunctionDefinition::AppendVariant | ( | const Signature & | pVar | ) | [protected] |
void faudes::FunctionDefinition::Prototype | ( | Function * | pFunc | ) | [protected] |
Assign prototype object.
pFunc | Function instance |
Definition at line 177 of file rtifncts.cpp.
Function* faudes::FunctionDefinition::mpFunction [protected] |
std::vector<faudes::Signature> faudes::FunctionDefinition::mVariants [protected] |
std::map<std::string,int> faudes::FunctionDefinition::mVariantIndexMap [protected] |
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6