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 "function_fw.hh"
32 #include "image_fw.hh"
33 
34 /*
35  TODO:
36 
37  add info object as parameter in base class, this guarantees that every
38  algorithm has access to an info object for logging
39 */
40 
41 namespace ost { namespace img {
42 
44 
49  public:
51  const String& GetName() const;
52 
53  virtual ~AlgorithmBase();
54 
55  protected:
57  AlgorithmBase(const String& n);
58 
59  AlgorithmBase(const AlgorithmBase& a);
60  AlgorithmBase& operator=(const AlgorithmBase& b);
61 
62  private:
63  String name_;
64 };
65 
68 {
69 public:
71  virtual void Visit(const ConstImageHandle& i) = 0;
73  virtual void Visit(const Function& f) = 0;
74 
75 protected:
77  NonModAlgorithm(const String& name);
81  NonModAlgorithm& operator=(const NonModAlgorithm& a);
82 };
83 
84 
86 
93 {
94 public:
95  virtual void Visit(ImageHandle& ih) = 0;
96 protected:
97  ModIPAlgorithm(const String& name);
99  ModIPAlgorithm& operator=(const ModIPAlgorithm& a);
100 };
101 
102 
104 
111 {
112 public:
113  virtual void Visit(ImageHandle& ih) const = 0;
114 protected:
115  ConstModIPAlgorithm(const String& name);
117  ConstModIPAlgorithm& operator=(const ConstModIPAlgorithm& a);
118 };
119 
120 
122 
129 {
130 public:
131  virtual ImageHandle Visit(const ConstImageHandle& ih) = 0;
132 
133 protected:
134  ModOPAlgorithm(const String& name);
135  ModOPAlgorithm(const ModOPAlgorithm& a);
136  ModOPAlgorithm& operator=(const ModOPAlgorithm& a);
137 };
138 
140 
147 {
148 public:
149  virtual ImageHandle Visit(const ConstImageHandle& ih) const= 0;
150 
151 protected:
152  ConstModOPAlgorithm(const String& name);
154  ConstModOPAlgorithm& operator=(const ConstModOPAlgorithm& a);
155 };
156 
157 }} // namespace
158 
159 #endif