ORIGINAL
Loading...
Searching...
No Matches
original::baseCloneable< DERIVED > Class Template Reference

Base class that defines a cloneable interface. More...

#include <cloneable.h>

Collaboration diagram for original::baseCloneable< DERIVED >:
Collaboration graph

Public Member Functions

virtual DERIVED * clone () const
 Creates a clone of the current object.
 
virtual ~baseCloneable ()=default
 Virtual destructor for baseCloneable.
 

Protected Member Functions

 baseCloneable ()=default
 Default constructor for baseCloneable.
 

Detailed Description

template<typename DERIVED>
class original::baseCloneable< DERIVED >

Base class that defines a cloneable interface.

Template Parameters
DERIVEDThe type of the derived class.

This class provides the mechanism to clone derived objects by calling clone() in derived classes. It is designed for situations where the cloning behavior does not need to be customized. Derived classes can simply use the default implementation of clone() provided by this class.

Constructor & Destructor Documentation

◆ baseCloneable()

template<typename DERIVED>
original::baseCloneable< DERIVED >::baseCloneable ( )
protecteddefault

Default constructor for baseCloneable.

The constructor is protected to prevent direct instantiation of baseCloneable.

◆ ~baseCloneable()

template<typename DERIVED>
virtual original::baseCloneable< DERIVED >::~baseCloneable ( )
virtualdefault

Virtual destructor for baseCloneable.

Ensures proper destruction of derived objects.

Member Function Documentation

◆ clone()

template<typename DERIVED>
auto original::baseCloneable< DERIVED >::clone ( ) const
nodiscardvirtual

Creates a clone of the current object.

Returns
Pointer to a newly created object of the derived type, identical to the current object.

This function uses dynamic casting to create a new instance of the derived class. This default implementation is sufficient when derived classes do not need to customize their cloning behavior.

class Derived : public baseCloneable<Derived> {
// No need to override clone() if default behavior is sufficient.
};
baseCloneable()=default
Default constructor for baseCloneable.

Reimplemented in original::absTransform< TYPE >, original::addOptTransform< TYPE >, original::array< TYPE, ALLOC >::Iterator, original::assignOptTransform< TYPE >, original::baseIterator< TYPE >, original::baseIterator< bool >, original::bitSet< ALLOC >::Iterator, original::blocksList< TYPE, ALLOC >::Iterator, original::chain< TYPE, ALLOC >::Iterator, original::copyTransform< TYPE, ALLOC >, original::doubleDirectionIterator< TYPE >, original::equalFilter< TYPE >, original::filter< TYPE >, original::forwardChain< TYPE, ALLOC >::Iterator, original::greaterFilter< TYPE >, original::iterable< TYPE >::iterAdaptor, original::iterator< TYPE >, original::iterator< bool >, original::lessFilter< TYPE >, original::multiOptTransform< TYPE >, original::notEqualFilter< TYPE >, original::notGreaterFilter< TYPE >, original::notLessFilter< TYPE >, original::randomAccessIterator< TYPE, ALLOC >, original::rangeFilter< TYPE >, original::singleDirectionIterator< TYPE >, original::stepIterator< TYPE >, original::transform< TYPE >, and original::vector< TYPE, ALLOC >::Iterator.


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