ATLAS Offline Software
Loading...
Searching...
No Matches
IParticleLinkContainerToIParticleContainerConverter Class Reference

#include <IParticleLinkContainer.h>

Inheritance diagram for IParticleLinkContainerToIParticleContainerConverter:
Collaboration diagram for IParticleLinkContainerToIParticleContainerConverter:

Public Types

typedef IParticleContainer target_type
 The destination class.

Public Member Functions

virtual void convert (const IParticleLinkContainer &src, IParticleContainer &dst) const
 Convert the contents of an instance of the source class SRC to an instance of the destination class DST.
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.

Detailed Description

Member Typedef Documentation

◆ target_type

The destination class.

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

Member Function Documentation

◆ convert()

virtual void IParticleLinkContainerToIParticleContainerConverter::convert ( const IParticleLinkContainer & src,
IParticleContainer & dst ) const
inlinevirtual

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

(Type-safe version.)

Implements SG::CopyConversion< IParticleLinkContainer, IParticleContainer >.

Definition at line 42 of file NavFourMom/NavFourMom/IParticleLinkContainer.h.

44 {
45 size_t sz = src.size();
46 if (dst.size() != sz) {
48 dst.reserve (sz);
49 for (size_t i = 0; i < sz; i++) {
50 const IParticle* p = *(src[i]).cptr();
51 // FIXME: Ok, since the target ends up recorded in the event
52 // store as const. But should change the interfaces so that
53 // we get a ConstDataVector to fill.
54 IParticle* p_nc ATLAS_THREAD_SAFE = const_cast<IParticle*> (p);
55 dst.push_back (p_nc);
56 }
57 }
58 }
static Double_t sz
#define ATLAS_THREAD_SAFE
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void clear()
Erase all the elements in the collection.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts

◆ convertUntyped()

virtual void SG::CopyConversion< IParticleLinkContainer, IParticleContainer >::convertUntyped ( const void * src,
void * dst ) const
inlineoverridevirtualinherited

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 IParticleLinkContainer &src, IParticleContainer &dst) const=0

◆ create()

virtual void * SG::CopyConversion< IParticleLinkContainer, IParticleContainer >::create ( ) const
inlineoverridevirtualinherited

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()

virtual void SG::CopyConversion< IParticleLinkContainer, IParticleContainer >::destroy ( void * p) const
inlineoverridevirtualinherited

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: