File kernel/src/utils/SiconosTools/Question.hpp#

Go to the source code of this file

ask something to a class with a visitor

Functions

template<class GeneralQuestion, class Visitable>
GeneralQuestion::type ask(const Visitable &v)#

get some value from a visitable object with the help of a GeneralQuestion

Parameters:

v – a visitable object

template<class GeneralQuestion, class Visitable, class Argument>
GeneralQuestion::type ask(const Visitable &v, const Argument &arg)#

get some value from a visitable object with the help of a parameterized GeneralQuestion

Parameters:
  • v – a visitable object

  • arg – the GeneralQuestion argument

template<class Visitor, class Visitable>
void apply(const Visitable &v)#

apply a SiconosVisitor to a visitable object

Parameters:

v – a visitable object

template<class VisitorWithArgument, class Visitable, class Argument>
void apply(const Visitable &v, const Argument &arg)#

apply a parameterized SiconosVisitor to a visitable object

Parameters:
template<class VisitorWith2Arguments, class Visitable, class Argument1, class Argument2>
void apply(const Visitable &v, const Argument1 &arg1, const Argument2 &arg2)#

apply a parameterized SiconosVisitor to a visitable object

Parameters:
template<class AnswerType>
struct Question : public SiconosVisitor#
#include <Question.hpp>

example :

struct ForMass : public Question<SP::SiconosMatrix> { void visit(const LagrangianDS& ds) { Question::answer = ds.mass(); }

} SP::DynamicalSystem ds […]

SP::SiconosMatrix mass = ask<ForMass>(*ds); a generic return value visitor

Public Types

typedef AnswerType type#

Public Functions

inline Question()#
inline Question(AnswerType ref)#

Public Members

type answer#