Same as ActionRegister, but for CLTools. More...
#include <CLToolRegister.h>
Public Member Functions | |
| void | add (std::string key, creator_pointer cp, keywords_pointer kp) |
| Register a new class. More... | |
| bool | check (std::string cltool) |
| Verify if a directive is present in the register. More... | |
| CLTool * | create (const CLToolOptions &ao) |
| Create an CLTool of the type indicated in the options. More... | |
| void | remove (creator_pointer) |
| ~CLToolRegister () | |
| std::vector< std::string > | list () const |
| Returns a list of the allowed CLTools. More... | |
| bool | printManual (const std::string &cltool) |
| Print out the instructions for using the tool in html ready for input into the manual. More... | |
Private Types | |
| typedef CLTool *(* | creator_pointer )(const CLToolOptions &) |
| Pointer to a function which, given the options, create an CLTool. More... | |
| typedef void(* | keywords_pointer )(Keywords &) |
| Pointer to a function which, returns the keywords allowed. More... | |
| typedef std::map< std::string, creator_pointer >::iterator | mIterator |
| Iterator over the map. More... | |
| typedef std::map< std::string, creator_pointer > ::const_iterator | const_mIterator |
| Iterator over the map. More... | |
Private Attributes | |
| std::map< std::string, creator_pointer > | m |
| Map cltool to a function which creates the related object. More... | |
| std::map< std::string, Keywords > | mk |
| Map cltool name to the keywords for this function. More... | |
| std::set< std::string > | disabled |
| Set of disabled cltools (which were registered more than once) More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &, const CLToolRegister &) |
| Write on a stream the list of registered directives. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| CLToolRegister & | cltoolRegister () |
| Function returning a reference to the CLToolRegister. More... | |
| #define | PLUMED_REGISTER_CLTOOL(classname, directive) |
| Shortcut for CLTool registration. More... | |
Same as ActionRegister, but for CLTools.
Definition at line 38 of file CLToolRegister.h.
|
private |
Iterator over the map.
Definition at line 52 of file CLToolRegister.h.
|
private |
Pointer to a function which, given the options, create an CLTool.
Definition at line 42 of file CLToolRegister.h.
|
private |
Pointer to a function which, returns the keywords allowed.
Definition at line 44 of file CLToolRegister.h.
|
private |
Iterator over the map.
Definition at line 50 of file CLToolRegister.h.
| PLMD::CLToolRegister::~CLToolRegister | ( | ) |
Definition at line 32 of file CLToolRegister.cpp.
| void PLMD::CLToolRegister::add | ( | std::string | key, |
| creator_pointer | cp, | ||
| keywords_pointer | kp | ||
| ) |
Register a new class.
| key | The name of the directive to be used in the input file |
| cp | A pointer to a function which creates an object of that class |
| kp | A pointer to a function which returns the allowed keywords |
Definition at line 53 of file CLToolRegister.cpp.
| bool PLMD::CLToolRegister::check | ( | std::string | cltool | ) |
Verify if a directive is present in the register.
Definition at line 64 of file CLToolRegister.cpp.
| CLTool * PLMD::CLToolRegister::create | ( | const CLToolOptions & | ao | ) |
Create an CLTool of the type indicated in the options.
| ao | object containing information for initialization, such as the full input line, a pointer to PlumedMain, etc |
Definition at line 69 of file CLToolRegister.cpp.
| vector< string > PLMD::CLToolRegister::list | ( | ) | const |
Returns a list of the allowed CLTools.
Definition at line 104 of file CLToolRegister.cpp.
| bool PLMD::CLToolRegister::printManual | ( | const std::string & | cltool | ) |
Print out the instructions for using the tool in html ready for input into the manual.
Definition at line 95 of file CLToolRegister.cpp.
| void PLMD::CLToolRegister::remove | ( | creator_pointer | f | ) |
Definition at line 45 of file CLToolRegister.cpp.
|
related |
Function returning a reference to the CLToolRegister.
To avoid problems with order of initialization, this function contains a static CLToolRegister which is built the first time the function is called. In this manner, it is always initialized before it's used
Definition at line 40 of file CLToolRegister.cpp.
|
friend |
Write on a stream the list of registered directives.
Definition at line 80 of file CLToolRegister.cpp.
|
related |
Shortcut for CLTool registration.
For easier registration, this file also provides a macro PLUMED_REGISTER_CLTOOL.
| classname | the name of the class to be registered |
| directive | a string containing the corresponding directive This macro should be used in the .cpp file of the corresponding class |
Definition at line 92 of file CLToolRegister.h.
|
private |
Set of disabled cltools (which were registered more than once)
Definition at line 54 of file CLToolRegister.h.
|
private |
Map cltool to a function which creates the related object.
Definition at line 46 of file CLToolRegister.h.
|
private |
Map cltool name to the keywords for this function.
Definition at line 48 of file CLToolRegister.h.
Hosted by GitHub
|
1.8.8
|