File kernel/src/utils/SiconosTools/SiconosVisitor.hpp

Go to the source code of this file

A general visitor interface for siconos objects.

Defines

SICONOS_VISITOR_QUOTE(M)

A visitor pattern.

User has to instantiate a derivation of SiconosVisitor class :

struct myvisitor : public SiconosVisitor { void visit(const LagrangianDS& ds) { … } }

with some wanted visit() functions.

Then the visitor may be used as :

A_visitable_Siconos_Object->accept(Siconos::Visitor myvisitor)

SiconosVisitor also define a type visitor object under the namespace Type:: and some functions to access type of visitables classes:

Type::value(c) : the type of the visitable object c as an enum.

Type::name(c) : the name of the Type::value as a std::string

SICONOS_VISITOR_FAIL(X)
VIRTUAL_ACCEPT_VISITORS(FROMCLASS)

hook to be inserted in a virtual class definiton

ACCEPT_STD_VISITORS()

hooks to be inserted in class definition

ACCEPT_NONVIRTUAL_VISITORS()
ACCEPT_SP_VISITORS()
ACCEPT_VISITORS()
ACCEPT_BASE_STD_VISITORS(BASE)

hooks to be inserted in class definition

ACCEPT_BASE_NONVIRTUAL_VISITORS(BASE)
ACCEPT_BASE_SP_VISITORS(BASE)
ACCEPT_BASE_VISITORS(BASE)
REGISTER(X)
REGISTER_STRUCT(X)
REGISTER_BASE(X, Y)
REGISTER_BASE_EXTERN(X, Y)
REGISTER(X)
REGISTER_STRUCT(X)
REGISTER_BASE(X, Y)
REGISTER_BASE_EXTERN(X, Y)
REGISTER(X)
REGISTER_STRUCT(X)
REGISTER_BASE(X, Y)
REGISTER_BASE_EXTERN(X, Y)
REGISTER(X)
REGISTER_STRUCT(X)
REGISTER_BASE(X, Y)
REGISTER_BASE_EXTERN(X, Y)
struct FindType
struct SiconosVisitor

Subclassed by D1MinusLinearOSI::_NSLEffectOnFreeOutput, MoreauJeanOSI::_NSLEffectOnFreeOutput, Question< AnswerType >

Public Functions

virtual ~SiconosVisitor() noexcept = default
namespace Type

Enums

enum Siconos

Values:

enumerator void_type

Functions

template<typename C>
inline Siconos value(const C &c)

Variables

static FindType find