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
v – a visitable object
arg – the SiconosVisitor argument
-
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
v – a visitable object
arg1 – the first SiconosVisitor argument
arg2 – the second SiconosVisitor argument
-
template<class AnswerType>
struct Question : public SiconosVisitor¶ - #include <>
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¶
-
typedef AnswerType type¶