/* * ActionTraits.hpp * * Created on: Oct 26, 2010 * Author: heber */ #ifndef ACTIONTRAITS_HPP_ #define ACTIONTRAITS_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include /** Interface for all ActionTraits. * 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 ActionTraits { public: /* TODO: This internal reference is only needed as long as information is not * yet local. Here it is used to gather info from MapOfActions. */ explicit ActionTraits(); virtual ~ActionTraits(); const std::string getCurrentValue(); const std::string getDescription(); const std::string getShortForm(); const std::type_info * getType(); protected: // internal information this trait contains std::string CurrentValue; std::string Description; std::string ShortForm; const std::type_info *InternalType; }; /* Templated class for ActionTraits to specialize. * I.e. every action specializes its own ActionTrait and inherits the * ActionTraits class as interface , e.g. Action called SuperAction: * ActionTrait : public ActionTraits * * within the constructor of said ActionTrait the specific * information for this derived Action class is then given. */ template class ActionTrait : public ActionTraits { public: ActionTrait(); ~ActionTrait(); }; #endif /* ACTIONTRAITS_HPP_ */