Teuchos - Trilinos Tools Package Version of the Day
Public Member Functions | Related Functions
Teuchos::RCPNodeHandle Class Reference

Utility handle class for handling the reference counting and management 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 management 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. Second, 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 686 of file Teuchos_RCPNode.hpp.


Constructor & Destructor Documentation

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

Definition at line 689 of file Teuchos_RCPNode.hpp.

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

Definition at line 693 of file Teuchos_RCPNode.hpp.

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

Definition at line 737 of file Teuchos_RCPNode.hpp.

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

Definition at line 764 of file Teuchos_RCPNode.hpp.


Member Function Documentation

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

Definition at line 743 of file Teuchos_RCPNode.hpp.

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

(Strong guarantee).

Definition at line 749 of file Teuchos_RCPNode.hpp.

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

Definition at line 769 of file Teuchos_RCPNode.hpp.

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

Definition at line 777 of file Teuchos_RCPNode.hpp.

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

Definition at line 785 of file Teuchos_RCPNode.hpp.

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

Definition at line 790 of file Teuchos_RCPNode.hpp.

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

Definition at line 795 of file Teuchos_RCPNode.hpp.

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

Definition at line 802 of file Teuchos_RCPNode.hpp.

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

Definition at line 807 of file Teuchos_RCPNode.hpp.

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

Definition at line 814 of file Teuchos_RCPNode.hpp.

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

Definition at line 821 of file Teuchos_RCPNode.hpp.

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

Backward compatibility.

Definition at line 828 of file Teuchos_RCPNode.hpp.

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

Definition at line 835 of file Teuchos_RCPNode.hpp.

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

Definition at line 840 of file Teuchos_RCPNode.hpp.

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

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

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

Definition at line 862 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 870 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 877 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 885 of file Teuchos_RCPNode.hpp.

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

Definition at line 892 of file Teuchos_RCPNode.hpp.

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

Definition at line 901 of file Teuchos_RCPNode.hpp.

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

Definition at line 912 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 958 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