OpenStructure
Loading...
Searching...
No Matches
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-2020 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
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
40namespace ost { namespace img {
41
43
48 public:
50 const String& GetName() const;
51
52 virtual ~AlgorithmBase();
53
54 protected:
57
60
61 private:
62 String name_;
63};
64
67{
68public:
70 virtual void Visit(const ConstImageHandle& i) = 0;
71
72protected:
74 NonModAlgorithm(const String& name);
79};
80
81
83
90{
91public:
92 virtual void Visit(ImageHandle& ih) = 0;
93protected:
94 ModIPAlgorithm(const String& name);
97};
98
99
101
116
117
119
126{
127public:
128 virtual ImageHandle Visit(const ConstImageHandle& ih) = 0;
129
130protected:
131 ModOPAlgorithm(const String& name);
134};
135
137
153
154}} // namespace
155
156#endif
Algorithm base class.
const String & GetName() const
Return name of algorithm.
AlgorithmBase(const AlgorithmBase &a)
AlgorithmBase & operator=(const AlgorithmBase &b)
AlgorithmBase(const String &n)
Constructor must be initialized with algorithm name.
read-only ImageHandle implementation
In-place modification const algorithm.
ConstModIPAlgorithm(const String &name)
ConstModIPAlgorithm(const ConstModIPAlgorithm &a)
virtual void Visit(ImageHandle &ih) const =0
ConstModIPAlgorithm & operator=(const ConstModIPAlgorithm &a)
out-of-place modification const algorithm
ConstModOPAlgorithm(const String &name)
ConstModOPAlgorithm(const ConstModOPAlgorithm &a)
virtual ImageHandle Visit(const ConstImageHandle &ih) const =0
ConstModOPAlgorithm & operator=(const ConstModOPAlgorithm &a)
Manage shared instances of images.
In-place modification algorithm.
ModIPAlgorithm & operator=(const ModIPAlgorithm &a)
ModIPAlgorithm(const ModIPAlgorithm &a)
ModIPAlgorithm(const String &name)
virtual void Visit(ImageHandle &ih)=0
out-of-place modification algorithm
virtual ImageHandle Visit(const ConstImageHandle &ih)=0
ModOPAlgorithm(const String &name)
ModOPAlgorithm(const ModOPAlgorithm &a)
ModOPAlgorithm & operator=(const ModOPAlgorithm &a)
Non-modifying Algorithm, abstract base class.
NonModAlgorithm(const String &name)
ctor, must be initialized with name
virtual void Visit(const ConstImageHandle &i)=0
visitor implementation for images
NonModAlgorithm(const NonModAlgorithm &a)
copy ctor
NonModAlgorithm & operator=(const NonModAlgorithm &a)
assignement op
#define DLLEXPORT_OST_IMG_BASE
std::string String
Definition base.hh:54
Definition base.dox:1