SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::simulation::tree::GNodeVisitor Class Reference

#include <GNodeVisitor.h>

Inheritance diagram for sofa::simulation::tree::GNodeVisitor:

Detailed Description

Base class for the Visitors which deal with GNodes specifically rather than Node.

@author The SOFA team </www.sofa-framework.org>

Public Member Functions

 GNodeVisitor (const sofa::core::ExecParams *params)
 
 ~GNodeVisitor () override
 
virtual Result processNodeTopDown (GNode *)
 Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE. More...
 
virtual void processNodeBottomUp (GNode *)
 Callback method called after child node have been processed and before going back to the parent node. More...
 
virtual Result processNodeTopDown (GNode *node, LocalStorage *)
 
virtual void processNodeBottomUp (GNode *node, LocalStorage *)
 
Result processNodeTopDown (simulation::Node *node) override
 Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE. More...
 
void processNodeBottomUp (simulation::Node *node) override
 Callback method called after child node have been processed and before going back to the parent node. More...
 
const char * getClassName () const override
 
template<class Visit , class Container , class Object >
void for_each (Visit *visitor, GNode *ctx, const Container &list, void(Visit::*fn)(GNode *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
template<class Visit , class Container , class Object >
Visitor::Result for_each_r (Visit *visitor, GNode *ctx, const Container &list, Visitor::Result(Visit::*fn)(GNode *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
- Public Member Functions inherited from sofa::simulation::Visitor
 Visitor (const core::ExecParams *params)
 
virtual ~Visitor ()
 
const core::ExecParamsexecParams () const
 
virtual bool childOrderReversed (simulation::Node *)
 Return true to reverse the order of traversal of child nodes. More...
 
virtual bool treeTraversal (TreeTraversalRepetition &repeat)
 
virtual const char * getCategoryName () const
 
virtual std::string getInfos () const
 
void debug_write_state_before (core::objectmodel::BaseObject *)
 
void debug_write_state_after (core::objectmodel::BaseObject *)
 
template<class Visit , class VContext , class Container , class Object >
void for_each (Visit *visitor, VContext *ctx, const Container &list, void(Visit::*fn)(VContext *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
template<class Visit , class VContext , class Container , class Object >
Visitor::Result for_each_r (Visit *visitor, VContext *ctx, const Container &list, Visitor::Result(Visit::*fn)(VContext *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
bool testTags (core::objectmodel::BaseObject *obj)
 
virtual void execute (core::objectmodel::BaseContext *node, bool precomputedOrder=false)
 Alias for context->executeVisitor(this) More...
 
virtual ctime_t begin (simulation::Node *node, core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Node *node, core::objectmodel::BaseObject *obj, ctime_t t0)
 
ctime_t begin (simulation::Visitor::VisitorContext *node, core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
void end (simulation::Visitor::VisitorContext *node, core::objectmodel::BaseObject *obj, ctime_t t0)
 
virtual bool isThreadSafe () const
 Specify whether this visitor can be parallelized. More...
 
virtual Result processNodeTopDown (simulation::Node *node, LocalStorage *)
 
virtual void processNodeBottomUp (simulation::Node *node, LocalStorage *)
 
VisitorsetTags (const TagSet &t)
 
VisitoraddTag (Tag t)
 
VisitorremoveTag (Tag t)
 

Additional Inherited Members

- Public Attributes inherited from sofa::simulation::Visitor
TagSet subsetsToManage
 list of the subsets More...
 
bool canAccessSleepingNode
 Can the visitor access sleeping nodes? More...
 
- Protected Attributes inherited from sofa::simulation::Visitor
const core::ExecParamsparams
 

Constructor details

sofa::simulation::tree::GNodeVisitor::GNodeVisitor ( const sofa::core::ExecParams params)
sofa::simulation::tree::GNodeVisitor::~GNodeVisitor ( )
override

Function details

template<class Visit , class Container , class Object >
void sofa::simulation::tree::GNodeVisitor::for_each ( Visit *  visitor,
GNode ctx,
const Container &  list,
void(Visit::*)(GNode *, Object *)  fn 
)
inline

Helper method to enumerate objects in the given list. The callback gets the pointer to node.

template<class Visit , class Container , class Object >
Visitor::Result sofa::simulation::tree::GNodeVisitor::for_each_r ( Visit *  visitor,
GNode ctx,
const Container &  list,
Visitor::Result(Visit::*)(GNode *, Object *)  fn 
)
inline

Helper method to enumerate objects in the given list. The callback gets the pointer to node.

const char* sofa::simulation::tree::GNodeVisitor::getClassName ( ) const
inlineoverridevirtual

Return a class name for this visitor Only used for debugging / profiling purposes

Reimplemented from sofa::simulation::Visitor.

virtual void sofa::simulation::tree::GNodeVisitor::processNodeBottomUp ( GNode )
inlinevirtual

Callback method called after child node have been processed and before going back to the parent node.

Reimplemented in sofa::simulation::tree::ExportDotVisitor.

virtual void sofa::simulation::tree::GNodeVisitor::processNodeBottomUp ( GNode node,
LocalStorage  
)
inlinevirtual

Callback method called after child node have been processed and before going back to the parent node. This version is offered a LocalStorage to store temporary data

void sofa::simulation::tree::GNodeVisitor::processNodeBottomUp ( simulation::Node node)
inlineoverridevirtual

Callback method called after child node have been processed and before going back to the parent node.

Reimplemented from sofa::simulation::Visitor.

virtual Result sofa::simulation::tree::GNodeVisitor::processNodeTopDown ( GNode )
inlinevirtual

Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE.

Reimplemented in sofa::simulation::tree::ExportDotVisitor.

virtual Result sofa::simulation::tree::GNodeVisitor::processNodeTopDown ( GNode node,
LocalStorage  
)
inlinevirtual

Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE This version is offered a LocalStorage to store temporary data

Result sofa::simulation::tree::GNodeVisitor::processNodeTopDown ( simulation::Node node)
inlineoverridevirtual

Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE.

Reimplemented from sofa::simulation::Visitor.