CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
BasicReferenceCounted Class Reference

#include <ReferenceCounted.h>

Inheritance diagram for BasicReferenceCounted:
Surface Cone Cylinder Plane BoundDiskSector Disk

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.

Referenced by BasicReferenceCounted().

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

Definition at line 34 of file ReferenceCounted.h.

References BasicReferenceCounted(), and operator=().

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

Referenced by BasicReferenceCounted().

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().