dune-functions  2.5-dev
interfaces.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
4 #define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
5 
6 #include <type_traits>
7 
8 
9 namespace Dune {
10 namespace Functions {
11 
12 
13 
23 template<class Interface>
25 {
26 public:
27 
29  virtual ~PolymorphicType()
30  {}
31 
40  virtual Interface* clone() const = 0;
41 
51  virtual Interface* clone(void* buffer) const = 0;
52 
62  virtual Interface* move(void* buffer) = 0;
63 };
64 
65 
66 
67 }} // namespace Dune::Functions
68 
69 #endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
virtual ~PolymorphicType()
Destructor.
Definition: interfaces.hh:29
Base class with polymorphic type boiler plate code.
Definition: interfaces.hh:24
virtual Interface * clone() const =0
Clones the object.
Definition: polynomial.hh:7
virtual Interface * move(void *buffer)=0
Move object into buffer.