Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Public Member Functions | Private Member Functions | Private Attributes | Related Functions
Teuchos::RCPNodeHandle Class Reference

Utility handle class for handling the reference counting and managuement of the RCPNode object. More...

#include <Teuchos_RCPNode.hpp>

List of all members.

Public Member Functions

 RCPNodeHandle (ENull null_arg=null)
 
 RCPNodeHandle (RCPNode *node, ERCPStrength strength_in=RCP_STRONG, bool newNode=true)
 
 RCPNodeHandle (const RCPNodeHandle &node_ref)
 
void swap (RCPNodeHandle &node_ref)
 
RCPNodeHandleoperator= (const RCPNodeHandle &node_ref)
 (Strong guarantee).
 ~RCPNodeHandle ()
 
RCPNodeHandle create_weak () const
 
RCPNodeHandle create_strong () const
 
RCPNodenode_ptr () const
 
bool is_node_null () const
 
bool is_valid_ptr () const
 
bool same_node (const RCPNodeHandle &node2) const
 
int strong_count () const
 
int weak_count () const
 
int total_count () const
 
int count () const
 Backward compatibility.
ERCPStrength strength () const
 
void has_ownership (bool has_ownership_in)
 
bool has_ownership () const
 
void set_extra_data (const any &extra_data, const std::string &name, EPrePostDestruction destroy_when, bool force_unique)
 
anyget_extra_data (const std::string &type_name, const std::string &name)
 
const anyget_extra_data (const std::string &type_name, const std::string &name) const
 
anyget_optional_extra_data (const std::string &type_name, const std::string &name)
 
const anyget_optional_extra_data (const std::string &type_name, const std::string &name) const
 
void debug_assert_not_null () const
 
template<class RCPType >
void assert_valid_ptr (const RCPType &rcp_obj) const
 
template<class RCPType >
void debug_assert_valid_ptr (const RCPType &rcp_obj) const
 

Private Member Functions

void bind ()
void unbind ()
void unbindOne ()

Private Attributes

RCPNodenode_
ERCPStrength strength_

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &out, const RCPNodeHandle &node)
 Ouput stream operator for RCPNodeHandle.

Detailed Description

Utility handle class for handling the reference counting and managuement of the RCPNode object.

Again, this is *not* a user-level class. Instead, this class is used by all of the user-level reference-counting classes.

NOTE: I (Ross Bartlett) am not generally a big fan of handle classes and greatly prefer smart pointers. However, this is one case where a handle class makes sense. First, I want special behavior in some functions when the wrapped RCPNode pointer is null. Secound, I can't use one of the smart-pointer classes because this class is used to implement all of those smart-pointer classes!

Definition at line 692 of file Teuchos_RCPNode.hpp.


Constructor & Destructor Documentation

Teuchos::RCPNodeHandle::RCPNodeHandle ( ENull  null_arg = null) [inline]

Definition at line 695 of file Teuchos_RCPNode.hpp.

Teuchos::RCPNodeHandle::RCPNodeHandle ( RCPNode node,
ERCPStrength  strength_in = RCP_STRONG,
bool  newNode = true 
) [inline]

Definition at line 699 of file Teuchos_RCPNode.hpp.

Teuchos::RCPNodeHandle::RCPNodeHandle ( const RCPNodeHandle node_ref) [inline]

Definition at line 743 of file Teuchos_RCPNode.hpp.

Teuchos::RCPNodeHandle::~RCPNodeHandle ( ) [inline]

Definition at line 770 of file Teuchos_RCPNode.hpp.


Member Function Documentation

void Teuchos::RCPNodeHandle::swap ( RCPNodeHandle node_ref) [inline]

Definition at line 749 of file Teuchos_RCPNode.hpp.

RCPNodeHandle& Teuchos::RCPNodeHandle::operator= ( const RCPNodeHandle node_ref) [inline]

(Strong guarantee).

Definition at line 755 of file Teuchos_RCPNode.hpp.

RCPNodeHandle Teuchos::RCPNodeHandle::create_weak ( ) const [inline]

