SheafSystem  0.0.0.0
sheaf::rc_any Class Reference

Base class for reference counting. More...

#include <rc_any.h>

Inheritance diagram for sheaf::rc_any:
sheaf::any sheaf::ragged_array< pod_index_type > sheaf::ragged_array< pod_type > sheaf::ragged_array< T >

RC_ANY FACET

size_type _ref_ct
 Reference count. More...
 
 rc_any ()
 Default constructor. More...
 
 rc_any (const rc_any &xother)
 Constructor. More...
 
rc_anyoperator= (const rc_any &xother)
 Assignment operator. More...
 
 ~rc_any ()
 Destructor. More...
 
void add_reference ()
 Increment the reference count. More...
 
void remove_reference ()
 Decrement the reference count. Delete this object if the reference count is zero. More...
 
bool is_shared () const
 True if the reference count is greater than one. More...
 
size_type ref_ct () const
 Return the reference count. More...
 

Additional Inherited Members

- Public Member Functions inherited from sheaf::any
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
bool is_same_type (const any *other) const
 True if other is the same type as this. More...
 
virtual anyclone () const
 Virtual constructor, makes a new instance of the same type as this. More...
 
virtual ~any ()
 Destructor. More...
 
virtual bool invariant () const
 Class invariant, intended to be redefined in each descendant. See below for template for invariant in derived classes. More...
 
bool invariant_check () const
 True if invariant checking is enabled. More...
 
void enable_invariant_check () const
 Enable invariant checking. More...
 
void disable_invariant_check () const
 Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More...
 
int disable_invariance_check_request_depth () const
 Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Detailed Description

Base class for reference counting.

Definition at line 42 of file rc_any.h.

Constructor & Destructor Documentation

◆ rc_any() [1/2]

sheaf::rc_any::rc_any ( )

Default constructor.

Definition at line 34 of file rc_any.cc.

◆ rc_any() [2/2]

sheaf::rc_any::rc_any ( const rc_any xother)

Constructor.

Definition at line 50 of file rc_any.cc.

References operator=().

◆ ~rc_any()

sheaf::rc_any::~rc_any ( )

Destructor.

Precondition

Definition at line 81 of file rc_any.cc.

References add_reference().

Referenced by operator=().

Member Function Documentation

◆ add_reference()

void sheaf::rc_any::add_reference ( )

Increment the reference count.

Postcondition

Definition at line 98 of file rc_any.cc.

References remove_reference().

Referenced by ~rc_any().

◆ is_shared()

bool sheaf::rc_any::is_shared ( ) const

True if the reference count is greater than one.

Definition at line 136 of file rc_any.cc.

References ref_ct().

Referenced by sheaf::operator<<(), and remove_reference().

◆ operator=()

sheaf::rc_any & sheaf::rc_any::operator= ( const rc_any xother)

Assignment operator.

Definition at line 67 of file rc_any.cc.

References ~rc_any().

Referenced by rc_any().

◆ ref_ct()

sheaf::size_type sheaf::rc_any::ref_ct ( ) const

Return the reference count.

Definition at line 153 of file rc_any.cc.

Referenced by is_shared(), and sheaf::operator<<().

◆ remove_reference()

void sheaf::rc_any::remove_reference ( )

Decrement the reference count. Delete this object if the reference count is zero.

Definition at line 118 of file rc_any.cc.

References is_shared().

Referenced by add_reference().

Member Data Documentation

◆ _ref_ct

size_type sheaf::rc_any::_ref_ct
protected

Reference count.

Definition at line 97 of file rc_any.h.


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