/* * ActionTrait.hpp * * Created on: Oct 26, 2010 * Author: heber */ #ifndef ACTIONTRAIT_HPP_ #define ACTIONTRAIT_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "Actions/OptionTrait.hpp" namespace MoleCuilder { /** Interface for all ActionTrait. * This class defines the interface, i.e. the common set of information that * is stored in this traits for Action classes. It also defines a set of getter * functions. * * Note that there are no setters. This is because the information is to be * given in a specialized form of the templated class ActionTrait that derives * from this interface. * */ class ActionTrait : public OptionTrait { public: ActionTrait(const ActionTrait &_Traits); ActionTrait(const OptionTrait &_Traits, const std::string _MenuTitle = "", const int _MenuPosition = 0); explicit ActionTrait(const std::string &_token); virtual ~ActionTrait(); typedef std::map< std::string, OptionTrait* > options_map; typedef options_map::iterator options_iterator; typedef options_map::const_iterator options_const_iterator; const std::string& getMenuName() const; int getMenuPosition() const; // getter for its options OptionTrait const &getOption(const std::string &token) const; bool hasOption(const std::string &token) const; bool hasOptions() const; options_iterator getBeginIter(); options_iterator getEndIter(); options_const_iterator getBeginIter() const; options_const_iterator getEndIter() const; protected: // internal information this trait contains std::string MenuTitle; int MenuPosition; options_map Options; }; } std::ostream &operator<<(std::ostream &out, const MoleCuilder::ActionTrait &a); #endif /* ACTIONTRAIT_HPP_ */