dune-common  2.2.0
function.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set ts=8 sw=2 et sts=2:
3 #ifndef DUNE_FUNCTION_HH
4 #define DUNE_FUNCTION_HH
5 
6 
7 #include "typetraits.hh"
8 
9 namespace Dune {
10 
26  template <class Domain, class Range>
27  class Function
28  {
29  typedef typename ConstantVolatileTraits<typename TypeTraits< Domain >::ReferredType >::UnqualifiedType RawDomainType;
30  typedef typename ConstantVolatileTraits<typename TypeTraits< Range >::ReferredType >::UnqualifiedType RawRangeType;
31 
32  public:
33 
35  typedef RawRangeType RangeType;
36 
38  typedef RawDomainType DomainType;
39 
41  struct Traits
42  {
43  typedef RawDomainType DomainType;
44  typedef RawRangeType RangeType;
45  };
46 
53  void evaluate(Domain x, Range y) const;
54  }; // end of Function class
55 
56 
57 
65  template <class DomainType, class RangeType>
67  public Function<const DomainType&, RangeType&>
68  {
69  public:
70  virtual ~VirtualFunction() {}
77  virtual void evaluate(const DomainType& x, RangeType& y) const = 0;
78  }; // end of VirtualFunction class
79 
82 } // end namespace
83 
84 #endif