27 #ifndef G2O_HYPER_GRAPH_ACTION_H 28 #define G2O_HYPER_GRAPH_ACTION_H 31 #include "../stuff/property.h" 77 typedef std::map<std::string, HyperGraphElementAction*>
ActionMap;
92 const std::string&
typeName()
const {
return _typeName;}
95 const std::string&
name()
const{
return _name;}
98 void setTypeName(
const std::string& typeName_);
141 static void destroy();
197 #ifdef G2O_DEBUG_ACTIONLIB 198 std::cout << __FUNCTION__ <<
": Registering action of type " <<
typeid(T).name() << std::endl;
206 #ifdef G2O_DEBUG_ACTIONLIB 207 std::cout << __FUNCTION__ <<
": Unregistering action of type " <<
typeid(T).name() << std::endl;
217 #define G2O_REGISTER_ACTION(classname) \ 218 extern "C" void g2o_action_##classname(void) {} \ 219 static g2o::RegisterActionProxy<classname> g_action_proxy_##classname;
Abstract action that operates on a graph entity.
Parameters * _previousParams
HyperGraphElementAction::ActionMap & actionMap()
const std::string & name() const
returns the name of an action, e.g "draw"
std::map< std::string, HyperGraphElementAction * > ActionMap
static HyperGraphActionLibrary * instance()
return the single instance of the HyperGraphActionLibrary
bool registerAction(HyperGraphElementAction *action)
void applyAction(HyperGraph *graph, HyperGraphElementAction *action, HyperGraphElementAction::Parameters *params, const std::string &typeName)
virtual ~HyperGraphAction()
const std::string & typeName() const
returns the typeid name of the action
HyperGraphElementAction * _action
HyperGraphElementAction::ActionMap _actionMap
static HyperGraphActionLibrary * actionLibInstance
a collection of properties mapping from name to the property itself
bool unregisterAction(HyperGraphElementAction *action)
Abstract action that operates on an entire graph.
library of actions, indexed by the action name;
virtual HyperGraphAction * operator()(const HyperGraph *graph, Parameters *parameters=0)