g2o
Loading...
Searching...
No Matches
g2o::HyperGraphElementActionCollection Class Reference

collection of actions More...

#include <hyper_graph_action.h>

Inheritance diagram for g2o::HyperGraphElementActionCollection:
Collaboration diagram for g2o::HyperGraphElementActionCollection:

Public Member Functions

 HyperGraphElementActionCollection (const std::string &name_)
 constructor. name_ is the name of the action e.g.draw).
virtual HyperGraphElementAction * operator() (HyperGraph::HyperGraphElement *element, Parameters *parameters)
virtual HyperGraphElementAction * operator() (const HyperGraph::HyperGraphElement *element, Parameters *parameters)
ActionMap & actionMap ()
bool registerAction (const HyperGraphElementAction::HyperGraphElementActionPtr &action)
bool unregisterAction (const HyperGraphElementAction::HyperGraphElementActionPtr &action)
Public Member Functions inherited from g2o::HyperGraphElementAction
 HyperGraphElementAction (const std::string &typeName_="")
virtual ~HyperGraphElementAction ()
const std::string & typeName () const
 returns the typeid name of the action
const std::string & name () const
 returns the name of an action, e.g "draw"
void setTypeName (const std::string &typeName_)
 sets the type on which an action has to operate

Protected Attributes

ActionMap _actionMap
Protected Attributes inherited from g2o::HyperGraphElementAction
std::string _typeName
std::string _name

Additional Inherited Members

Public Types inherited from g2o::HyperGraphElementAction
typedef std::shared_ptr< HyperGraphElementAction > HyperGraphElementActionPtr
typedef std::map< std::string, HyperGraphElementActionPtr > ActionMap

Detailed Description

collection of actions

collection of actions calls contains homogeneous actions operating on different types all collected actions have the same name and should have the same functionality

Definition at line 118 of file hyper_graph_action.h.

Constructor & Destructor Documentation

◆ HyperGraphElementActionCollection()

g2o::HyperGraphElementActionCollection::HyperGraphElementActionCollection ( const std::string & name_)
explicit

constructor. name_ is the name of the action e.g.draw).

Definition at line 76 of file hyper_graph_action.cpp.

References g2o::HyperGraphElementAction::_name.

Member Function Documentation

◆ actionMap()

ActionMap & g2o::HyperGraphElementActionCollection::actionMap ( )
inline

Definition at line 131 of file hyper_graph_action.h.

References _actionMap.

Referenced by g2o::HyperGraphActionLibrary::unregisterAction().

◆ operator()() [1/2]

HyperGraphElementAction * g2o::HyperGraphElementActionCollection::operator() ( const HyperGraph::HyperGraphElement * element,
HyperGraphElementAction::Parameters * parameters )
virtual

redefine this to do the action stuff. If successful, the action returns a pointer to itself

Reimplemented from g2o::HyperGraphElementAction.

Definition at line 90 of file hyper_graph_action.cpp.

References _actionMap, and g2o::HyperGraphElementAction::HyperGraphElementAction().

◆ operator()() [2/2]

HyperGraphElementAction * g2o::HyperGraphElementActionCollection::operator() ( HyperGraph::HyperGraphElement * element,
HyperGraphElementAction::Parameters * params )
virtual

calling functions, they return a pointer to the instance of action in actionMap that was active on element

Reimplemented from g2o::HyperGraphElementAction.

Definition at line 81 of file hyper_graph_action.cpp.

References _actionMap, and g2o::HyperGraphElementAction::HyperGraphElementAction().

◆ registerAction()

bool g2o::HyperGraphElementActionCollection::registerAction ( const HyperGraphElementAction::HyperGraphElementActionPtr & action)

inserts an action in the pool. The action should have the same name of the container. returns false on failure (the container has a different name than the action);

Definition at line 99 of file hyper_graph_action.cpp.

References __PRETTY_FUNCTION__, _actionMap, G2O_DEBUG, G2O_ERROR, and g2o::HyperGraphElementAction::name().

Referenced by g2o::HyperGraphActionLibrary::registerAction().

◆ unregisterAction()

bool g2o::HyperGraphElementActionCollection::unregisterAction ( const HyperGraphElementAction::HyperGraphElementActionPtr & action)

Definition at line 115 of file hyper_graph_action.cpp.

References _actionMap.

Referenced by g2o::HyperGraphActionLibrary::unregisterAction().

Member Data Documentation

◆ _actionMap

ActionMap g2o::HyperGraphElementActionCollection::_actionMap
protected

The documentation for this class was generated from the following files: