OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
function_impl.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  template function implementation, to serve
23  as the basis for RealFunction and ComplexFunction
24 
25  Author: Ansgar Philippsen
26 */
27 
28 #ifndef IMG_FUNCTION_IMPL_H
29 #define IMG_FUNCTION_IMPL_H
30 
31 #include <ost/img/module_config.hh>
32 #include "function_base.hh"
33 
34 namespace ost { namespace img { namespace detail {
35 
36 template <typename T>
37 class TEMPLATE_EXPORT FunctionImpl: public Function {
38  public:
39 
41  // Data interface
42 
43  virtual DataType GetType() const;
44 
46  // Function interface
47 
48  virtual Real GetIntpolReal(const Vec3 &v) const;
49  virtual Complex GetIntpolComplex(const Vec3 &v) const;
50 
52  // FunctionImpl interface
53 
58  virtual T Func(const Vec3 &v) const = 0;
59 
60  protected:
63 
64  FunctionImpl(const FunctionImpl& f);
65 
66  FunctionImpl& operator=(const FunctionImpl& f);
67 };
68 
69 }}} // namespaces
70 
71 #endif