CMS 3D CMS Logo

Protected Member Functions | Private Attributes

ProxyBase< T, Cloner > Class Template Reference

#include <ProxyBase.h>

Inheritance diagram for ProxyBase< T, Cloner >:
reco::GhostTrackState reco::TransientTrack TrajectoryStateOnSurface VertexState

List of all members.

Protected Member Functions

void check () const
const Tdata () const
void destroy () noexcept
bool isValid () const
ProxyBaseoperator= (const ProxyBase &other) noexcept
 ProxyBase () noexcept
 ProxyBase (T *p) noexcept
 ProxyBase (const ProxyBase &other) noexcept
int references () const
TsharedData ()
void swap (ProxyBase &other) noexcept
TunsharedData ()
 ~ProxyBase () noexcept

Private Attributes

TtheData

Detailed Description

template<class T, class Cloner>
class ProxyBase< T, Cloner >

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 20 of file ProxyBase.h.


Constructor & Destructor Documentation

template<class T, class Cloner>
ProxyBase< T, Cloner >::ProxyBase ( ) [inline, protected]

Definition at line 23 of file ProxyBase.h.

: theData(0) {}
template<class T, class Cloner>
ProxyBase< T, Cloner >::ProxyBase ( T p) [inline, explicit, protected]

Definition at line 25 of file ProxyBase.h.

References ProxyBase< T, Cloner >::theData.

: theData(p) {if (theData) theData->addReference();}
template<class T, class Cloner>
ProxyBase< T, Cloner >::ProxyBase ( const ProxyBase< T, Cloner > &  other) [inline, protected]

Definition at line 27 of file ProxyBase.h.

References ProxyBase< T, Cloner >::theData.

                                               {
    theData = other.theData;
    if (theData) theData->addReference();
  }
template<class T, class Cloner>
ProxyBase< T, Cloner >::~ProxyBase ( ) [inline, protected]

Definition at line 32 of file ProxyBase.h.

References ProxyBase< T, Cloner >::destroy().

                         { 
    destroy();
  }

Member Function Documentation

template<class T, class Cloner>
void ProxyBase< T, Cloner >::check ( void  ) const [inline, protected]
template<class T, class Cloner>
const T& ProxyBase< T, Cloner >::data ( ) const [inline, protected]

Definition at line 67 of file ProxyBase.h.

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

Referenced by reco::TransientTrack::basicTransientTrack(), reco::GhostTrackState::cartesianCovariance(), reco::GhostTrackState::cartesianError(), TrajectoryStateOnSurface::cartesianError(), reco::TransientTrack::charge(), TrajectoryStateOnSurface::charge(), VertexState::components(), TrajectoryStateOnSurface::components(), TrajectoryStateOnSurface::curvilinearError(), VertexState::error(), 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(), reco::GhostTrackState::isTrack(), TrajectoryStateOnSurface::isValid(), VertexState::isValid(), reco::GhostTrackState::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(), reco::TransientTrack::stateAtBeamLine(), reco::TransientTrack::stateOnSurface(), TrajectoryStateOnSurface::surface(), TrajectoryStateOnSurface::surfaceSide(), reco::TransientTrack::track(), reco::GhostTrackState::track(), reco::TransientTrack::trackBaseRef(), reco::TransientTrack::trajectoryStateClosestToPoint(), TrajectoryStateOnSurface::transverseCurvature(), reco::GhostTrackState::tsos(), TrajectoryStateOnSurface::update(), reco::GhostTrackState::vertexStateOnGhostTrack(), reco::GhostTrackState::vertexStateOnMeasurement(), TrajectoryStateOnSurface::weight(), VertexState::weight(), reco::GhostTrackState::weight(), VertexState::weightInMixture(), and VertexState::weightTimesPosition().

{ check(); return *theData;}
template<class T, class Cloner>
void ProxyBase< T, Cloner >::destroy ( ) [inline, protected]
template<class T, class Cloner>
bool ProxyBase< T, Cloner >::isValid ( void  ) const [inline, protected]
template<class T, class Cloner>
ProxyBase& ProxyBase< T, Cloner >::operator= ( const ProxyBase< T, Cloner > &  other) [inline, protected]

Definition at line 36 of file ProxyBase.h.

References ProxyBase< T, Cloner >::destroy(), likely, and ProxyBase< T, Cloner >::theData.

                                                          {
    if  likely( theData != other.theData) { 
      destroy();
      theData = other.theData;
      if (theData) theData->addReference();
    }
    return *this;
  }
template<class T, class Cloner>
int ProxyBase< T, Cloner >::references ( ) const [inline, protected]

Definition at line 90 of file ProxyBase.h.

References ProxyBase< T, Cloner >::theData.

Referenced by ProxyBase< T, Cloner >::unsharedData().

{return theData->references();}  
template<class T, class Cloner>
T& ProxyBase< T, Cloner >::sharedData ( ) [inline, protected]
template<class T, class Cloner>
void ProxyBase< T, Cloner >::swap ( ProxyBase< T, Cloner > &  other) [inline, protected]
template<class T, class Cloner>
T& ProxyBase< T, Cloner >::unsharedData ( ) [inline, protected]

Member Data Documentation

template<class T, class Cloner>
T* ProxyBase< T, Cloner >::theData [private]