/* * Registry.hpp * * Created on: Jan 7, 2010 * Author: crueger */ #ifndef ACTIONREGISTRY_HPP_ #define ACTIONREGISTRY_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "CodePatterns/Registry.hpp" #include "Actions/Action.hpp" namespace MoleCuilder { /** Action Registry. * * The Action registry is a storage for any Action instance to retrieved by name. * ActionRegistry belongs to the ActionQueue. * * ActionRegistry::fillRegistry() is the essential function, called in the cstor, * where all the prototypical Action's are instantiated. To this end, we sadly * require a global list of all present actions (\note there is a regression test * check on its completeness). We include \ref GlobalListOfActionsh.hpp where a * boost::preprocessor sequence is contained that is then used to install each * of the Action's in the registry. * */ class ActionRegistry : public Registry { //friend class Registry; public: const Action& getActionByName(const std::string &name); bool isActionPresentByName(const std::string &name) const; /** Static getter for the state of the registry. * * @return true - ActionRegistry's cstor has run through, false - else */ static bool getCompletely_instatiated() { return completely_instatiated; } ActionRegistry(); ~ActionRegistry(); private: void fillRegistry(); void fillOptionRegistry() const; void clearOptionRegistry() const; void prepareAllMakroActions(); //!> this tells whether ActionRegistry has been completed instantiated. static bool completely_instatiated; }; } #endif /* ACTIONREGISTRY_HPP_ */