dune-functions 2.9.0
|
Base class with polymorphic type boiler plate code. More...
#include <dune/functions/common/interfaces.hh>
Public Member Functions | |
virtual | ~PolymorphicType () |
Destructor. More... | |
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... | |
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.
|
inlinevirtual |
Destructor.
|
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.
|
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).
|
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).