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

#include <INav4MomLinkContainer.h>

Inheritance diagram for INav4MomLinkContainerToINavigable4MomentumCollectionConverter:
Collaboration diagram for INav4MomLinkContainerToINavigable4MomentumCollectionConverter:

Public Types

typedef INavigable4MomentumCollection target_type
 The destination class. More...
 

Public Member Functions

virtual void convert (const INav4MomLinkContainer &src, INavigable4MomentumCollection &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 36 of file INav4MomLinkContainer.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 INav4MomLinkContainerToINavigable4MomentumCollectionConverter::convert ( const INav4MomLinkContainer src,
INavigable4MomentumCollection 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< INav4MomLinkContainer, INavigable4MomentumCollection >.

Definition at line 41 of file INav4MomLinkContainer.h.

43  {
44  size_t sz = src.size();
45  if (dst.size() != sz) {
47  dst.reserve (sz);
48  for (size_t i = 0; i < sz; i++) {
49  const INavigable4Momentum* p = *(src[i]).cptr();
50  // FIXME: Ok, since the target ends up recorded in the event
51  // store as const. But should change the interfaces so that
52  // we get a ConstDataVector to fill.
54  dst.push_back (p_nc);
55  }
56  }
57  }

◆ convertUntyped()

virtual void SG::CopyConversion< INav4MomLinkContainer , INavigable4MomentumCollection >::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< INav4MomLinkContainer , INavigable4MomentumCollection >::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< INav4MomLinkContainer , INavigable4MomentumCollection >::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< INav4MomLinkContainer, INavigable4MomentumCollection >::convert
virtual void convert(const INav4MomLinkContainer &src, INavigable4MomentumCollection &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.
INavigable4Momentum
Definition: INavigable4Momentum.h:21
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.