OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
data_algorithm.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 // Copyright (C) 2003-2010 by the IPLT authors
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 3.0 of the License, or (at your option)
10 // any later version.
11 // This library is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 // details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //------------------------------------------------------------------------------
20 
21 /*
22  Data algorithm abstract base classes
23 
24  Author: Ansgar Philippsen
25 */
26 
27 #ifndef IMG_DATA_ALG_H
28 #define IMG_DATA_ALG_H
29 
30 #include <ost/img/module_config.hh>
31 #include "image_fw.hh"
32 
33 /*
34  TODO:
35 
36  add info object as parameter in base class, this guarantees that every
37  algorithm has access to an info object for logging
38 */
39 
40 namespace ost { namespace img {
41 
43 
48  public:
50  const String& GetName() const;
51 
52  virtual ~AlgorithmBase();
53 
54  protected:
56  AlgorithmBase(const String& n);
57 
58  AlgorithmBase(const AlgorithmBase& a);
59  AlgorithmBase& operator=(const AlgorithmBase& b);
60 
61  private:
62  String name_;
63 };
64 
67 {
68 public:
70  virtual void Visit(const ConstImageHandle& i) = 0;
71 
72 protected:
74  NonModAlgorithm(const String& name);
78  NonModAlgorithm& operator=(const NonModAlgorithm& a);
79 };
80 
81 
83 
90 {
91 public:
92  virtual void Visit(ImageHandle& ih) = 0;
93 protected:
94  ModIPAlgorithm(const String& name);
96  ModIPAlgorithm& operator=(const ModIPAlgorithm& a);
97 };
98 
99 
101 
108 {
109 public:
110  virtual void Visit(ImageHandle& ih) const = 0;
111 protected:
112  ConstModIPAlgorithm(const String& name);
114  ConstModIPAlgorithm& operator=(const ConstModIPAlgorithm& a);
115 };
116 
117 
119 
126 {
127 public:
128  virtual ImageHandle Visit(const ConstImageHandle& ih) = 0;
129 
130 protected:
131  ModOPAlgorithm(const String& name);
132  ModOPAlgorithm(const ModOPAlgorithm& a);
133  ModOPAlgorithm& operator=(const ModOPAlgorithm& a);
134 };
135 
137 
144 {
145 public:
146  virtual ImageHandle Visit(const ConstImageHandle& ih) const= 0;
147 
148 protected:
149  ConstModOPAlgorithm(const String& name);
151  ConstModOPAlgorithm& operator=(const ConstModOPAlgorithm& a);
152 };
153 
154 }} // namespace
155 
156 #endif