Index: src/Actions/ActionRegistry.cpp
===================================================================
--- src/Actions/ActionRegistry.cpp	(revision d0fbecbcdc3487bcfb490f5e818f9b9b96b5f4d2)
+++ src/Actions/ActionRegistry.cpp	(revision 2ad48247b6f9de9eea8821024e501debd95f776e)
@@ -1,4 +1,4 @@
 /*
- * ActionRegistry.cpp
+ * Registry<Action>.cpp
  *
  *  Created on: Jan 7, 2010
@@ -9,118 +9,35 @@
 
 #include "Actions/ActionRegistry.hpp"
-#include "Actions/Action.hpp"
-
 #include "Patterns/Singleton_impl.hpp"
-
-#include <string>
-#include "Helpers/Assert.hpp"
-#include <iostream>
-
-using namespace std;
+#include "Patterns/Registry_impl.hpp"
 
 /** Constructor for class ActionRegistry.
  */
 ActionRegistry::ActionRegistry()
-{
-}
+{}
 
 /** Destructor for class ActionRegistry.
  */
 ActionRegistry::~ActionRegistry()
+{}
+
+/** Just passes on call to Registry<Action>::getByName().
+ * \param name name of Action
+ * \return pointer to Action
+ */
+Action* ActionRegistry::getActionByName(const std::string name)
 {
-  map<const string,Action*>::iterator iter;
-  for(iter=actionMap.begin();iter!=actionMap.end();++iter) {
-    delete iter->second;
-  }
-  actionMap.clear();
+  return getByName(name);
 }
 
-/** Returns pointer to an action named by \a name.
- * \param name name of action
- * \return pointer to Action
+/** Just passes on call to Registry<Action>::isPresentByName().
+ * \param name name of Action
+ * \return true - Action instance present, false - not
  */
-Action* ActionRegistry::getActionByName(const std::string name){
-  map<const string,Action*>::iterator iter;
-  iter = actionMap.find(name);
-  ASSERT(iter!=actionMap.end(),"Query for an action not stored in registry");
-  return iter->second;
+bool ActionRegistry::isActionPresentByName(const std::string name)
+{
+  return isPresentByName(name);
 }
 
-/** States whether action is present or not.
- * \note This iss needed as ActionRegistry::getActionByName() ASSERT()s that action is in map.
- * \param name name of action
- * \return true - Action present, false - Action absent
- */
-bool ActionRegistry::isActionByNamePresent(const std::string name){
-  map<const string,Action*>::iterator iter;
-  iter = actionMap.find(name);
-  return iter!=actionMap.end();
-}
-
-/** Registers an Action with the ActionRegistry.
- * \param *action pointer to Action.
- */
-void ActionRegistry::registerAction(Action* action){
-  pair<map<const string,Action*>::iterator,bool> ret;
-  //cout << "Trying to register action with name " << action->getName() << "." << endl;
-  ret = actionMap.insert(pair<const string,Action*>(action->getName(),action));
-  ASSERT(ret.second,"Two actions with the same name added to registry");
-}
-
-/** Unregisters an Action.
- * \param *action pointer to Action.
- */
-void ActionRegistry::unregisterAction(Action* action){
-  //cout << "Unregistering action with name " << action->getName() << "." << endl;
-  actionMap.erase(action->getName());
-}
-
-/** Returns an iterator pointing to the start of the map of Action's.
- * \return begin iterator
- */
-std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter()
-{
-  return actionMap.begin();
-}
-
-/** Returns an iterator pointing to the end of the map of Action's.
- * \return end iterator
- */
-std::map<const std::string,Action*>::iterator ActionRegistry::getEndIter()
-{
-  return actionMap.end();
-}
-
-/** Returns a const iterator pointing to the start of the map of Action's.
- * \return constant begin iterator
- */
-std::map<const std::string,Action*>::const_iterator ActionRegistry::getBeginIter() const
-{
-  return actionMap.begin();
-}
-
-/** Returns a const iterator pointing to the end of the map of Action's.
- * \return constant end iterator
- */
-std::map<const std::string,Action*>::const_iterator ActionRegistry::getEndIter() const
-{
-  return actionMap.end();
-}
-
-/** Prints the contents of the ActionRegistry \a &m to \a &ost.
- * \param &ost output stream
- * \param &m reference to ActionRegistry
- * \return reference to the above out stream for concatenation
- */
-ostream& operator<<(ostream& ost, const ActionRegistry& m)
-{
-  ost << "ActionRegistry contains:" << endl;
-  for (std::map<const std::string,Action*>::const_iterator iter = m.getBeginIter(); iter != m.getEndIter(); ++iter) {
-    ost << "\t" << iter->first << " with pointer " << iter->second << endl;
-  }
-  return ost;
-};
-
-
-
 CONSTRUCT_SINGLETON(ActionRegistry)
+CONSTRUCT_REGISTRY(Action)
