CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
BasicReferenceCounted Class Reference

#include <ReferenceCounted.h>

Inheritance diagram for BasicReferenceCounted:
NavSurface reco::BasicGhostTrackState reco::BasicTransientTrack Surface NavCone NavCylinder NavPlane reco::TrackGhostTrackState reco::VertexGhostTrackState reco::CandidatePtrTransientTrack reco::GsfTransientTrack reco::TrackTransientTrack reco::TransientTrackFromFTS Cone Cylinder Plane

Public Member Functions

void addReference () const
 
 BasicReferenceCounted ()
 
 BasicReferenceCounted (const BasicReferenceCounted &)
 
 BasicReferenceCounted (BasicReferenceCounted &&)=default
 
BasicReferenceCountedoperator= (BasicReferenceCounted &&)=default
 
BasicReferenceCountedoperator= (const BasicReferenceCounted &)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~BasicReferenceCounted ()
 

Private Attributes

std::atomic< unsigned int > referenceCount_
 

Detailed Description

Definition at line 29 of file ReferenceCounted.h.

Constructor & Destructor Documentation

BasicReferenceCounted::BasicReferenceCounted ( )
inline

Definition at line 33 of file ReferenceCounted.h.

33 : referenceCount_(0) {}
std::atomic< unsigned int > referenceCount_
BasicReferenceCounted::BasicReferenceCounted ( const BasicReferenceCounted )
inline

Definition at line 34 of file ReferenceCounted.h.

34 : referenceCount_(0) {}
std::atomic< unsigned int > referenceCount_
BasicReferenceCounted::BasicReferenceCounted ( BasicReferenceCounted &&  )
default
virtual BasicReferenceCounted::~BasicReferenceCounted ( )
inlinevirtual

Definition at line 42 of file ReferenceCounted.h.

42 {}

Member Function Documentation

void BasicReferenceCounted::addReference ( ) const
inline

Definition at line 46 of file ReferenceCounted.h.

References referenceCount_.

Referenced by PixelTrackBuilder::build(), and intrusive_ptr_add_ref().

46 { referenceCount_++; }
std::atomic< unsigned int > referenceCount_
BasicReferenceCounted& BasicReferenceCounted::operator= ( BasicReferenceCounted &&  )
default
BasicReferenceCounted& BasicReferenceCounted::operator= ( const BasicReferenceCounted )
inline

Definition at line 38 of file ReferenceCounted.h.

38  {
39  return *this;
40  }
unsigned int BasicReferenceCounted::references ( ) const
inline

Definition at line 52 of file ReferenceCounted.h.

References referenceCount_.

52 {return referenceCount_;}
std::atomic< unsigned int > referenceCount_
void BasicReferenceCounted::removeReference ( ) const
inline

Definition at line 47 of file ReferenceCounted.h.

References referenceCount_.

Referenced by intrusive_ptr_release().

47  { if(1 == referenceCount_--) {
48  delete const_cast<BasicReferenceCounted*>(this);
49  }
50  }
std::atomic< unsigned int > referenceCount_

Member Data Documentation

std::atomic<unsigned int> BasicReferenceCounted::referenceCount_
mutableprivate

Definition at line 60 of file ReferenceCounted.h.

Referenced by addReference(), references(), and removeReference().