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 (BasicReferenceCounted &&)
 
 BasicReferenceCounted (const BasicReferenceCounted &)
 
BasicReferenceCountedoperator= (BasicReferenceCounted &&)
 
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() [1/3]

BasicReferenceCounted::BasicReferenceCounted ( )
inline

Definition at line 31 of file ReferenceCounted.h.

31 : referenceCount_(0) {}

◆ BasicReferenceCounted() [2/3]

BasicReferenceCounted::BasicReferenceCounted ( const BasicReferenceCounted )
inline

Definition at line 32 of file ReferenceCounted.h.

32 : referenceCount_(0) {}

◆ BasicReferenceCounted() [3/3]

BasicReferenceCounted::BasicReferenceCounted ( BasicReferenceCounted &&  )
inline

Definition at line 33 of file ReferenceCounted.h.

33 : referenceCount_(0) {}

◆ ~BasicReferenceCounted()

virtual BasicReferenceCounted::~BasicReferenceCounted ( )
inlinevirtual

Definition at line 38 of file ReferenceCounted.h.

38 {}

Member Function Documentation

◆ addReference()

void BasicReferenceCounted::addReference ( ) const
inline

Definition at line 42 of file ReferenceCounted.h.

42 { referenceCount_++; }

References referenceCount_.

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

◆ operator=() [1/2]

BasicReferenceCounted& BasicReferenceCounted::operator= ( BasicReferenceCounted &&  )
inline

Definition at line 34 of file ReferenceCounted.h.

34 { return *this; }

◆ operator=() [2/2]

BasicReferenceCounted& BasicReferenceCounted::operator= ( const BasicReferenceCounted )
inline

Definition at line 36 of file ReferenceCounted.h.

36 { return *this; }

◆ references()

unsigned int BasicReferenceCounted::references ( ) const
inline

Definition at line 49 of file ReferenceCounted.h.

49 { return referenceCount_; }

References referenceCount_.

◆ removeReference()

void BasicReferenceCounted::removeReference ( ) const
inline

Definition at line 43 of file ReferenceCounted.h.

43  {
44  if (1 == referenceCount_--) {
45  delete const_cast<BasicReferenceCounted*>(this);
46  }
47  }

References referenceCount_.

Referenced by intrusive_ptr_release().

Member Data Documentation

◆ referenceCount_

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

Definition at line 56 of file ReferenceCounted.h.

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

BasicReferenceCounted::referenceCount_
std::atomic< unsigned int > referenceCount_
Definition: ReferenceCounted.h:56