Dune Core Modules (2.9.0)
Base class with polymorphic type boiler plate code. More...
#include <dune/functions/common/interfaces.hh>
Public Member Functions | |
virtual | ~PolymorphicType () |
Destructor. | |
virtual Interface * | clone () const =0 |
Clones the object. More... | |
virtual Interface * | clone (void *buffer) const =0 |
Clones the object into buffer. More... | |
virtual Interface * | move (void *buffer)=0 |
Move object into buffer. More... | |
Detailed Description
class Dune::Functions::PolymorphicType< Interface >
Base class with polymorphic type boiler plate code.
By deriving your polymorphic type from this class you enforce a default interface for common operations like clone, clone to buffer, and move.
Member Function Documentation
◆ clone() [1/2]
|
pure virtual |
Clones the object.
clone() needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a new copy of *this via a pointer to newly allocated memory. Remember to delete the resulting pointer.
◆ clone() [2/2]
|
pure virtual |
Clones the object into buffer.
clone(buffer) needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a copy of this created in the given buffer using placement-new with copy construction. You must not delete the returned pointer since it points to the given buffer (however with the proper type instead of void).
◆ move()
|
pure virtual |
Move object into buffer.
move(buffer) needs to be redefined by an implementation class, with the return type covariantly adapted. This will return a copy of this created in the given buffer using placement-new with move construction. You must not delete the returned pointer since it points to the given buffer (however with the proper type instead of void).
The documentation for this class was generated from the following file:
- dune/functions/common/interfaces.hh