ATLAS Offline Software
Public Types | Public Member Functions | List of all members
IParticleLinkContainerToIParticleContainerConverter Class Referenceabstract

#include <IParticleLinkContainer.h>

Inheritance diagram for IParticleLinkContainerToIParticleContainerConverter:
Collaboration diagram for IParticleLinkContainerToIParticleContainerConverter:

Public Types

typedef IParticleContainer target_type
 The destination class. More...
 

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. More...
 
virtual void * create () const override
 Create an instance of the destination class. More...
 
virtual void * create () const =0
 Create an instance of the destination class. More...
 
virtual void destroy (void *p) const override
 Destroy an instance of the destination class. More...
 
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. More...
 

Detailed Description

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

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  }

◆ 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  }

◆ create() [1/2]

virtual void* SG::CopyConversionBase::create ( ) const
pure virtualinherited

Create an instance of the destination class.

Implemented in SG::CopyConversion< SRC, DST >.

◆ create() [2/2]

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

Create an instance of the destination class.

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:
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
fitman.sz
sz
Definition: fitman.py:527
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::CopyConversion< IParticleLinkContainer, IParticleContainer >::convert
virtual void convert(const IParticleLinkContainer &src, IParticleContainer &dst) const=0
Convert the contents of an instance of the source class SRC to an instance of the destination class D...
DataVector::clear
void clear()
Erase all the elements in the collection.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.