| |
libFAUDES
Sections
Index
|
faudes::FunctionRegistry Class Reference |
Public Types | |
typedef std::map< std::string, FunctionDefinition * > ::const_iterator | Iterator |
Convenience typedef to access registry entries. | |
Public Member Functions | |
void | Clear () |
Clear all registered function definitions. | |
int | Size () const |
Return number of registered function definitions. | |
bool | Exists (const std::string &rName) const |
Test existence of a faudes-function by its name. | |
bool | Exists (const Function &rFunction) const |
Test existence of a faudes-function by faudes object. | |
Iterator | Begin (void) const |
STL interator to the internal function-name map. | |
Iterator | End (void) const |
STL interator to the internal function-name map. | |
void | Insert (FunctionDefinition *pFunctionDef) |
Add another function definition to the registry. | |
template<class T> | |
void | Insert (const std::string &rFunctionName="") |
Register a faudes-function with specified function name. | |
void | MergeDocumentation (TokenReader &rTr) |
Scan token input for function documentation. | |
void | MergeDocumentation (const std::string &rFileName) |
Scan file for function documentation. | |
Function * | NewFunction (const std::string &rFunctionName) const |
Construct a faudes object by function name. | |
Function * | NewFunction (const Function &rFunction) const |
Construct a faudes object by protofunction object. | |
const FunctionDefinition & | Definition (const std::string &rFunctionName) const |
Look up the function definition by faudes-function name. | |
const FunctionDefinition & | Definition (const Function &rFunction) const |
Look up the function definition by faudes object. | |
Static Public Member Functions | |
static FunctionRegistry * | G () |
Method to access the single global instance of the registry. | |
Protected Types | |
typedef std::map< std::string, FunctionDefinition * > ::iterator | iterator |
Convenience typedef to access registry entries. | |
Protected Member Functions | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write registry data of this to TokenWriter. | |
FunctionRegistry () | |
Constructor. | |
virtual | ~FunctionRegistry () |
Destructor. | |
Protected Attributes | |
std::map< std::string, FunctionDefinition * > | mNameToFunctionDef |
Map to associate labels and faudes::FunctionDefinitions. | |
std::map< std::string, FunctionDefinition * > | mIdToFunctionDef |
Static Protected Attributes | |
static FunctionRegistry * | mpInstance = 0 |
Singleton instance. |
typedef std::map<std::string, FunctionDefinition*>::const_iterator faudes::FunctionRegistry::Iterator |
typedef std::map<std::string, FunctionDefinition*>::iterator faudes::FunctionRegistry::iterator [protected] |
faudes::FunctionRegistry::FunctionRegistry | ( | ) | [inline, protected] |
virtual faudes::FunctionRegistry::~FunctionRegistry | ( | ) | [inline, protected, virtual] |
FunctionRegistry * faudes::FunctionRegistry::G | ( | ) | [static] |
Method to access the single global instance of the registry.
Definition at line 258 of file rtiregistry.cpp.
void faudes::FunctionRegistry::Clear | ( | void | ) | [virtual] |
Clear all registered function definitions.
This will also delete the correponsing prototype objects.
Reimplemented from faudes::Type.
Definition at line 268 of file rtiregistry.cpp.
int faudes::FunctionRegistry::Size | ( | void | ) | const |
Return number of registered function definitions.
Definition at line 284 of file rtiregistry.cpp.
bool faudes::FunctionRegistry::Exists | ( | const std::string & | rName | ) | const |
Test existence of a faudes-function by its name.
rName | Name of function to look up |
Definition at line 417 of file rtiregistry.cpp.
bool faudes::FunctionRegistry::Exists | ( | const Function & | rFunction | ) | const |
Test existence of a faudes-function by faudes object.
rFunction | Object of function to look up |
Definition at line 422 of file rtiregistry.cpp.
FunctionRegistry::Iterator faudes::FunctionRegistry::Begin | ( | void | ) | const |
STL interator to the internal function-name map.
Definition at line 289 of file rtiregistry.cpp.
FunctionRegistry::Iterator faudes::FunctionRegistry::End | ( | void | ) | const |
STL interator to the internal function-name map.
Definition at line 294 of file rtiregistry.cpp.
void faudes::FunctionRegistry::Insert | ( | FunctionDefinition * | pFunctionDef | ) |
Add another function definition to the registry.
The registry takes the ownership pf the provided function definition. It will be deleted either in Clear() or when the registry is destructed.
pFunctionDef | Function definition to insert |
Exception |
|
Definition at line 299 of file rtiregistry.cpp.
void faudes::FunctionRegistry::Insert | ( | const std::string & | rFunctionName = "" |
) | [inline] |
Register a faudes-function with specified function name.
This is a convenience function: it uses the template parameter to construct the new instance of FunctionDefinition to be registered. However, no documentation is added. See also MergeDocumentation.
T | Template parameter to specify c++ function to register |
rFunctionName | Specify the faudes-function name |
Exception |
|
Definition at line 429 of file rtiregistry.h.
void faudes::FunctionRegistry::MergeDocumentation | ( | TokenReader & | rTr | ) |
Scan token input for function documentation.
This function scans the entire token stream for sections with label "FunctionDefinition". Any such section that refers to a function name which is known to the registry, will be applied to the corresponding registry entry.
rTr | Token stream. |
Definition at line 316 of file rtiregistry.cpp.
void faudes::FunctionRegistry::MergeDocumentation | ( | const std::string & | rFileName | ) |
Scan file for function documentation.
Convenience method, see also MergeDocumentation(TokenReader& rTr)
rFileName | Name of file to scan. |
Definition at line 348 of file rtiregistry.cpp.
Function * faudes::FunctionRegistry::NewFunction | ( | const std::string & | rFunctionName | ) | const |
Construct a faudes object by function name.
Uses the internal prototype object to construct an object of the same c function on the heap.
rFunctionName | Label of FunctionDefinition to search for. |
Exception |
|
Definition at line 355 of file rtiregistry.cpp.
Construct a faudes object by protofunction object.
Depreciated: use new on the faudes object instead.
rFunction | Protofunction object. |
Exception |
|
Definition at line 373 of file rtiregistry.cpp.
const FunctionDefinition & faudes::FunctionRegistry::Definition | ( | const std::string & | rFunctionName | ) | const |
Look up the function definition by faudes-function name.
rFunctionName | Label of faudes::FunctionDefinition to search for. |
Exception |
|
Definition at line 386 of file rtiregistry.cpp.
const FunctionDefinition & faudes::FunctionRegistry::Definition | ( | const Function & | rFunction | ) | const |
Look up the function definition by faudes object.
Techcal note: this implementation is slow, we should use a function id map.
rFunction | Reference to faudes::Function to search for. |
Exception |
|
Definition at line 399 of file rtiregistry.cpp.
void faudes::FunctionRegistry::DoWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write registry data of this to TokenWriter.
Since the registry cannot reconfigure itself from a token stream, this output is informative only. However, MergeDocumentation will accept the format to extract documentation.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::Type.
Definition at line 428 of file rtiregistry.cpp.
FunctionRegistry * faudes::FunctionRegistry::mpInstance = 0 [static, protected] |
std::map<std::string, FunctionDefinition*> faudes::FunctionRegistry::mNameToFunctionDef [protected] |
Map to associate labels and faudes::FunctionDefinitions.
Definition at line 561 of file rtiregistry.h.
std::map<std::string, FunctionDefinition*> faudes::FunctionRegistry::mIdToFunctionDef [protected] |
Definition at line 562 of file rtiregistry.h.
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6