Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
visitor.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//visitor.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//visitor.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with visitor.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) 2015 - 2021 by Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
22// individual authors of this file include:
23// silviana amethyst, university of wisconsin-eau claire
24//
25
31
32#ifndef BERTINI_DETAIL_VISITOR_HPP
33#define BERTINI_DETAIL_VISITOR_HPP
34#include <boost/type_index.hpp>
35
36namespace bertini{
37
46 { BOOST_TYPE_INDEX_REGISTER_CLASS
47 public:
48 virtual ~VisitorBase() = default;
49 };
50
51
60 template<class VisitedT, typename RetT = void>
61 class Visitor
62 { BOOST_TYPE_INDEX_REGISTER_CLASS
63 public:
64 typedef RetT ReturnType;
65 virtual ReturnType Visit(VisitedT const &) = 0;
66 virtual ~Visitor() = default;
67 };
68
69
70
71}
72
73#endif
A strawman class for implementing the visitor pattern.
Definition visitor.hpp:46
The first non-trivial visitor class.
Definition visitor.hpp:62