Teuchos::RCPNodeHandle Class Reference
[Teuchos Memory Management Utilities]

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
 

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 650 of file Teuchos_RCPNode.hpp.


Constructor & Destructor Documentation

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

Definition at line 653 of file Teuchos_RCPNode.hpp.

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

Definition at line 657 of file Teuchos_RCPNode.hpp.

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

Definition at line 701 of file Teuchos_RCPNode.hpp.

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

Definition at line 728 of file Teuchos_RCPNode.hpp.


Member Function Documentation

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

Definition at line 707 of file Teuchos_RCPNode.hpp.

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

(Strong guarantee).

Definition at line 713 of file Teuchos_RCPNode.hpp.

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

Definition at line 733 of file Teuchos_RCPNode.hpp.

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

Definition at line 741 of file Teuchos_RCPNode.hpp.

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

Definition at line 749 of file Teuchos_RCPNode.hpp.

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

Definition at line 754 of file Teuchos_RCPNode.hpp.

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

Definition at line 759 of file Teuchos_RCPNode.hpp.

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

Definition at line 766 of file Teuchos_RCPNode.hpp.

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

Definition at line 771 of file Teuchos_RCPNode.hpp.

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

Definition at line 778 of file Teuchos_RCPNode.hpp.

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

Definition at line 785 of file Teuchos_RCPNode.hpp.

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

Backward compatibility.

Definition at line 792 of file Teuchos_RCPNode.hpp.

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

Definition at line 799 of file Teuchos_RCPNode.hpp.

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

Definition at line 804 of file Teuchos_RCPNode.hpp.

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

Definition at line 810 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 817 of file Teuchos_RCPNode.hpp.

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

Definition at line 826 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 834 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 841 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 849 of file Teuchos_RCPNode.hpp.

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

Definition at line 856 of file Teuchos_RCPNode.hpp.

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

Definition at line 865 of file Teuchos_RCPNode.hpp.

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

Definition at line 876 of file Teuchos_RCPNode.hpp.


Friends And Related Function Documentation

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

Ouput stream operator for RCPNodeHandle.

Definition at line 922 of file Teuchos_RCPNode.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:23:02 2010 for Teuchos - Trilinos Tools Package by  doxygen 1.4.7