SOFA API  4006d812
Open source framework for multi-physics simuation
sofa::simulation::MappingGraphAlgorithms Struct Reference

#include <MappingGraphAlgorithms.h>

Provides graph traversal algorithms for the mapping graph. More...

Detailed Description

Provides graph traversal algorithms for the mapping graph.

This class contains static and instance methods that implement various ways to traverse the nodes and component groups defined in a MappingGraph, such as top-down, bottom-up, or arbitrary order. It uses the Visitor pattern to process components during traversal.

Public Member Functions

 MappingGraphAlgorithms (MappingGraph *mappingGraph)
 Constructor for MappingGraphAlgorithms. More...
 
void traverse (MappingGraphVisitor &visitor, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Traverses the entire mapping graph nodes in an arbitrary order. More...
 
void traverse (MappingGraphVisitor &visitor, VisitorApplication scope, TaskScheduler *taskScheduler) const
 
template<class Callable >
void traverse_ (const Callable &callable, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Traverses the entire mapping graph nodes using a callable function in an arbitrary order. More...
 
template<class Callable >
void traverse_ (const Callable &callable, VisitorApplication scope, TaskScheduler *taskScheduler) const
 
void traverseTopDown (MappingGraphVisitor &visitor, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Traverses the mapping graph in a top-down order. More...
 
template<class Callable >
void traverseTopDown_ (const Callable &callable, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Traverses the mapping graph in a top-down order using a callable function. More...
 
void traverseBottomUp (MappingGraphVisitor &visitor, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Traverses the mapping graph in a bottom-up order. More...
 
template<class Callable >
void traverseBottomUp_ (const Callable &callable, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Traverses the mapping graph in a bottom-up order using a callable function. More...
 
void traverseComponentGroups (MappingGraphVisitor &visitor, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Visit and process component groups without any specific order. More...
 
void traverseComponentGroups (MappingGraphVisitor &visitor, VisitorApplication scope, TaskScheduler *taskScheduler) const
 
template<class Callable >
void traverseComponentGroups_ (const Callable &callable, VisitorApplication scope=VisitorApplication::ALL_NODES) const
 Visit and process component groups without any specific order using a callable function. More...
 
template<class Callable >
void traverseComponentGroups_ (const Callable &callable, VisitorApplication scope, TaskScheduler *taskScheduler) const
 

Constructor details

◆ MappingGraphAlgorithms()

sofa::simulation::MappingGraphAlgorithms::MappingGraphAlgorithms ( MappingGraph mappingGraph)
inlineexplicit

Constructor for MappingGraphAlgorithms.

Parameters
mappingGraphPointer to the mapping graph to be traversed.

Function details

◆ traverse() [1/2]

void sofa::simulation::MappingGraphAlgorithms::traverse ( MappingGraphVisitor visitor,
VisitorApplication  scope,
TaskScheduler taskScheduler 
) const

◆ traverse() [2/2]

void sofa::simulation::MappingGraphAlgorithms::traverse ( MappingGraphVisitor visitor,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const

Traverses the entire mapping graph nodes in an arbitrary order.

Parameters
visitorThe concrete visitor implementation to process each node.
scopeSpecifies which types of nodes should be visited (e.g., all, or only component groups).

◆ traverse_() [1/2]

template<class Callable >
void sofa::simulation::MappingGraphAlgorithms::traverse_ ( const Callable &  callable,
VisitorApplication  scope,
TaskScheduler taskScheduler 
) const
inline

◆ traverse_() [2/2]

template<class Callable >
void sofa::simulation::MappingGraphAlgorithms::traverse_ ( const Callable &  callable,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const
inline

Traverses the entire mapping graph nodes using a callable function in an arbitrary order.

Template Parameters
CallableThe type of callable object used for visitation.
Parameters
callableThe callable object containing the logic to execute during traversal.
scopeSpecifies which types of nodes should be visited.

◆ traverseBottomUp()

void sofa::simulation::MappingGraphAlgorithms::traverseBottomUp ( MappingGraphVisitor visitor,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const

Traverses the mapping graph in a bottom-up order.

Parameters
visitorThe concrete visitor implementation to process each node.
scopeSpecifies which types of nodes should be visited.

◆ traverseBottomUp_()

template<class Callable >
void sofa::simulation::MappingGraphAlgorithms::traverseBottomUp_ ( const Callable &  callable,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const
inline

Traverses the mapping graph in a bottom-up order using a callable function.

Template Parameters
CallableThe type of callable object used for visitation.
Parameters
callableThe callable object containing the logic to execute during traversal.
scopeSpecifies which types of nodes should be visited.

◆ traverseComponentGroups() [1/2]

void sofa::simulation::MappingGraphAlgorithms::traverseComponentGroups ( MappingGraphVisitor visitor,
VisitorApplication  scope,
TaskScheduler taskScheduler 
) const

◆ traverseComponentGroups() [2/2]

void sofa::simulation::MappingGraphAlgorithms::traverseComponentGroups ( MappingGraphVisitor visitor,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const

Visit and process component groups without any specific order.

Parameters
visitorThe concrete visitor implementation.
scopeSpecifies which types of nodes should be visited. Defaults to ALL_NODES.

◆ traverseComponentGroups_() [1/2]

template<class Callable >
void sofa::simulation::MappingGraphAlgorithms::traverseComponentGroups_ ( const Callable &  callable,
VisitorApplication  scope,
TaskScheduler taskScheduler 
) const
inline

◆ traverseComponentGroups_() [2/2]

template<class Callable >
void sofa::simulation::MappingGraphAlgorithms::traverseComponentGroups_ ( const Callable &  callable,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const
inline

Visit and process component groups without any specific order using a callable function.

Template Parameters
CallableThe type of callable object used for visitation.
Parameters
callableThe callable object containing the logic to execute during traversal.
scopeSpecifies which types of nodes should be visited. Defaults to ALL_NODES.

◆ traverseTopDown()

void sofa::simulation::MappingGraphAlgorithms::traverseTopDown ( MappingGraphVisitor visitor,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const

Traverses the mapping graph in a top-down order.

Parameters
visitorThe concrete visitor implementation to process each node.
scopeSpecifies which types of nodes should be visited.

◆ traverseTopDown_()

template<class Callable >
void sofa::simulation::MappingGraphAlgorithms::traverseTopDown_ ( const Callable &  callable,
VisitorApplication  scope = VisitorApplication::ALL_NODES 
) const
inline

Traverses the mapping graph in a top-down order using a callable function.

Template Parameters
CallableThe type of callable object used for visitation.
Parameters
callableThe callable object containing the logic to execute during traversal.
scopeSpecifies which types of nodes should be visited.