Same as ActionRegister, but for CLTools.
More...
#include <CLToolRegister.h>
|
| | ~CLToolRegister () |
| void | add (std::string key, creator_pointer cp, keywords_pointer kp) |
| | Register a new class.
|
| bool | check (const std::string &cltool) const |
| | Verify if a directive is present in the register.
|
| std::unique_ptr< CLTool > | create (const CLToolOptions &ao) |
| | Create an CLTool of the type indicated in the options.
|
| std::vector< std::string > | getKeys (const std::string &cltool) const |
| | Return all the keys of this cltool.
|
| std::vector< std::string > | list () const |
| | Returns a list of the allowed CLTools.
|
| bool | printManual (const std::string &cltool, const bool &spelling) |
| | Print out the instructions for using the tool in html ready for input into the manual.
|
| void | remove (creator_pointer) |
|
| std::set< std::string > | disabled |
| | Set of disabled cltools (which were registered more than once).
|
| std::map< std::string, creator_pointer > | m |
| | Map cltool to a function which creates the related object.
|
| std::map< std::string, Keywords > | mk |
| | Map cltool name to the keywords for this function.
|
|
| std::ostream & | operator<< (std::ostream &log, const CLToolRegister &ar) |
| | Write on a stream the list of registered directives.
|
Same as ActionRegister, but for CLTools.
◆ creator_pointer
| typedef std::unique_ptr< CLTool >(* PLMD::CLToolRegister::creator_pointer) (const CLToolOptions &) |
|
private |
Pointer to a function which, given the options, create an CLTool.
◆ keywords_pointer
| typedef void(* PLMD::CLToolRegister::keywords_pointer) (Keywords &) |
|
private |
Pointer to a function which, returns the keywords allowed.
◆ ~CLToolRegister()
| PLMD::CLToolRegister::~CLToolRegister |
( |
| ) |
|
◆ add()
Register a new class.
- Parameters
-
| 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 |
◆ check()
| bool PLMD::CLToolRegister::check |
( |
const std::string & | cltool | ) |
const |
Verify if a directive is present in the register.
◆ create()
Create an CLTool of the type indicated in the options.
- Parameters
-
| ao | object containing information for initialization, such as the full input line, a pointer to PlumedMain, etc |
◆ getKeys()
| std::vector< std::string > PLMD::CLToolRegister::getKeys |
( |
const std::string & | cltool | ) |
const |
Return all the keys of this cltool.
◆ list()
| std::vector< std::string > PLMD::CLToolRegister::list |
( |
| ) |
const |
Returns a list of the allowed CLTools.
◆ printManual()
| bool PLMD::CLToolRegister::printManual |
( |
const std::string & | cltool, |
|
|
const bool & | spelling ) |
Print out the instructions for using the tool in html ready for input into the manual.
◆ remove()
◆ cltoolRegister()
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
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | log, |
|
|
const CLToolRegister & | ar ) |
|
friend |
Write on a stream the list of registered directives.
◆ PLUMED_REGISTER_CLTOOL
| #define PLUMED_REGISTER_CLTOOL |
( |
| classname, |
|
|
| directive ) |
|
related |
Value:namespace { class classname##RegisterMe{ \
public: \
} classname##RegisterMeObject; }
CLToolRegister & cltoolRegister()
Definition CLToolRegister.cpp:39
Shortcut for CLTool registrationFor easier registration, this file also provides a macro PLUMED_REGISTER_CLTOOL.
- Parameters
-
| 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 |
◆ disabled
| std::set<std::string> PLMD::CLToolRegister::disabled |
|
private |
Set of disabled cltools (which were registered more than once).
Map cltool to a function which creates the related object.
◆ mk
| std::map<std::string,Keywords> PLMD::CLToolRegister::mk |
|
private |
Map cltool name to the keywords for this function.
The documentation for this class was generated from the following files: