$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
doc_serializer.hh
1 // Copyright (C) 2011, 2013 EPITA Research and Development Laboratory (LRDE)
2 //
3 // This file is part of Olena.
4 //
5 // Olena is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation, version 2 of the License.
8 //
9 // Olena is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
16 //
17 // As a special exception, you may use this file as part of a free
18 // software project without restriction. Specifically, if other files
19 // instantiate templates or use macros or inline functions from this
20 // file, or you compile this file and link it with other files to produce
21 // an executable, this file does not by itself cause the resulting
22 // executable to be covered by the GNU General Public License. This
23 // exception does not however invalidate any other reasons why the
24 // executable file might be covered by the GNU General Public License.
25 
26 #ifndef SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH
27 # define SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH
28 
32 
33 # include <scribo/core/concept/serialize_visitor.hh>
34 
35 # include <scribo/core/document.hh>
36 # include <scribo/core/component_set.hh>
37 # include <scribo/core/component_info.hh>
38 # include <scribo/core/paragraph_set.hh>
39 # include <scribo/core/object_groups.hh>
40 # include <scribo/core/object_links.hh>
41 # include <scribo/core/line_links.hh>
42 # include <scribo/core/line_info.hh>
43 
44 namespace scribo
45 {
46 
48  template <typename E>
49  class doc_serializer : public SerializeVisitor<E>
50  {
51  public:
52  // Visit overloads
53  template <typename L>
54  void visit(const document<L>& doc) const;
55 
56  template <typename L>
57  void visit(const line_links<L>& llinks) const;
58 
59  template <typename L>
60  void visit(const object_groups<L>& groups) const;
61 
62  template <typename L>
63  void visit(const object_links<L>& links) const;
64 
65  template <typename L>
66  void visit(const component_set<L>& comp_set) const;
67 
68  template <typename L>
69  void visit(const component_info<L>& info) const;
70 
71  template <typename L>
72  void visit(const paragraph_set<L>& parset) const;
73 
74  template <typename L>
75  void visit(const line_info<L>& line) const;
76  };
77 
78 
79 # ifndef MLN_INCLUDE_ONLY
80 
81  template <typename E>
82  template <typename L>
83  void
84  doc_serializer<E>::visit(const document<L>& /* doc */) const
85  {
86  }
87 
88  template <typename E>
89  template <typename L>
90  void
91  doc_serializer<E>::visit(const line_links<L>& /* llinks */) const
92  {
93  }
94 
95  template <typename E>
96  template <typename L>
97  void
98  doc_serializer<E>::visit(const object_groups<L>& /* groups */) const
99  {
100  }
101 
102  template <typename E>
103  template <typename L>
104  void
105  doc_serializer<E>::visit(const object_links<L>& /* links */) const
106  {
107  }
108 
109  template <typename E>
110  template <typename L>
111  void
112  doc_serializer<E>::visit(const component_set<L>& /* comp_set */) const
113  {
114  }
115 
116  template <typename E>
117  template <typename L>
118  void
119  doc_serializer<E>::visit(const component_info<L>& /* info */) const
120  {
121  }
122 
123  template <typename E>
124  template <typename L>
125  void
126  doc_serializer<E>::visit(const paragraph_set<L>& /* parset */) const
127  {
128  }
129 
130  template <typename E>
131  template <typename L>
132  void
133  doc_serializer<E>::visit(const line_info<L>& /* line */) const
134  {
135  }
136 
137 # endif // ! MLN_INCLUDE_ONLY
138 
139 
140 } // end of namespace scribo
141 
142 #endif // SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH