ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Trk::SurfaceUniqHolderImpl< S > Class Template Reference

#include <SurfaceHolderImpl.h>

Collaboration diagram for Trk::SurfaceUniqHolderImpl< S >:

Public Member Functions

 SurfaceUniqHolderImpl ()=default
 default ctor More...
 
 SurfaceUniqHolderImpl (const S &s)
 ctor from const Surface ref. More...
 
 SurfaceUniqHolderImpl (const S *s)
 ctor from const Surface ptr. Takes ownership More...
 
 SurfaceUniqHolderImpl (const SurfaceUniqHolderImpl &other)
 copy ctor, if surface is free we clone/copy. More...
 
 SurfaceUniqHolderImpl (SurfaceUniqHolderImpl &&) noexcept=default
 default move ctor More...
 
SurfaceUniqHolderImploperator= (const SurfaceUniqHolderImpl &other)
 copy assignment, if surface is free we clone/copy. More...
 
SurfaceUniqHolderImploperator= (SurfaceUniqHolderImpl &&) noexcept=default
 default move assignement More...
 
const S * surfacePtr ()
 return the ptr we hold More...
 
void destroySurface () noexcept
 destroySurface deletes the ptr if not null and is free usefull also for testing More...
 
const S * release () noexcept
 release , release the unique_ptr we hold More...
 

Protected Member Functions

 ~SurfaceUniqHolderImpl ()=default
 

Protected Attributes

SurfaceUniquePtrT< const S > m_associatedSurface = nullptr
 

Detailed Description

template<typename S>
class Trk::SurfaceUniqHolderImpl< S >

Definition at line 231 of file SurfaceHolderImpl.h.

Constructor & Destructor Documentation

◆ SurfaceUniqHolderImpl() [1/5]

template<typename S >
Trk::SurfaceUniqHolderImpl< S >::SurfaceUniqHolderImpl ( )
default

default ctor

◆ SurfaceUniqHolderImpl() [2/5]

template<typename S >
Trk::SurfaceUniqHolderImpl< S >::SurfaceUniqHolderImpl ( const S &  s)
inlineexplicit

ctor from const Surface ref.

If surface is free we clone, otherwise we take its address.

Definition at line 240 of file SurfaceHolderImpl.h.

241  : m_associatedSurface(s.isFree() ? s.clone() : &s)
242  {}

◆ SurfaceUniqHolderImpl() [3/5]

template<typename S >
Trk::SurfaceUniqHolderImpl< S >::SurfaceUniqHolderImpl ( const S *  s)
inlineexplicit

ctor from const Surface ptr. Takes ownership

Definition at line 245 of file SurfaceHolderImpl.h.

247  {}

◆ SurfaceUniqHolderImpl() [4/5]

template<typename S >
Trk::SurfaceUniqHolderImpl< S >::SurfaceUniqHolderImpl ( const SurfaceUniqHolderImpl< S > &  other)
inline

copy ctor, if surface is free we clone/copy.

If not we just point to the one owned by detector geometry

Definition at line 251 of file SurfaceHolderImpl.h.

252  : m_associatedSurface(other.m_associatedSurface &&
253  other.m_associatedSurface->isFree()
254  ? other.m_associatedSurface->clone()
255  : other.m_associatedSurface.get())
256  {}

◆ SurfaceUniqHolderImpl() [5/5]

template<typename S >
Trk::SurfaceUniqHolderImpl< S >::SurfaceUniqHolderImpl ( SurfaceUniqHolderImpl< S > &&  )
defaultnoexcept

default move ctor

◆ ~SurfaceUniqHolderImpl()

template<typename S >
Trk::SurfaceUniqHolderImpl< S >::~SurfaceUniqHolderImpl ( )
protecteddefault

Member Function Documentation

◆ destroySurface()

template<typename S >
void Trk::SurfaceUniqHolderImpl< S >::destroySurface ( )
inlinenoexcept

destroySurface deletes the ptr if not null and is free usefull also for testing

Definition at line 282 of file SurfaceHolderImpl.h.

282 { m_associatedSurface.reset(); }

◆ operator=() [1/2]

template<typename S >
SurfaceUniqHolderImpl& Trk::SurfaceUniqHolderImpl< S >::operator= ( const SurfaceUniqHolderImpl< S > &  other)
inline

copy assignment, if surface is free we clone/copy.

If not we just point to the one owned by detector geometry

Definition at line 263 of file SurfaceHolderImpl.h.

264  {
265  if (this != &other) {
266  m_associatedSurface.reset(
267  (other.m_associatedSurface && other.m_associatedSurface->isFree())
268  ? other.m_associatedSurface->clone()
269  : other.m_associatedSurface.get());
270  }
271  return *this;
272  }

◆ operator=() [2/2]

template<typename S >
SurfaceUniqHolderImpl& Trk::SurfaceUniqHolderImpl< S >::operator= ( SurfaceUniqHolderImpl< S > &&  )
defaultnoexcept

default move assignement

◆ release()

template<typename S >
const S* Trk::SurfaceUniqHolderImpl< S >::release ( )
inlinenoexcept

release , release the unique_ptr we hold

Definition at line 285 of file SurfaceHolderImpl.h.

285 { return m_associatedSurface.release(); }

◆ surfacePtr()

template<typename S >
const S* Trk::SurfaceUniqHolderImpl< S >::surfacePtr ( )
inline

return the ptr we hold

Definition at line 278 of file SurfaceHolderImpl.h.

278 { return m_associatedSurface.get(); }

Member Data Documentation

◆ m_associatedSurface

template<typename S >
SurfaceUniquePtrT<const S> Trk::SurfaceUniqHolderImpl< S >::m_associatedSurface = nullptr
protected

Definition at line 288 of file SurfaceHolderImpl.h.


The documentation for this class was generated from the following file:
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
Trk::SurfaceUniqHolderImpl::m_associatedSurface
SurfaceUniquePtrT< const S > m_associatedSurface
Definition: SurfaceHolderImpl.h:288