22 #ifndef __PLUMED_vesselbase_VesselRegister_h
23 #define __PLUMED_vesselbase_VesselRegister_h
29 #include "tools/Exception.h"
30 #include "tools/Keywords.h"
45 std::map<std::string,creator_pointer>
m;
47 std::map<std::string,keyword_pointer>
mk;
58 bool check(std::string keyname);
67 #define PLUMED_REGISTER_VESSEL(classname,keyword) \
68 static class classname##RegisterMe{ \
69 static PLMD::vesselbase::Vessel * create(const PLMD::vesselbase::VesselOptions&da){return new classname(da);} \
71 classname##RegisterMe(){PLMD::vesselbase::vesselRegister().add(keyword,create,classname::reserveKeyword,classname::registerKeywords);} \
72 ~classname##RegisterMe(){PLMD::vesselbase::vesselRegister().remove(create);} \
73 } classname##RegisterMeObject;
bool check(std::string keyname)
Verify if a distribution keyword is present in the register.
Vessel * create(std::string keyword, const VesselOptions &da)
Create a distribution function of the specified type.
Keywords keywords
A vector of function pointers - this is used to create the documentation.
void add(std::string keyword, creator_pointer, keyword_pointer k, keyword_pointer ik)
Add a new distribution function option to the register of distribution functions. ...
~VesselRegister()
The destructor.
This class holds the keywords and their documentation.
void(* keyword_pointer)(Keywords &)
Pointer to the function that reserves the keyword for the distribution.
VesselRegister & vesselRegister()
This class is used to pass the input to Vessels.
std::map< std::string, keyword_pointer > mk
Map action to a function which documents the related object.
Keywords getKeywords()
Return the keywords.
Vessel *(* creator_pointer)(const VesselOptions &)
Pointer to a function which, given the keyword for a distribution function, creates it...
std::map< std::string, creator_pointer > m
The set of possible distribution functions we can work with.