CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
ProxyBase11< T > Class Template Reference

#include <ProxyBase11.h>

Inheritance diagram for ProxyBase11< T >:
reco::GhostTrackState reco::TransientTrack TrajectoryStateOnSurface VertexState

Public Types

using pointer = std::shared_ptr< T >
 

Public Member Functions

void check () const
 
const Tdata () const
 
void destroy () noexcept
 
bool isValid () const
 
template<typename U >
ProxyBase11operator= (std::shared_ptr< U > p)
 
ProxyBase11operator= (ProxyBase11 &&other) noexcept=default
 
ProxyBase11operator= (const ProxyBase11 &other)=default
 
 ProxyBase11 ()
 
 ProxyBase11 (T *p)
 
template<typename U >
 ProxyBase11 (std::shared_ptr< U > p)
 
 ProxyBase11 (ProxyBase11 &&other) noexcept=default
 
 ProxyBase11 (ProxyBase11 const &other)=default
 
int references () const
 
void reset ()
 
TsharedData ()
 
void swap (ProxyBase11 &other) noexcept
 
TunsharedData ()
 
 ~ProxyBase11 () noexcept
 

Private Attributes

std::shared_ptr< TtheData
 

Detailed Description

template<class T>
class ProxyBase11< T >

A base class for reference counting proxies. The class to which this one is proxy must inherit from ReferenceCounted. A ProxyBase has value semantics, in contrast to ReferenceCountingPointer, which has pointer semantics. The Proxy class inheriting from ProxyBase must duplicate the part of the interface of the reference counted class that it whiches to expose.

Definition at line 23 of file ProxyBase11.h.

Member Typedef Documentation

◆ pointer

template<class T>
using ProxyBase11< T >::pointer = std::shared_ptr<T>

Definition at line 25 of file ProxyBase11.h.

Constructor & Destructor Documentation

◆ ProxyBase11() [1/5]

template<class T>
ProxyBase11< T >::ProxyBase11 ( )
inline

Definition at line 29 of file ProxyBase11.h.

29 {}

◆ ProxyBase11() [2/5]

template<class T>
ProxyBase11< T >::ProxyBase11 ( T p)
inlineexplicit

Definition at line 31 of file ProxyBase11.h.

31 : theData(p) {}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82

◆ ProxyBase11() [3/5]

template<class T>
template<typename U >
ProxyBase11< T >::ProxyBase11 ( std::shared_ptr< U >  p)
inline

Definition at line 33 of file ProxyBase11.h.

33 : theData(std::move(p)) {}
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82
def move(src, dest)
Definition: eostools.py:511

◆ ~ProxyBase11()

template<class T>
ProxyBase11< T >::~ProxyBase11 ( )
inlinenoexcept

Definition at line 40 of file ProxyBase11.h.

References ProxyBase11< T >::destroy().

40 { destroy(); }
void destroy() noexcept
Definition: ProxyBase11.h:78

◆ ProxyBase11() [4/5]

template<class T>
ProxyBase11< T >::ProxyBase11 ( ProxyBase11< T > &&  other)
defaultnoexcept

◆ ProxyBase11() [5/5]

template<class T>
ProxyBase11< T >::ProxyBase11 ( ProxyBase11< T > const &  other)
default

Member Function Documentation

◆ check()

template<class T>
void ProxyBase11< T >::check ( void  ) const
inline

Definition at line 71 of file ProxyBase11.h.

References gather_cfg::cout, ProxyBase11< T >::references(), ProxyBase11< T >::theData, and UNLIKELY.

Referenced by ProxyBase11< T >::data(), ProxyBase11< T >::sharedData(), and ProxyBase11< T >::unsharedData().

71  {
72 #ifdef TR_DEBUG
73  if UNLIKELY (!theData)
74  std::cout << "dead proxyBase11 " << references() << std::endl;
75 #endif
76  }
int references() const
Definition: ProxyBase11.h:79
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82
#define UNLIKELY(x)
Definition: Likely.h:21

◆ data()

template<class T>
const T& ProxyBase11< T >::data ( ) const
inline

Definition at line 51 of file ProxyBase11.h.

References ProxyBase11< T >::check(), and ProxyBase11< T >::theData.

