30 #include "util/base/exception.h"
39 m_namespace(name_space),
41 m_inherited(inherited),
47 m_defaultaction(NULL) {
52 std::map<std::string, Action*>::const_iterator i(m_actions->begin());
53 while (i != m_actions->end()) {
64 m_actions =
new std::map<std::string, Action*>;
67 std::map<std::string, Action*>::const_iterator it = m_actions->begin();
68 for(; it != m_actions->end(); ++it) {
69 if(identifier == it->second->getId()) {
70 throw NameClash(identifier);
76 a =
new Action(identifier);
77 (*m_actions)[identifier] = a;
78 if (is_default || (!m_defaultaction)) {
86 std::map<std::string, Action*>::const_iterator i;
88 i = m_actions->find(identifier);
90 if ((!m_actions) || (i == m_actions->end())) {
92 return m_inherited->
getAction(identifier);
100 std::list<std::string> action_ids;
103 std::map<std::string, Action*>::const_iterator actions_it = m_actions->begin();
104 for(; actions_it != m_actions->end(); ++actions_it) {
105 action_ids.push_back(actions_it->first);
135 bool Object::operator==(
const Object& obj)
const {
136 return m_id == obj.getId() && m_namespace == obj.getNamespace();
139 bool Object::operator!=(
const Object& obj)
const {
140 return m_id != obj.getId() || m_namespace != obj.getNamespace();
Object(const std::string &identifier, const std::string &name_space, Object *inherited=NULL)
Action * createAction(const std::string &identifier, bool is_default=false)
Action * getAction(const std::string &identifier) const
void setPather(IPather *pather)
std::list< std::string > getActionIds() const