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
 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
 Destroy an instance of the destination class. More...
 
virtual void convertUntyped (const void *src, void *dst) const
 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
inlinevirtualinherited

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::CopyConversion< IParticleLinkContainer , IParticleContainer >::create
inlinevirtualinherited

Create an instance of the destination class.

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

414 { return new DST; }

◆ create() [2/2]

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

Create an instance of the destination class.

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

◆ destroy()

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

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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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
lumiFormat.i
int i
Definition: lumiFormat.py:92
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.