Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends
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

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

Definition at line 629 of file memory.h.

630  : acb_ptr( 0 )
631 { }
CLHEP::sp::weak_ctrl_handle::weak_ctrl_handle ( shared_ctrl_handle const &  other)
throw (
)
inline

Definition at line 633 of file memory.h.

References CLHEP::sp::abstract_ctrl_block::weak_add_ref().

634  : acb_ptr( other.acb_ptr )
635 {
636  if( acb_ptr != 0 )
637  acb_ptr->weak_add_ref();
638 }
CLHEP::sp::weak_ctrl_handle::~weak_ctrl_handle ( )
throw (
)
inline

Definition at line 640 of file memory.h.

References CLHEP::sp::abstract_ctrl_block::weak_release().

641 {
642  if( acb_ptr != 0 )
643  acb_ptr->weak_release();
644 }
CLHEP::sp::weak_ctrl_handle::weak_ctrl_handle ( weak_ctrl_handle const &  other)
throw (
)
inline

Definition at line 654 of file memory.h.

References CLHEP::sp::abstract_ctrl_block::weak_add_ref().

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

Member Function Documentation

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 }
weak_ctrl_handle & CLHEP::sp::weak_ctrl_handle::operator= ( shared_ctrl_handle const &  other)
throw (
)
inline

Definition at line 662 of file memory.h.

References CLHEP::sp::abstract_ctrl_block::weak_add_ref(), and CLHEP::sp::abstract_ctrl_block::weak_release().

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 }
weak_ctrl_handle & CLHEP::sp::weak_ctrl_handle::operator= ( weak_ctrl_handle const &  other)
throw (
)
inline

Definition at line 677 of file memory.h.

References CLHEP::sp::abstract_ctrl_block::weak_add_ref(), and CLHEP::sp::abstract_ctrl_block::weak_release().

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 }
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 }
long CLHEP::sp::weak_ctrl_handle::use_count ( ) const
throw (
)
inline

Definition at line 698 of file memory.h.

References CLHEP::sp::abstract_ctrl_block::use_count().

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

Friends And Related Function Documentation

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

Definition at line 710 of file memory.h.

711 {
712  return std::less<abstract_ctrl_block*>()( lhs.acb_ptr, rhs.acb_ptr );
713 }
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 }
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: