Home - GerdHirsch/Cpp-VisitorFrameworkCyclicAcyclic GitHub Wiki
Purpose
Purpose of this framework is to define a Single Point of Decision (SPoD) for all general properties of a visitor implementation. This means, you can change the properties of your visitors and your visitables at one point in your code without changing any other part but you must recompile your classes depending on their Repository.
You will find the complete example in folder DemoApplication, with an Output of the application and a brief introduction in Example.
Net Effect
Your classes don't have to be derived from any base class, just adapt it and extend it noninvasive with the ability to be visited as shown here.
General Properties to be defined for visitors
This is a Framework for the Visitor Pattern to switch
between Cyclic/Acyclic Visitors
between default and abstract implementation of Visitor::visit
between different DefaultPolicies for Visitor::visit(..) and Visitables::accept(..)
and provides Adapters for NonVisitables with different StoragePolicies (by value, by reference, by std::weak_ptr and by std::unique_ptr as Defaults)
hooks
Application specific template specialization is used to realize specific Logging for Elements and Adapters
inner class Visitable::Accessor to access private Visitable elements. see Accessor
tests
tests are written with CUTE and can be found in VisitorTestCute