DUNE-FUNCTIONS (unstable)

interfaces.hh
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
Base class with polymorphic type boiler plate code.
Definition: interfaces.hh:25
virtual Interface * move(void *buffer)=0
Move object into buffer.
virtual Interface * clone() const =0
Clones the object.
virtual Interface * clone(void *buffer) const =0
Clones the object into buffer.
virtual ~PolymorphicType()
Destructor.
Definition: interfaces.hh:29
Definition: polynomial.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 16, 22:29, 2024)