22 #ifndef __PLUMED_tools_Keywords_h
23 #define __PLUMED_tools_Keywords_h
41 KeyType(
const std::string& type );
42 void setStyle(
const std::string& type );
53 else plumed_assert(0);
60 std::vector<std::string>
keys;
64 std::map<std::string,KeyType>
types;
72 std::map<std::string,std::string>
numdefs;
80 std::map<std::string,std::string>
ckey;
82 std::map<std::string,std::string>
cdocs;
88 void printKeyword(
const std::string& j, FILE* out )
const ;
95 unsigned size()
const;
97 bool numbered(
const std::string & k )
const ;
99 std::string
getKeyword(
const unsigned i )
const ;
103 void print( FILE* out )
const ;
105 void reserve(
const std::string & t,
const std::string & k,
const std::string & d,
const bool isvessel=
false );
107 void reserveFlag(
const std::string & k,
const bool def,
const std::string & d,
const bool isvessel=
false );
109 void use(
const std::string & k );
111 std::string
get(
const unsigned k )
const ;
113 void add(
const std::string & t,
const std::string & k,
const std::string & d );
115 void add(
const std::string & t,
const std::string & k,
const std::string & def,
const std::string & d );
117 void addFlag(
const std::string & k,
const bool def,
const std::string & d );
119 void remove(
const std::string & k );
121 bool exists(
const std::string & k )
const ;
123 bool reserved(
const std::string & k )
const ;
125 bool style(
const std::string & k,
const std::string & t )
const ;
127 void print_html(
const bool isaction )
const ;
129 void print_template(
const std::string& actionname,
bool include_optional)
const ;
135 void copyData( std::vector<std::string>& kk, std::vector<std::string>& rk, std::map<std::string,KeyType>& tt, std::map<std::string,bool>& am,
136 std::map<std::string,std::string>& docs, std::map<std::string,bool>& bools, std::map<std::string,std::string>& nums,
137 std::map<std::string,std::string>& atags, std::vector<std::string>& cnam, std::map<std::string,std::string>& ck,
138 std::map<std::string,std::string>& cd )
const ;
144 void addOutputComponent(
const std::string& name,
const std::string& key,
const std::string& descr );
void setComponentsIntroduction(const std::string &instr)
Set the text that introduces how the components for this action are introduced.
void copyData(std::vector< std::string > &kk, std::vector< std::string > &rk, std::map< std::string, KeyType > &tt, std::map< std::string, bool > &am, std::map< std::string, std::string > &docs, std::map< std::string, bool > &bools, std::map< std::string, std::string > &nums, std::map< std::string, std::string > &atags, std::vector< std::string > &cnam, std::map< std::string, std::string > &ck, std::map< std::string, std::string > &cd) const
Copy the keywords data.
std::vector< std::string > keys
The names of the allowed keywords.
void setStyle(const std::string &type)
void destroyData()
Clear everything from the keywords object.
std::vector< std::string > reserved_keys
The names of the reserved keywords.
std::map< std::string, std::string > documentation
The documentation for the keywords.
std::string toString() const
void add(const std::string &t, const std::string &k, const std::string &d)
Add a new keyword of type t with name k and description d.
std::map< std::string, std::string > atomtags
The tags for atoms - we use this so the manual can differentiate between different ways of specifying...
Class containing the log stream.
This class lets me pass keyword types easily.
bool getDefaultValue(std::string key, std::string &def) const
Get the value of the default for the keyword named key.
std::string cstring
The string that should be printed out to describe how the components work for this particular action...
void addOutputComponent(const std::string &name, const std::string &key, const std::string &descr)
Add a potential component which can be output by this particular action.
bool isCompulsory() const
void print_html_item(const std::string &) const
Print the documentation for the jth keyword in html.
This class holds the keywords and their documentation.
void printKeyword(const std::string &j, Log &log) const
Print a particular keyword.
void print(Log &log) const
Print the documentation to the log file (used by PLMD::Action::error)
bool numbered(const std::string &k) const
Check if numbered keywords are allowed for this action.
Base class for all the input Actions.
std::map< std::string, std::string > ckey
The keyword that turns on a particular component.
std::map< std::string, KeyType > types
Whether the keyword is compulsory, optional...
std::string getKeyword(const unsigned i) const
Return the ith keyword.
void reserve(const std::string &t, const std::string &k, const std::string &d, const bool isvessel=false)
Reserve a keyword.
bool style(const std::string &k, const std::string &t) const
Check if the keyword with name k has style t.
void use(const std::string &k)
Use one of the reserved keywords.
std::map< std::string, bool > booldefs
The default values for the flags (are they on or of)
void print_template(const std::string &actionname, bool include_optional) const
Print the template version for the documenation.
void reserveFlag(const std::string &k, const bool def, const std::string &d, const bool isvessel=false)
Reserve a flag.
std::map< std::string, std::string > numdefs
The default values (if there are default values) for compulsory keywords.
bool exists(const std::string &k) const
Check if there is a keyword with name k.
bool reserved(const std::string &k) const
Check the keyword k has been reserved.
std::map< std::string, bool > allowmultiple
Do we allow stuff like key1, key2 etc.
std::map< std::string, std::string > cdocs
The documentation for a particular component.
KeyType(const std::string &type)
bool outputComponentExists(const std::string &name, const bool &custom) const
Has a component with this name been added?
void print_html(const bool isaction) const
Print an html version of the documentation.
bool getLogicalDefault(std::string key, bool &def) const
find out whether flag key is on or off by default.
void reset_style(const std::string &k, const std::string &style)
Change the style of a keyword.
enum PLMD::Keywords::KeyType::@5 style
std::vector< std::string > cnames
The names of all the possible components for an action.
void addFlag(const std::string &k, const bool def, const std::string &d)
Add a falg with name k that is by default on if def is true and off if def is false. d should provide a description of the flag.
unsigned size() const
Return the number of defined keywords.