OpenASIP  2.0
Public Member Functions | Protected Attributes | List of all members
GraphNodeFunctor< Graph, GraphNode > Class Template Referenceabstract

#include <GraphUtilities.hh>

Collaboration diagram for GraphNodeFunctor< Graph, GraphNode >:
Collaboration graph

Public Member Functions

 GraphNodeFunctor (const Graph &pGraph)
 Constructor. Keep record of the parent graph of the nodes to work on. More...
 
virtual ~GraphNodeFunctor ()
 Destructor. Subclasses should clean up any state created during operation in this method. More...
 
virtual void operator() (GraphNode &) const =0
 Operation to apply to a given node of the graph. More...
 

Protected Attributes

const Graph * graph_
 Expected parent graph. More...
 

Detailed Description

template<typename Graph, typename GraphNode>
class GraphNodeFunctor< Graph, GraphNode >

Base template class for functors that apply to graph nodes.

The node type is an independent template parameter. This enables using a subclass instead of the actual graph node class, or even an unrelated class, as long as it provides an appropriate conversion operator.

When the graph contains several specialised types of nodes, the template parameter should be convertible to the base node type.

Definition at line 51 of file GraphUtilities.hh.

Constructor & Destructor Documentation

◆ GraphNodeFunctor()

template<typename Graph , typename GraphNode >
GraphNodeFunctor< Graph, GraphNode >::GraphNodeFunctor ( const Graph &  pGraph)
inline

Constructor. Keep record of the parent graph of the nodes to work on.

Definition at line 54 of file GraphUtilities.hh.

54  :
55  graph_(&pGraph) {}

◆ ~GraphNodeFunctor()

template<typename Graph , typename GraphNode >
virtual GraphNodeFunctor< Graph, GraphNode >::~GraphNodeFunctor ( )
inlinevirtual

Destructor. Subclasses should clean up any state created during operation in this method.

Definition at line 58 of file GraphUtilities.hh.

58 { };

Member Function Documentation

◆ operator()()

template<typename Graph , typename GraphNode >
virtual void GraphNodeFunctor< Graph, GraphNode >::operator() ( GraphNode ) const
pure virtual

Operation to apply to a given node of the graph.

Member Data Documentation

◆ graph_

template<typename Graph , typename GraphNode >
const Graph* GraphNodeFunctor< Graph, GraphNode >::graph_
protected

Expected parent graph.

Definition at line 64 of file GraphUtilities.hh.


The documentation for this class was generated from the following file:
GraphNodeFunctor::graph_
const Graph * graph_
Expected parent graph.
Definition: GraphUtilities.hh:64