Definition at line 775 of file Teuchos_RCPNode.hpp.

RCPNodeHandle Teuchos::RCPNodeHandle::create_strong ( ) const [inline]

Definition at line 783 of file Teuchos_RCPNode.hpp.

RCPNode* Teuchos::RCPNodeHandle::node_ptr ( ) const [inline]

Definition at line 791 of file Teuchos_RCPNode.hpp.

bool Teuchos::RCPNodeHandle::is_node_null ( ) const [inline]

Definition at line 796 of file Teuchos_RCPNode.hpp.

bool Teuchos::RCPNodeHandle::is_valid_ptr ( ) const [inline]

Definition at line 801 of file Teuchos_RCPNode.hpp.

bool Teuchos::RCPNodeHandle::same_node ( const RCPNodeHandle node2) const [inline]

Definition at line 808 of file Teuchos_RCPNode.hpp.

int Teuchos::RCPNodeHandle::strong_count ( ) const [inline]

Definition at line 813 of file Teuchos_RCPNode.hpp.

int Teuchos::RCPNodeHandle::weak_count ( ) const [inline]

Definition at line 820 of file Teuchos_RCPNode.hpp.

int Teuchos::RCPNodeHandle::total_count ( ) const [inline]

Definition at line 827 of file Teuchos_RCPNode.hpp.

int Teuchos::RCPNodeHandle::count ( ) const [inline]

Backward compatibility.

Definition at line 834 of file Teuchos_RCPNode.hpp.

ERCPStrength Teuchos::RCPNodeHandle::strength ( ) const [inline]

Definition at line 841 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNodeHandle::has_ownership ( bool  has_ownership_in) [inline]

Definition at line 846 of file Teuchos_RCPNode.hpp.

bool Teuchos::RCPNodeHandle::has_ownership ( ) const [inline]

Definition at line 852 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNodeHandle::set_extra_data ( const any extra_data,
const std::string &  name,
EPrePostDestruction  destroy_when,
bool  force_unique 
) [inline]

Definition at line 859 of file Teuchos_RCPNode.hpp.

any& Teuchos::RCPNodeHandle::get_extra_data ( const std::string &  type_name,
const std::string &  name 
) [inline]

Definition at line 868 of file Teuchos_RCPNode.hpp.

const any& Teuchos::RCPNodeHandle::get_extra_data ( const std::string &  type_name,
const std::string &  name 
) const [inline]

Definition at line 876 of file Teuchos_RCPNode.hpp.

any* Teuchos::RCPNodeHandle::get_optional_extra_data ( const std::string &  type_name,
const std::string &  name 
) [inline]

Definition at line 883 of file Teuchos_RCPNode.hpp.

const any* Teuchos::RCPNodeHandle::get_optional_extra_data ( const std::string &  type_name,
const std::string &  name 
) const [inline]

Definition at line 891 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNodeHandle::debug_assert_not_null ( ) const [inline]

Definition at line 898 of file Teuchos_RCPNode.hpp.

template<class RCPType >
void Teuchos::RCPNodeHandle::assert_valid_ptr ( const RCPType &  rcp_obj) const [inline]

Definition at line 907 of file Teuchos_RCPNode.hpp.

template<class RCPType >
void Teuchos::RCPNodeHandle::debug_assert_valid_ptr ( const RCPType &  rcp_obj) const [inline]

Definition at line 918 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNodeHandle::bind ( ) [inline, private]

Definition at line 935 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNodeHandle::unbind ( ) [inline, private]

Definition at line 940 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNodeHandle::unbindOne ( ) [private]

Definition at line 667 of file Teuchos_RCPNode.cpp.


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  out,
const RCPNodeHandle node 
) [related]

Ouput stream operator for RCPNodeHandle.

Definition at line 964 of file Teuchos_RCPNode.hpp.


Member Data Documentation

Definition at line 933 of file Teuchos_RCPNode.hpp.

Definition at line 934 of file Teuchos_RCPNode.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines