Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
CLHEP::sp::abstract_ctrl_block Class Referenceabstract

#include <memory.h>

+ Inheritance diagram for CLHEP::sp::abstract_ctrl_block:

Public Member Functions

void class_invariant () const throw ()
 
 abstract_ctrl_block ()
 
virtual ~abstract_ctrl_block () throw ()
 
void add_ref ()
 
bool add_ref_lock ()
 
void weak_add_ref () throw ()
 
virtual void * get_deleter (std::type_info const &ti)=0
 
void release () throw ()
 
void weak_release () throw ()
 
virtual void dispose ()=0 throw ()
 
virtual void destroy () throw ()
 
long use_count () const throw ()
 

Additional Inherited Members

- Protected Member Functions inherited from CLHEP::noncopyable
 noncopyable () throw ()
 
 ~noncopyable () throw ()
 

Detailed Description

Definition at line 98 of file memory.h.

Constructor & Destructor Documentation

◆ abstract_ctrl_block()

CLHEP::sp::abstract_ctrl_block::abstract_ctrl_block ( )
inline

Definition at line 134 of file memory.h.

135 : n_shared_ptrs( 1 )
136 , n_weak_ptrs ( 1 )
137{
139}
void class_invariant() const
Definition: memory.h:129

◆ ~abstract_ctrl_block()

CLHEP::sp::abstract_ctrl_block::~abstract_ctrl_block ( )
throw (
)
inlinevirtual

Definition at line 141 of file memory.h.

142{
144}

Member Function Documentation

◆ add_ref()

void CLHEP::sp::abstract_ctrl_block::add_ref ( )
inline

Definition at line 147 of file memory.h.

148{
150 ++n_shared_ptrs;
151}

Referenced by CLHEP::sp::shared_ctrl_handle::operator=().

◆ add_ref_lock()

bool CLHEP::sp::abstract_ctrl_block::add_ref_lock ( )
inline

Definition at line 154 of file memory.h.

155{
157 return n_shared_ptrs ? ++n_shared_ptrs : false;
158}

Referenced by CLHEP::sp::shared_ctrl_handle::shared_ctrl_handle().

◆ class_invariant()

void CLHEP::sp::abstract_ctrl_block::class_invariant ( ) const
throw (
)
inline

Definition at line 129 of file memory.h.

130{
131 assert( n_shared_ptrs == 0 || n_weak_ptrs >= 1 );
132}

Referenced by abstract_ctrl_block(), add_ref(), add_ref_lock(), release(), use_count(), weak_add_ref(), weak_release(), and ~abstract_ctrl_block().

◆ destroy()

void CLHEP::sp::abstract_ctrl_block::destroy ( )
throw (
)
inlinevirtual

Reimplemented in CLHEP::sp::ctrl_block_pda< P, D, A >.

Definition at line 184 of file memory.h.

185{
186 assert( n_weak_ptrs == 0 );
187 delete this;
188}

Referenced by weak_release().

◆ dispose()

virtual void CLHEP::sp::abstract_ctrl_block::dispose ( )
throw (
)
pure virtual

◆ get_deleter()

virtual void * CLHEP::sp::abstract_ctrl_block::get_deleter ( std::type_info const ti)
pure virtual

◆ release()

void CLHEP::sp::abstract_ctrl_block::release ( )
throw (
)
inline

Definition at line 168 of file memory.h.

169{
171 if( 0 == --n_shared_ptrs )
173}

Referenced by CLHEP::sp::shared_ctrl_handle::~shared_ctrl_handle().

◆ use_count()

long CLHEP::sp::abstract_ctrl_block::use_count ( ) const
throw (
)
inline

Definition at line 191 of file memory.h.

192{
194 return n_shared_ptrs;
195}

Referenced by CLHEP::sp::shared_ctrl_handle::use_count(), and CLHEP::sp::weak_ctrl_handle::use_count().

◆ weak_add_ref()

void CLHEP::sp::abstract_ctrl_block::weak_add_ref ( )
throw (
)
inline

Definition at line 161 of file memory.h.

162{
164 ++n_weak_ptrs;
165}

Referenced by CLHEP::sp::weak_ctrl_handle::operator=(), and CLHEP::sp::weak_ctrl_handle::weak_ctrl_handle().

◆ weak_release()

void CLHEP::sp::abstract_ctrl_block::weak_release ( )
throw (
)
inline

Definition at line 176 of file memory.h.

177{
179 if( 0 == --n_weak_ptrs )
180 destroy();
181}
virtual void destroy()
Definition: memory.h:184

Referenced by CLHEP::sp::weak_ctrl_handle::operator=(), release(), and CLHEP::sp::weak_ctrl_handle::~weak_ctrl_handle().


The documentation for this class was generated from the following file: