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

#include <INav4MomLinkContainer.h>

Inheritance diagram for INav4MomLinkContainerToINavigable4MomentumCollectionConverter:
Collaboration diagram for INav4MomLinkContainerToINavigable4MomentumCollectionConverter:

Public Types

typedef INavigable4MomentumCollection target_type
 The destination class.

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.
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

Definition at line 36 of file INav4MomLinkContainer.h.

Member Typedef Documentation

◆ target_type

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.
53 INavigable4Momentum* p_nc ATLAS_THREAD_SAFE = const_cast<INavigable4Momentum*> (p);
54 dst.push_back (p_nc);
55 }
56 }
57 }
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< INav4MomLinkContainer, INavigable4MomentumCollection >::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 INav4MomLinkContainer &src, INavigable4MomentumCollection &dst) const=0

◆ create()

virtual void * SG::CopyConversion< INav4MomLinkContainer, INavigable4MomentumCollection >::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< INav4MomLinkContainer, INavigable4MomentumCollection >::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: