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

#include <memory.h>

Public Member Functions

 weak_ctrl_handle () throw ()
 
 weak_ctrl_handle (shared_ctrl_handle const &) throw ()
 
 ~weak_ctrl_handle () throw ()
 
void swap (weak_ctrl_handle &) throw ()
 
 weak_ctrl_handle (weak_ctrl_handle const &) throw ()
 
weak_ctrl_handleoperator= (shared_ctrl_handle const &) throw ()
 
weak_ctrl_handleoperator= (weak_ctrl_handle const &) throw ()
 
bool empty () const throw ()
 
long use_count () const throw ()
 

Friends

class shared_ctrl_handle
 
bool operator== (weak_ctrl_handle const &, weak_ctrl_handle const &)
 
bool operator< (weak_ctrl_handle const &, weak_ctrl_handle const &)
 

Detailed Description

Definition at line 593 of file memory.h.

Constructor & Destructor Documentation

◆ weak_ctrl_handle() [1/3]

CLHEP::sp::weak_ctrl_handle::weak_ctrl_handle ( )
throw (
)
inline

Definition at line 629 of file memory.h.

630 : acb_ptr( 0 )
631{ }

◆ weak_ctrl_handle() [2/3]

CLHEP::sp::weak_ctrl_handle::weak_ctrl_handle ( shared_ctrl_handle const other)
throw (
)
inline

Definition at line 633 of file memory.h.

634 : acb_ptr( other.acb_ptr )
635{
636 if( acb_ptr != 0 )
637 acb_ptr->weak_add_ref();
638}

◆ ~weak_ctrl_handle()

CLHEP::sp::weak_ctrl_handle::~weak_ctrl_handle ( )
throw (
)
inline

Definition at line 640 of file memory.h.

641{
642 if( acb_ptr != 0 )
643 acb_ptr->weak_release();
644}

◆ weak_ctrl_handle() [3/3]

CLHEP::sp::weak_ctrl_handle::weak_ctrl_handle ( weak_ctrl_handle const other)
throw (
)
inline

Definition at line 654 of file memory.h.

655 : acb_ptr( other.acb_ptr )
656{
657 if( acb_ptr != 0 )
658 acb_ptr->weak_add_ref();
659}

Member Function Documentation

◆ empty()

bool CLHEP::sp::weak_ctrl_handle::empty ( ) const
throw (
)
inline

Definition at line 692 of file memory.h.

693{
694 return acb_ptr == 0;
695}

Referenced by CLHEP::weak_ptr< P >::_empty().

◆ operator=() [1/2]

weak_ctrl_handle & CLHEP::sp::weak_ctrl_handle::operator= ( shared_ctrl_handle const other)
throw (
)
inline

Definition at line 662 of file memory.h.

663{
664 abstract_ctrl_block * tmp = other.acb_ptr;
665
666 if( tmp != acb_ptr )
667 {
668 if( tmp != 0 ) tmp->weak_add_ref();
669 if( acb_ptr != 0 ) acb_ptr->weak_release();
670 acb_ptr = tmp;
671}
672
673 return *this;
674}

◆ operator=() [2/2]

weak_ctrl_handle & CLHEP::sp::weak_ctrl_handle::operator= ( weak_ctrl_handle const other)
throw (
)
inline

Definition at line 677 of file memory.h.

678{
679 abstract_ctrl_block * tmp = other.acb_ptr;
680
681 if( tmp != acb_ptr )
682{
683 if( tmp != 0 ) tmp->weak_add_ref();
684 if( acb_ptr != 0 ) acb_ptr->weak_release();
685 acb_ptr = tmp;
686}
687
688 return *this;
689}

◆ swap()

void CLHEP::sp::weak_ctrl_handle::swap ( weak_ctrl_handle other)
throw (
)
inline

Definition at line 647 of file memory.h.

648{
649 abstract_ctrl_block * tmp = other.acb_ptr;
650 other.acb_ptr = acb_ptr;
651 acb_ptr = tmp;
652}

Referenced by CLHEP::weak_ptr< P >::swap().

◆ use_count()

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

Definition at line 698 of file memory.h.

699{
700 return acb_ptr == 0 ? 0L : acb_ptr->use_count();
701}

Referenced by CLHEP::weak_ptr< P >::expired(), and CLHEP::weak_ptr< P >::use_count().

Friends And Related Function Documentation

◆ operator<

bool operator< ( weak_ctrl_handle const lhs,
weak_ctrl_handle const rhs 
)
friend

Definition at line 709 of file memory.h.

711{
712 return std::less<abstract_ctrl_block*>()( lhs.acb_ptr, rhs.acb_ptr );
713}

◆ operator==

bool operator== ( weak_ctrl_handle const lhs,
weak_ctrl_handle const rhs 
)
friend

Definition at line 704 of file memory.h.

705{
706 return lhs.acb_ptr == rhs.acb_ptr;
707}

◆ shared_ctrl_handle

friend class shared_ctrl_handle
friend

Definition at line 595 of file memory.h.


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