CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 &&)
 
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::BasicReferenceCounted ( )
inline

Definition at line 31 of file ReferenceCounted.h.

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

Definition at line 32 of file ReferenceCounted.h.

32 : referenceCount_(0) {}
std::atomic< unsigned int > referenceCount_
BasicReferenceCounted::BasicReferenceCounted ( BasicReferenceCounted &&  )
inline

Definition at line 33 of file ReferenceCounted.h.

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

Definition at line 38 of file ReferenceCounted.h.

38 {}

Member Function Documentation

void BasicReferenceCounted::addReference ( ) const
inline

Definition at line 42 of file ReferenceCounted.h.

References referenceCount_.

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

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

Definition at line 34 of file ReferenceCounted.h.

34 { return *this; }
BasicReferenceCounted& BasicReferenceCounted::operator= ( const BasicReferenceCounted )
inline

Definition at line 36 of file ReferenceCounted.h.

36 { return *this; }
unsigned int BasicReferenceCounted::references ( ) const
inline

Definition at line 49 of file ReferenceCounted.h.

References referenceCount_.

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

Definition at line 43 of file ReferenceCounted.h.

References referenceCount_.

Referenced by intrusive_ptr_release().

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

Member Data Documentation

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

Definition at line 56 of file ReferenceCounted.h.

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