Leosac  0.8.0
Open Source Access Control
Leosac::Tools::IVisitable Class Referenceabstract

Base class to make an object visitable. More...

#include <IVisitable.hpp>

+ Inheritance diagram for Leosac::Tools::IVisitable:

Public Member Functions

virtual void accept (::Leosac::Tools::BaseVisitor &)=0
 Accept a visitor that may mutate this. More...
 
virtual void accept (::Leosac::Tools::BaseVisitor &) const =0
 Accept a visitor that will not mutate this. More...
 

Static Protected Member Functions

template<class T >
static bool visitor_dispatch (T &visited, BaseVisitor &visitor, bool abort_on_failure)
 

Detailed Description

Base class to make an object visitable.

An type wishing to be visitable can simply inherit from this class and call the MAKE_VISITABLE() macro in a public section of its definition.

The visitor/visitable infrastructure is NOT statically checked. What this means is that accept()ing a visitor that is not able to visit us will result in an assert.

See also
Leosac::Tools::Visitor

Definition at line 43 of file IVisitable.hpp.

Member Function Documentation

◆ accept() [1/2]

virtual void Leosac::Tools::IVisitable::accept ( ::Leosac::Tools::BaseVisitor ) const
pure virtual

Accept a visitor that will not mutate this.

◆ accept() [2/2]

virtual void Leosac::Tools::IVisitable::accept ( ::Leosac::Tools::BaseVisitor )
pure virtual

Accept a visitor that may mutate this.

◆ visitor_dispatch()

template<class T >
static bool Leosac::Tools::IVisitable::visitor_dispatch ( T &  visited,
BaseVisitor visitor,
bool  abort_on_failure 
)
inlinestaticprotected

Definition at line 58 of file IVisitable.hpp.


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