g2o
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
g2o::HyperGraphElementAction Class Reference

Abstract action that operates on a graph entity. More...

#include <hyper_graph_action.h>

Inheritance diagram for g2o::HyperGraphElementAction:
Inheritance graph
[legend]

Classes

struct  Parameters
 

Public Types

typedef std::shared_ptr< HyperGraphElementActionHyperGraphElementActionPtr
 
typedef std::map< std::string, HyperGraphElementActionPtrActionMap
 

Public Member Functions

 HyperGraphElementAction (const std::string &typeName_="")
 
virtual HyperGraphElementActionoperator() (HyperGraph::HyperGraphElement *element, Parameters *parameters)
 
virtual HyperGraphElementActionoperator() (const HyperGraph::HyperGraphElement *element, Parameters *parameters)
 
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

std::string _typeName
 
std::string _name
 

Detailed Description

Abstract action that operates on a graph entity.

Definition at line 74 of file hyper_graph_action.h.

Member Typedef Documentation

◆ ActionMap

Definition at line 80 of file hyper_graph_action.h.

◆ HyperGraphElementActionPtr

Definition at line 79 of file hyper_graph_action.h.

Constructor & Destructor Documentation

◆ HyperGraphElementAction()

g2o::HyperGraphElementAction::HyperGraphElementAction ( const std::string &  typeName_ = "")
explicit

an action should be instantiated with the typeid.name of the graph element on which it operates

Definition at line 56 of file hyper_graph_action.cpp.

57 : _typeName(typeName_) {}

◆ ~HyperGraphElementAction()

g2o::HyperGraphElementAction::~HyperGraphElementAction ( )
virtual

Definition at line 74 of file hyper_graph_action.cpp.

74{}

Member Function Documentation

◆ name()

const std::string & g2o::HyperGraphElementAction::name ( ) const
inline

returns the name of an action, e.g "draw"

Definition at line 101 of file hyper_graph_action.h.

101{ return _name; }

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

◆ operator()() [1/2]

HyperGraphElementAction * g2o::HyperGraphElementAction::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 in g2o::HyperGraphElementActionCollection.

Definition at line 68 of file hyper_graph_action.cpp.

70 {
71 return nullptr;
72}

◆ operator()() [2/2]

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

◆ setTypeName()

void g2o::HyperGraphElementAction::setTypeName ( const std::string &  typeName_)

sets the type on which an action has to operate

Definition at line 59 of file hyper_graph_action.cpp.

59 {
60 _typeName = typeName_;
61}

References _typeName.

◆ typeName()

const std::string & g2o::HyperGraphElementAction::typeName ( ) const
inline

returns the typeid name of the action

Definition at line 98 of file hyper_graph_action.h.

98{ return _typeName; }

Member Data Documentation

◆ _name

std::string g2o::HyperGraphElementAction::_name
protected

◆ _typeName

std::string g2o::HyperGraphElementAction::_typeName
protected

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