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

Virtual base providing polymorphic copy construction. More...

#include <QwFactory.h>

+ Inheritance diagram for VQwCloneable< base_t >:

Public Member Functions

virtual ~VQwCloneable ()
 Virtual destructor.
 
std::string GetClassName () const
 Get demangled name of this class.
 
virtual base_t * Clone () const
 Abstract clone method when no derived method is defined.
 
virtual const VQwFactory< base_t > * Factory () const
 Virtual factory getter.
 

Detailed Description

template<class base_t>
class VQwCloneable< base_t >

Virtual base providing polymorphic copy construction.

Template base class that enables runtime cloning of derived objects through a common interface. Part of the factory pattern implementation.

Definition at line 170 of file QwFactory.h.

Constructor & Destructor Documentation

◆ ~VQwCloneable()

template<class base_t>
virtual VQwCloneable< base_t >::~VQwCloneable ( )
inlinevirtual

Virtual destructor.

Definition at line 175 of file QwFactory.h.

175{ }

Member Function Documentation

◆ Clone()

template<class base_t>
virtual base_t * VQwCloneable< base_t >::Clone ( ) const
inlinevirtual

Abstract clone method when no derived method is defined.

Reimplemented in MQwCloneable< base_t, type_t >, MQwCloneable< VQwDataElement, dataelement_t >, MQwCloneable< VQwDataHandler, LRBCorrector >, MQwCloneable< VQwDataHandler, QwAlarmHandler >, MQwCloneable< VQwDataHandler, QwCombiner >, MQwCloneable< VQwDataHandler, QwCorrelator >, MQwCloneable< VQwDataHandler, QwExtractor >, MQwCloneable< VQwDataHandler, subsystem_t >, MQwCloneable< VQwSubsystem, QwBeamLine >, MQwCloneable< VQwSubsystem, QwBeamMod >, MQwCloneable< VQwSubsystem, QwBlindDetectorArray >, MQwCloneable< VQwSubsystem, QwCombinerSubsystem >, MQwCloneable< VQwSubsystem, QwDetectorArray >, MQwCloneable< VQwSubsystem, QwHelicity >, MQwCloneable< VQwSubsystem, QwIntegratedRaster >, MQwCloneable< VQwSubsystem, QwMollerDetector >, MQwCloneable< VQwSubsystem, QwScaler >, and MQwCloneable< VQwSubsystem, subsystem_t >.

Definition at line 188 of file QwFactory.h.

188 {
189 QwError << "Clone() is not implemented for class " << GetClassName() << "!" << QwLog::endl;
190 QwMessage << "Modify the class definition of " << GetClassName() << " to:" << QwLog::endl;
191 QwMessage << " class " << GetClassName() << ": "
192 << "public MQwSomethingCloneable<" << GetClassName() << ">" << QwLog::endl;
193 return 0;
194 }
Virtual base providing polymorphic copy construction.
Definition QwFactory.h:170
std::string GetClassName() const
Get demangled name of this class.
Definition QwFactory.h:178

References QwLog::endl(), GetClassName(), QwError, and QwMessage.

+ Here is the call graph for this function:

◆ Factory()

◆ GetClassName()

template<class base_t>
std::string VQwCloneable< base_t >::GetClassName ( ) const
inline

Get demangled name of this class.

Definition at line 178 of file QwFactory.h.

178 {
179 int status;
180 const std::type_index ti = typeid(*this);
181 char* name = abi::__cxa_demangle(ti.name(), 0, 0, &status);
183 free(name);
184 return str;
185 }

Referenced by Clone().

+ Here is the caller graph for this function:

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