ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::SurfaceUniqHolderImpl< S > Class Template Reference

#include <SurfaceHolderImpl.h>

Inheritance diagram for Trk::SurfaceUniqHolderImpl< S >:
Collaboration diagram for Trk::SurfaceUniqHolderImpl< S >:

Public Member Functions

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

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 {}
SurfaceUniquePtrT< const S > m_associatedSurface

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

◆ 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) {
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: