ATLAS Offline Software
Loading...
Searching...
No Matches
SG::CopyConversion< SRC, DST > Class Template Referenceabstract

Base class for copy conversions, templated on source and destination classes. More...

#include <BaseInfo.h>

Inheritance diagram for SG::CopyConversion< SRC, DST >:
Collaboration diagram for SG::CopyConversion< SRC, DST >:

Public Types

typedef DST target_type
 The destination class.

Public Member Functions

virtual void * create () const override
 Create an instance of the destination class.
virtual void destroy (void *p) const override
 Destroy an instance of the destination class.
virtual void convertUntyped (const void *src, void *dst) const override
 Convert the contents of an instance of the source class SRC to an instance of the destination class DST.
virtual void convert (const SRC &src, DST &dst) const =0
 Convert the contents of an instance of the source class SRC to an instance of the destination class DST.

Detailed Description

template<class SRC, class DST>
class SG::CopyConversion< SRC, DST >

Base class for copy conversions, templated on source and destination classes.

Definition at line 406 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

Member Typedef Documentation

◆ target_type

template<class SRC, class DST>
typedef DST SG::CopyConversion< SRC, DST >::target_type

The destination class.

Definition at line 411 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

Member Function Documentation

◆ convert()

template<class SRC, class DST>
virtual void SG::CopyConversion< SRC, DST >::convert ( const SRC & src,
DST & dst ) const
pure virtual

Convert the contents of an instance of the source class SRC to an instance of the destination class DST.

(Type-safe version.)

Implemented in INav4MomLinkContainerToINavigable4MomentumCollectionConverter, and IParticleLinkContainerToIParticleContainerConverter.

◆ convertUntyped()

template<class SRC, class DST>
virtual void SG::CopyConversion< SRC, DST >::convertUntyped ( const void * src,
void * dst ) const
inlineoverridevirtual

Convert the contents of an instance of the source class SRC to an instance of the destination class DST.

Implements SG::CopyConversionBase.

Definition at line 421 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

422 {
423 convert (*reinterpret_cast<const SRC*>(src),
424 *reinterpret_cast<DST*>(dst));
425 }
Base class for copy conversions, templated on source and destination classes.
virtual void convert(const SRC &src, DST &dst) const =0
Convert the contents of an instance of the source class SRC to an instance of the destination class D...

◆ create()

template<class SRC, class DST>
virtual void * SG::CopyConversion< SRC, DST >::create ( ) const
inlineoverridevirtual

Create an instance of the destination class.

Implements SG::CopyConversionBase.

Definition at line 414 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

414{ return new DST; }

◆ destroy()

template<class SRC, class DST>
virtual void SG::CopyConversion< SRC, DST >::destroy ( void * p) const
inlineoverridevirtual

Destroy an instance of the destination class.

Implements SG::CopyConversionBase.

Definition at line 417 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

417{ delete reinterpret_cast<DST*>(p); }

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