StormByte C++ Library 0.0.9999
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).
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
StormByte::Clonable< T, SmartPointer > Class Template Referenceabstract

A class that can be cloned. More...

#include <clonable.hxx>

Public Types

using PointerType = SmartPointer
 Pointer type.
 

Public Member Functions

constexpr Clonable ()=default
 
constexpr Clonable (const Clonable &)=default
 
constexpr Clonable (Clonable &&) noexcept=default
 
constexpr Clonableoperator= (const Clonable &)=default
 
constexpr Clonableoperator= (Clonable &&) noexcept=default
 
virtual constexpr ~Clonable () noexcept=default
 
virtual PointerType Clone () const =0
 
virtual PointerType Move ()=0
 

Static Public Member Functions

template<class Target , typename... Args>
static PointerType MakePointer (Args &&... args)
 

Detailed Description

template<class T, typename SmartPointer = std::shared_ptr<T>>
requires ValidSmartPointer<SmartPointer, T>
class StormByte::Clonable< T, SmartPointer >

A class that can be cloned.

Constructor & Destructor Documentation

◆ Clonable() [1/3]

template<class T , typename SmartPointer = std::shared_ptr<T>>
constexpr StormByte::Clonable< T, SmartPointer >::Clonable ( )
constexprdefault

Constructor

◆ Clonable() [2/3]

template<class T , typename SmartPointer = std::shared_ptr<T>>
constexpr StormByte::Clonable< T, SmartPointer >::Clonable ( const Clonable< T, SmartPointer > &  )
constexprdefault

Copy constructor

◆ Clonable() [3/3]

template<class T , typename SmartPointer = std::shared_ptr<T>>
constexpr StormByte::Clonable< T, SmartPointer >::Clonable ( Clonable< T, SmartPointer > &&  )
constexprdefaultnoexcept

Move constructor

◆ ~Clonable()

template<class T , typename SmartPointer = std::shared_ptr<T>>
virtual constexpr StormByte::Clonable< T, SmartPointer >::~Clonable ( )
constexprvirtualdefaultnoexcept

Destructor

Member Function Documentation

◆ Clone()

template<class T , typename SmartPointer = std::shared_ptr<T>>
virtual PointerType StormByte::Clonable< T, SmartPointer >::Clone ( ) const
pure virtual

Clones the object

Returns
cloned object

◆ MakePointer()

template<class T , typename SmartPointer = std::shared_ptr<T>>
template<class Target , typename... Args>
static PointerType StormByte::Clonable< T, SmartPointer >::MakePointer ( Args &&...  args)
inlinestatic

Makes a pointer

Template Parameters
TargetThe type of the object to create a pointer for (can be T or a derived type).
ArgsThe constructor arguments for Target.
Parameters
argsArguments to forward to Target's constructor.
Returns
A smart pointer of type PointerType managing the newly created Target.

◆ Move()

template<class T , typename SmartPointer = std::shared_ptr<T>>
virtual PointerType StormByte::Clonable< T, SmartPointer >::Move ( )
pure virtual

Moves the object

Returns
moved object

◆ operator=() [1/2]

template<class T , typename SmartPointer = std::shared_ptr<T>>
constexpr Clonable & StormByte::Clonable< T, SmartPointer >::operator= ( Clonable< T, SmartPointer > &&  )
constexprdefaultnoexcept

Move assignment operator

◆ operator=() [2/2]

template<class T , typename SmartPointer = std::shared_ptr<T>>
constexpr Clonable & StormByte::Clonable< T, SmartPointer >::operator= ( const Clonable< T, SmartPointer > &  )
constexprdefault

Assignment operator


The documentation for this class was generated from the following file: