Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Visitable< TOOL > Class Template Referenceabstract

#include "lib/visitor.hpp"

Description

template<class TOOL = Tool<>>
class lib::visitor::Visitable< TOOL >

Marker interface or base class for all "Visitables".

Concrete types to be treated by a "visiting tool" derive from this interface and need to implement an #apply(Tool&), forwarding to the (internal, static, templated) dispatchOp. This is done best by using the DEFINE_PROCESSABLE_BY macro.

Definition at line 188 of file visitor.hpp.

Public Types

using ReturnType = TOOL::ReturnType
 

Public Member Functions

virtual ReturnType apply (TOOL &)=0
 to be defined by the DEFINE_PROCESSABLE_BY macro in all classes wanting to be treated by some tool
 

Protected Types

using ToolBase = TOOL::ToolBase
 

Protected Member Functions

virtual ~Visitable ()
 

Static Protected Member Functions

template<class TAR >
static ReturnType dispatchOp (TAR &target, TOOL &tool)
 

Constructor & Destructor Documentation

◆ ~Visitable()

template<class TOOL = Tool<>>
virtual ~Visitable ( )
inlineprotectedvirtual

Definition at line 199 of file visitor.hpp.

Member Typedef Documentation

◆ ReturnType

template<class TOOL = Tool<>>
using ReturnType = TOOL::ReturnType

Definition at line 191 of file visitor.hpp.

◆ ToolBase

template<class TOOL = Tool<>>
using ToolBase = TOOL::ToolBase
protected
Note
may differ from TOOL

Definition at line 202 of file visitor.hpp.

Member Function Documentation

◆ apply()

template<class TOOL = Tool<>>
virtual ReturnType apply ( TOOL &  )
pure virtual

to be defined by the DEFINE_PROCESSABLE_BY macro in all classes wanting to be treated by some tool

Referenced by VisitingToolExtended_test::known_visitor_known_class(), VisitingTool_test::visiting_extended_hierarchy(), VisitingToolExtended_test::visiting_mixed_hierarchy(), and VisitingToolExtended_test::visitor_not_visiting_some_class().

+ Here is the caller graph for this function:

◆ dispatchOp()

template<class TOOL = Tool<>>
template<class TAR >
static ReturnType dispatchOp ( TAR &  target,
TOOL &  tool 
)
inlinestaticprotected

used by the DEFINE_PROCESSABLE_BY macro. Dispatches to the actual operation on the "visiting tool" (visitor implementation) Note: creates a context templated on concrete TAR.

Definition at line 211 of file visitor.hpp.

References Dispatcher< TAR, TOOL >::instance.

+ Inheritance diagram for Visitable< TOOL >:
+ Collaboration diagram for Visitable< TOOL >:

The documentation for this class was generated from the following file: