SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::simulation::FindByTypeVisitor< T > Class Template Reference

#include <FindByTypeVisitor.h>

Inheritance diagram for sofa::simulation::FindByTypeVisitor< T >:

Detailed Description

template<class T>
class sofa::simulation::FindByTypeVisitor< T >

Find all components of a given type and store pointers in a list.

Public Attributes

std::vector< T * > found
 The result of the search: contains pointers to all components of the given type found. More...
 
- Public Attributes inherited from sofa::simulation::Visitor
TagSet subsetsToManage
 list of the subsets More...
 
bool canAccessSleepingNode
 Can the visitor access sleeping nodes? More...
 

Public Member Functions

 FindByTypeVisitor (const core::ExecParams *params)
 
Result processNodeTopDown (simulation::Node *node) override
 For each component, if it is of the given type, then put it in the list. More...
 
const chargetClassName () const override
 
virtual std::string getInfos () const override
 
- Public Member Functions inherited from sofa::simulation::Visitor
 Visitor (const sofa::core::ExecParams *params)
 
virtual ~Visitor ()
 
const sofa::core::ExecParamsexecParams () const
 
virtual void processNodeBottomUp (simulation::Node *)
 Callback method called after child node have been processed and before going back to the parent node. More...
 
virtual bool childOrderReversed (simulation::Node *)
 Return true to reverse the order of traversal of child nodes. More...
 
virtual bool treeTraversal (TreeTraversalRepetition &repeat)
 
virtual const chargetCategoryName () const
 
bool testTags (sofa::core::objectmodel::BaseObject *obj)
 
virtual void execute (sofa::core::objectmodel::BaseContext *node, bool precomputedOrder=false)
 Alias for context->executeVisitor(this) More...
 
virtual ctime_t begin (simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, ctime_t t0)
 
virtual ctime_t begin (simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Visitor::VisitorContext *node, sofa::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 *)=delete
 
virtual void processNodeBottomUp (simulation::Node *node, LocalStorage *)=delete
 
VisitorsetTags (const TagSet &t)
 
VisitoraddTag (Tag t)
 
VisitorremoveTag (Tag t)
 
template<class VisitorType , class VContext , class Container , typename PointedType >
void for_each (VisitorType *visitor, VContext *ctx, const Container &list, void(VisitorType::*task)(VContext *, PointedType *), const std::string &typeInfo)
 
template<class VisitorType , class VContext , class Container , typename PointedType >
Visitor::Result for_each (VisitorType *visitor, VContext *ctx, const Container &list, Visitor::Result(VisitorType::*task)(VContext *, PointedType *), const std::string &typeInfo)
 

Additional Inherited Members

- Protected Attributes inherited from sofa::simulation::Visitor
const sofa::core::ExecParamsparams
 
- Protected Member Functions inherited from sofa::simulation::Visitor
void debug_write_state_before (sofa::core::objectmodel::BaseObject *obj)
 
void debug_write_state_after (sofa::core::objectmodel::BaseObject *obj)
 
template<class VisitorType , class VContext , class ObjectType >
void runVisitorTask (VisitorType *visitor, VContext *ctx, void(VisitorType::*task)(VContext *, ObjectType *), ObjectType *ptr, const std::string &typeInfo=std::string("type"))
 
template<class VisitorType , class VContext , class ObjectType >
Result runVisitorTask (VisitorType *visitor, VContext *ctx, Result(VisitorType::*task)(VContext *, ObjectType *), ObjectType *ptr, const std::string &typeInfo=std::string("type"))
 
template<class Visit , class VContext , class Container , typename PointedType = typename Container::pointed_type>
void for_each (Visit *visitor, VContext *ctx, const Container &list, void(Visit::*task)(VContext *, PointedType *), const std::string &typeInfo=std::string("type"))
 
template<class Visit , class VContext , class Container , typename PointedType = typename Container::pointed_type>
Visitor::Result for_each (Visit *visitor, VContext *ctx, const Container &list, Visitor::Result(Visit::*task)(VContext *, PointedType *), const std::string &typeInfo=std::string("type"))
 

Attribute details

◆ found

template<class T >
std::vector<T*> sofa::simulation::FindByTypeVisitor< T >::found

The result of the search: contains pointers to all components of the given type found.

Constructor details

◆ FindByTypeVisitor()

template<class T >
sofa::simulation::FindByTypeVisitor< T >::FindByTypeVisitor ( const core::ExecParams params)
inline

Function details

◆ getClassName()

template<class T >
const char* sofa::simulation::FindByTypeVisitor< T >::getClassName ( ) const
inlineoverridevirtual

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

Reimplemented from sofa::simulation::Visitor.

◆ getInfos()

template<class T >
virtual std::string sofa::simulation::FindByTypeVisitor< T >::getInfos ( ) const
inlineoverridevirtual

Return eventual information on the behavior of the visitor Only used for debugging / profiling purposes

Reimplemented from sofa::simulation::Visitor.

◆ processNodeTopDown()

template<class T >
Result sofa::simulation::FindByTypeVisitor< T >::processNodeTopDown ( simulation::Node node)
inlineoverridevirtual

For each component, if it is of the given type, then put it in the list.

Reimplemented from sofa::simulation::Visitor.