owlcpp  v0.3.3~
C++ library for working with OWL ontologies
 All Classes Namespaces Files Functions Macros Pages
visitor_node.hpp
Go to the documentation of this file.
1 
6 #ifndef VISITOR_NODE_HPP_
7 #define VISITOR_NODE_HPP_
8 #include <string>
10 
11 namespace owlcpp{
12 
15 class Visitor_node {
16 public:
17  void visit(Node_iri const& node) {visit_impl(node);}
18  void visit(Node_blank const& node) {visit_impl(node);}
19  void visit(Node_bool const& node) {visit_impl(node);}
20  void visit(Node_int const& node) {visit_impl(node);}
21  void visit(Node_unsigned const& node) {visit_impl(node);}
22  void visit(Node_double const& node) {visit_impl(node);}
23  void visit(Node_string const& node) {visit_impl(node);}
24 
25  virtual ~Visitor_node() {}
26 private:
27  virtual void visit_impl(Node_iri const&) = 0;
28  virtual void visit_impl(Node_blank const&) = 0;
29  virtual void visit_impl(Node_bool const&) = 0;
30  virtual void visit_impl(Node_int const&) = 0;
31  virtual void visit_impl(Node_unsigned const&) = 0;
32  virtual void visit_impl(Node_double const&) = 0;
33  virtual void visit_impl(Node_string const&) = 0;
34 };
35 
36 #define OWLCPP_VISITABLE \
37  void accept_impl(Visitor_node& visitor) const {visitor.visit(*this);} \
38 /* */
39 
40 
41 }//namespace owlcpp
42 #endif /* VISITOR_NODE_HPP_ */