Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionRegistry.hpp

    r1e6913 rb2d8d0  
    11/*
    2  * ActionRegistry.hpp
     2 * Registry<Action>.hpp
    33 *
    44 *  Created on: Jan 7, 2010
     
    99#define ACTIONREGISTRY_HPP_
    1010
     11#include <iosfwd>
    1112#include <string>
    1213#include <map>
    1314
     15#include "Patterns/Registry.hpp"
    1416#include "Patterns/Singleton.hpp"
     17#include "Actions/Action.hpp"
    1518
    16 class Action;
    17 
    18 class ActionRegistry : public Singleton<ActionRegistry>
     19/** Action Registry.
     20 *
     21 * The Action registry is a storage for any Action instance to retrieved by name.
     22 * It is a singleton and can be called from anywhere.
     23 *
     24 */
     25class ActionRegistry : public Singleton<ActionRegistry>, public Registry<Action>
    1926{
    2027  friend class Singleton<ActionRegistry>;
     28  //friend class Registry<Action>;
     29
    2130public:
    22   Action* getActionByName(const std::string);
    23   bool isActionByNamePresent(const std::string name);
    24   void registerAction(Action*);
    25   void unregisterAction(Action*);
    26 
    27   std::map<const std::string,Action*>::iterator getBeginIter();
    28   std::map<const std::string,Action*>::iterator getEndIter();
    29 
    30 private:
    31   std::map<const std::string,Action*> actionMap;
     31  Action* getActionByName(const std::string name);
     32  bool isActionPresentByName(const std::string name);
    3233
    3334private:
    3435  ActionRegistry();
    35   virtual ~ActionRegistry();
     36  ~ActionRegistry();
    3637};
    3738
Note: See TracChangeset for help on using the changeset viewer.