Leosac  0.8.0
Open Source Access Control
Visitor.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "tools/Visitor.hpp"
21 #include "tools/IVisitable.hpp"
22 #include "tools/log.hpp"
23 #include <boost/type_index.hpp>
24 
25 namespace Leosac
26 {
27 
28 namespace Tools
29 {
31 {
32  auto type_index_visitable = boost::typeindex::type_id_runtime(obj);
33  auto type_index_visitor = boost::typeindex::type_id_runtime(*this);
34  ERROR("Cannot visit object of type " << type_index_visitable
35  << " from visitor of type "
36  << type_index_visitor.pretty_name());
37  assert(0 && "Cannot visit");
38 }
39 }
40 }
ERROR
@ ERROR
Definition: log.hpp:32
Leosac::Tools::BaseVisitor::cannot_visit
virtual void cannot_visit(const IVisitable &)
Invoked when the visitable cannot be visited by the visitor.
Definition: Visitor.cpp:30
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Visitor.hpp
Leosac::Tools::IVisitable
Base class to make an object visitable.
Definition: IVisitable.hpp:43
log.hpp
IVisitable.hpp