|
StormByte C++ Library 1.2.0
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
|
Polymorphic clone/move into a smart pointer of type T.
More...
#include <StormByte/clonable.hxx>
Public Types | |
| using | PointerType = SmartPointer |
SmartPointer alias. | |
Public Member Functions | |
| constexpr | Clonable ()=default |
| Default constructor. | |
| constexpr | Clonable (const Clonable &)=default |
| Copy constructor. | |
| constexpr | Clonable (Clonable &&) noexcept=default |
| Move constructor. | |
| constexpr Clonable & | operator= (const Clonable &)=default |
| Copy assignment. | |
| constexpr Clonable & | operator= (Clonable &&) noexcept=default |
| Move assignment. | |
| virtual constexpr | ~Clonable () noexcept=default |
| Destructor. | |
| virtual PointerType | Clone () const =0 |
Deep copy into a new PointerType. | |
| virtual PointerType | Move ()=0 |
Moves this object into a new PointerType. | |
Static Public Member Functions | |
| template<class Target , typename... Args> | |
| static PointerType | MakePointer (Args &&... args) |
Allocates Target and returns it as PointerType. | |
Polymorphic clone/move into a smart pointer of type T.
| T | Most-derived interface stored in the pointer. |
| SmartPointer | std::shared_ptr<T> (default) or std::unique_ptr<T>. |
| using StormByte::Clonable< T, SmartPointer >::PointerType = SmartPointer |
SmartPointer alias.
|
constexprdefault |
Default constructor.
|
constexprdefault |
Copy constructor.
|
constexprdefaultnoexcept |
Move constructor.
|
constexprvirtualdefaultnoexcept |
Destructor.
|
pure virtual |
Deep copy into a new PointerType.
|
static |
Allocates Target and returns it as PointerType.
| Target | Concrete type (T or derived). |
| Args | Constructor argument types. |
| args | Forwarded to Target. |
shared_ptr or unique_ptr according to PointerType.
|
pure virtual |
Moves this object into a new PointerType.
|
constexprdefaultnoexcept |
Move assignment.
|
constexprdefault |
Copy assignment.