22 #ifndef __PLUMED_core_ActionRegister_h
23 #define __PLUMED_core_ActionRegister_h
29 #include "tools/Keywords.h"
53 std::map<std::string,creator_pointer>
m;
55 typedef std::map<std::string,creator_pointer>::iterator
mIterator;
59 std::map<std::string,keywords_pointer>
mk;
61 typedef std::map<std::string,Keywords>::iterator
mIteratork;
73 bool check(std::string action);
80 bool printTemplate(
const std::string& action,
bool include_optional);
103 #define PLUMED_REGISTER_ACTION(classname,directive) \
104 static class classname##RegisterMe{ \
105 static PLMD::Action* create(const PLMD::ActionOptions&ao){return new classname(ao);} \
107 classname##RegisterMe(){PLMD::actionRegister().add(directive,create,classname::registerKeywords);} \
108 ~classname##RegisterMe(){PLMD::actionRegister().remove(create);} \
109 } classname##RegisterMeObject;
bool printTemplate(const std::string &action, bool include_optional)
Print out a template command for an action.
ActionRegister & actionRegister()
std::map< std::string, keywords_pointer > mk
Map action to a function which documents the related object.
bool check(std::string action)
Verify if a directive is present in the register.
Action *(* creator_pointer)(const ActionOptions &)
Pointer to a function which, given the options, create an Action.
This class holds the keywords and their documentation.
This class is used to bring the relevant information to the Action constructor.
void(* keywords_pointer)(Keywords &)
Pointer to a function which, returns the keywords allowed.
Base class for all the input Actions.
std::map< std::string, creator_pointer > m
Map action to a function which creates the related object.
bool printManual(const std::string &action)
Print out the keywords for an action in html ready for input into the manual.
std::map< std::string, Keywords >::const_iterator const_mIteratork
Iterator over the map.
std::map< std::string, creator_pointer >::iterator mIterator
Iterator over the map.
friend std::ostream & operator<<(std::ostream &, const ActionRegister &)
Write on a stream the list of registered directives.
std::map< std::string, Keywords >::iterator mIteratork
Iterator over the map.
std::map< std::string, creator_pointer >::const_iterator const_mIterator
Iterator over the map.
Action * create(const ActionOptions &ao)
Create an Action of the type indicated in the options.
Register holding all the allowed keywords.
void add(std::string key, creator_pointer cp, keywords_pointer kp)
Register a new class.
std::ostream & operator<<(std::ostream &log, const ActionRegister &ar)
std::set< std::string > disabled
Set of disabled actions (which were registered more than once)