JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
MQwCloneable< base_t, type_t > Class Template Reference

Mix-in template for concrete cloneable types. More...

#include <QwFactory.h>

+ Inheritance diagram for MQwCloneable< base_t, type_t >:
+ Collaboration diagram for MQwCloneable< base_t, type_t >:

Public Member Functions

 ~MQwCloneable () override
 Virtual destructor.
 
base_t * Clone () const override
 Concrete clone method.
 
const VQwFactory< base_t > * Factory () const override
 Factory getter.
 
- Public Member Functions inherited from VQwCloneable< base_t >
virtual ~VQwCloneable ()
 Virtual destructor.
 
std::string GetClassName () const
 Get demangled name of this class.
 

Static Public Member Functions

static base_t * Create (const std::string &name)
 Object creation.
 
static type_t * Cast (type_t *type)
 Object dynamic cast.
 

Static Private Attributes

static const VQwFactory< base_t > * fFactory
 Pointer to the factory of this type.
 

Detailed Description

template<class base_t, class type_t>
class MQwCloneable< base_t, type_t >

Mix-in template for concrete cloneable types.

Implements the curiously recurring template pattern to provide concrete clone functionality for specific derived types. Enables factory-based object creation and copying.

Definition at line 212 of file QwFactory.h.

Constructor & Destructor Documentation

◆ ~MQwCloneable()

template<class base_t, class type_t>
MQwCloneable< base_t, type_t >::~MQwCloneable ( )
inlineoverride

Virtual destructor.

Definition at line 217 of file QwFactory.h.

217{ };

Member Function Documentation

◆ Cast()

template<class base_t, class type_t>
static type_t * MQwCloneable< base_t, type_t >::Cast ( type_t * type)
inlinestatic

Object dynamic cast.

Definition at line 234 of file QwFactory.h.

234 {
235 if (fFactory) return fFactory->Cast(type);
236 else return 0;
237 }
Mix-in template for concrete cloneable types.
Definition QwFactory.h:212
static const VQwFactory< base_t > * fFactory
Pointer to the factory of this type.
Definition QwFactory.h:242

References fFactory.

◆ Clone()

template<class base_t, class type_t>
base_t * MQwCloneable< base_t, type_t >::Clone ( ) const
inlineoverridevirtual

Concrete clone method.

Reimplemented from VQwCloneable< base_t >.

Definition at line 220 of file QwFactory.h.

220 {
221 return new type_t(static_cast<const type_t&>(*this));
222 }

◆ Create()

template<class base_t, class type_t>
static base_t * MQwCloneable< base_t, type_t >::Create ( const std::string & name)
inlinestatic

Object creation.

Definition at line 228 of file QwFactory.h.

228 {
229 if (fFactory) return fFactory->Create(name);
230 else return 0;
231 }

References fFactory.

◆ Factory()

template<class base_t, class type_t>
const VQwFactory< base_t > * MQwCloneable< base_t, type_t >::Factory ( ) const
inlineoverridevirtual

Factory getter.

Reimplemented from VQwCloneable< base_t >.

Definition at line 225 of file QwFactory.h.

225{ return fFactory; }

References fFactory.

Field Documentation

◆ fFactory

template<class base_t, class type_t>
const VQwFactory<base_t>* MQwCloneable< base_t, type_t >::fFactory
staticprivate

Pointer to the factory of this type.

Definition at line 242 of file QwFactory.h.

Referenced by Cast(), Create(), and Factory().


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