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 254 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 263 of file SurfaceHolderImpl.h.

264  : m_associatedSurface(s.isFree() ? s.clone() : &s)
265  {}

◆ SurfaceUniqHolderImpl() [3/5]

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

ctor from const Surface ptr. Takes ownership

Definition at line 268 of file SurfaceHolderImpl.h.

270  {}

◆ 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 274 of file SurfaceHolderImpl.h.

275  : m_associatedSurface(other.m_associatedSurface &&
276  other.m_associatedSurface->isFree()
277  ? other.m_associatedSurface->clone()
278  : other.m_associatedSurface.get())
279  {}

◆ 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 305 of file SurfaceHolderImpl.h.

305 { 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 286 of file SurfaceHolderImpl.h.

287  {
288  if (this != &other) {
289  m_associatedSurface.reset(
290  (other.m_associatedSurface && other.m_associatedSurface->isFree())
291  ? other.m_associatedSurface->clone()
292  : other.m_associatedSurface.get());
293  }
294  return *this;
295  }

◆ 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 308 of file SurfaceHolderImpl.h.

308 { return m_associatedSurface.release(); }

◆ surfacePtr()

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

return the ptr we hold

Definition at line 301 of file SurfaceHolderImpl.h.

301 { 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 311 of file SurfaceHolderImpl.h.


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