Referenced by reco::TransientTrack::basicTransientTrack(), reco::GhostTrackState::cartesianCovariance(), reco::GhostTrackState::cartesianError(), TrajectoryStateOnSurface::cartesianError(), TrajectoryStateOnSurface::charge(), reco::TransientTrack::charge(), TrajectoryStateOnSurface::components(), VertexState::components(), GsfCombinedMaterialEffectsUpdator::compute(), TrajectoryStateOnSurface::curvilinearError(), reco::TransientTrack::dtErrorExt(), VertexState::error(), VertexState::error4D(), reco::TransientTrack::field(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalParameters(), reco::GhostTrackState::globalPosition(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), reco::TransientTrack::impactPointState(), reco::TransientTrack::impactPointStateAvailable(), reco::TransientTrack::impactPointTSCP(), reco::TransientTrack::initialFreeState(), reco::TransientTrack::innermostMeasurementState(), VertexState::is4D(), reco::GhostTrackState::isTrack(), reco::GhostTrackState::isValid(), TrajectoryStateOnSurface::isValid(), VertexState::isValid(), reco::GhostTrackState::isVertex(), reco::GhostTrackState::lambda(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localMomentum(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), TrajectoryStateOnSurface::magneticField(), reco::TransientTrack::operator<(), reco::TransientTrack::operator==(), reco::TransientTrack::outermostMeasurementState(), VertexState::position(), TrajectoryStateOnSurface::signedInverseMomentum(), TrajectoryStateOnSurface::singleState(), reco::TransientTrack::stateAtBeamLine(), reco::TransientTrack::stateOnSurface(), TrajectoryStateOnSurface::surface(), TrajectoryStateOnSurface::surfaceSide(), VertexState::time(), VertexState::timeError(), reco::TransientTrack::timeExt(), reco::GhostTrackState::track(), reco::TransientTrack::track(), reco::TransientTrack::trackBaseRef(), reco::TransientTrack::trajectoryStateClosestToPoint(), TrajectoryStateOnSurface::transverseCurvature(), reco::GhostTrackState::tsos(), TrajectoryStateOnSurface::update(), GsfMaterialEffectsUpdator::updateState(), reco::GhostTrackState::vertexStateOnGhostTrack(), reco::GhostTrackState::vertexStateOnMeasurement(), reco::GhostTrackState::weight(), VertexState::weight(), TrajectoryStateOnSurface::weight(), VertexState::weight4D(), VertexState::weightInMixture(), VertexState::weightTimesPosition(), and VertexState::weightTimesPosition4D().

51  {
52  check();
53  return *theData;
54  }
void check() const
Definition: ProxyBase11.h:71
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82

◆ destroy()

template<class T>
void ProxyBase11< T >::destroy ( )
inlinenoexcept

Definition at line 78 of file ProxyBase11.h.

Referenced by ProxyBase11< T >::~ProxyBase11().

78 {}

◆ isValid()

template<class T>
bool ProxyBase11< T >::isValid ( void  ) const
inline

◆ operator=() [1/3]

template<class T>
template<typename U >
ProxyBase11& ProxyBase11< T >::operator= ( std::shared_ptr< U >  p)
inline

Definition at line 35 of file ProxyBase11.h.

References eostools::move(), AlCaHLTBitMon_ParallelJobs::p, and ProxyBase11< T >::theData.

Referenced by reco::TransientTrack::operator=(), and TrajectoryStateOnSurface::operator=().

35  {
36  theData = std::move(p);
37  return *this;
38  }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82
def move(src, dest)
Definition: eostools.py:511

◆ operator=() [2/3]

template<class T>
ProxyBase11& ProxyBase11< T >::operator= ( ProxyBase11< T > &&  other)
defaultnoexcept

◆ operator=() [3/3]

template<class T>
ProxyBase11& ProxyBase11< T >::operator= ( const ProxyBase11< T > &  other)
default

◆ references()

template<class T>
int ProxyBase11< T >::references ( ) const
inline

Definition at line 79 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

Referenced by ProxyBase11< T >::check(), and ProxyBase11< T >::unsharedData().

79 { return theData.use_count(); }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82

◆ reset()

template<class T>
void ProxyBase11< T >::reset ( void  )
inline

Definition at line 49 of file ProxyBase11.h.

References ProxyBase11< T >::theData.

49 { theData.reset(); }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82

◆ sharedData()

template<class T>
T& ProxyBase11< T >::sharedData ( )
inline

Definition at line 64 of file ProxyBase11.h.

References ProxyBase11< T >::check(), and ProxyBase11< T >::theData.

Referenced by reco::TransientTrack::setBeamSpot(), TrajectoryStateOnSurface::setCurvilinearError(), and reco::TransientTrack::setTrackingGeometry().

64  {
65  check();
66  return *theData;
67  }
void check() const
Definition: ProxyBase11.h:71
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82

◆ swap()

template<class T>
void ProxyBase11< T >::swap ( ProxyBase11< T > &  other)
inlinenoexcept

Definition at line 42 of file ProxyBase11.h.

References trackingPlots::other, swap(), and ProxyBase11< T >::theData.

Referenced by TrajectoryStateOnSurface::operator=(), reco::TransientTrack::swap(), and TrajectoryStateOnSurface::swap().

42 { std::swap(theData, other.theData); }
std::shared_ptr< T > theData
Definition: ProxyBase11.h:82
void swap(ProxyBase11< T > &lh, ProxyBase11< T > &rh) noexcept
Definition: ProxyBase11.h:86

◆ unsharedData()

template<class T>
T& ProxyBase11< T >::unsharedData ( )
inline

Member Data Documentation

◆ theData

template<class T>
std::shared_ptr<T> ProxyBase11< T >::theData
private