Skip to content

sg::dispatch

uncovers the type of SgNode and passes it to an function "handle" in RoseVisitor. which should be overloaded with every possible target node. After the traversal, RoseVisitor should contain the intended return data.

Synopses

Declared in <SageIII/sageInterface/sageGeneric.h>

uncovers the type of SgNode and passes it to an function "handle" in RoseVisitor. which should be overloaded with every possible target node. After the traversal, RoseVisitor should contain the intended return data.

template<class RoseVisitor>
std::remove_const<std::remove_reference<RoseVisitor>::type>::type
dispatch(
    RoseVisitor&& rv,
    SgNode* n);
template<class RoseVisitor>
std::remove_const<std::remove_reference<RoseVisitor>::type>::type
dispatch(
    RoseVisitor&& rv,
    SgNode const* n);

Return Value

a copy of the RoseVisitor object, that will contain the intended return data.

Template Parameters

Name

Description

RoseVisitor.

The visitor that will be called back with the recovered type information. It must implement "handle." The handle function with the most suitable SgNode type will get invoked.

Parameters

Name

Description

rv

an instance of a rose visitor; ie any class with a "handle" function. Note: rv is essentially passed by value (similar to STL's for_each).

n

The root of the tree to visit. SgNode

Created with MrDocs