Teuchos - Trilinos Tools Package
Version of the Day
|
Handle class that manages the RCPNode's reference counting. More...
#include <Teuchos_RCPNode.hpp>
Public Member Functions | |
RCPNodeHandle (ENull null_arg=null) | |
Default constructor. More... | |
RCPNodeHandle (RCPNode *node, ERCPStrength strength_in=RCP_STRONG, bool newNode=true) | |
Constructor that takes a pointer to an RCPNode. More... | |
RCPNodeHandle (const RCPNodeHandle &node_ref) | |
Copy constructor. More... | |
RCPNodeHandle (RCPNodeHandle &&node_ref) | |
Move constructor. More... | |
void | swap (RCPNodeHandle &node_ref) |
Swap the contents of node_ref with *this . More... | |
RCPNodeHandle & | operator= (ENull) |
Null assignment. More... | |
RCPNodeHandle & | operator= (const RCPNodeHandle &node_ref) |
Copy assignment operator. More... | |
RCPNodeHandle & | operator= (RCPNodeHandle &&node_ref) |
Move assignment operator. More... | |
~RCPNodeHandle () | |
Destructor. More... | |
RCPNodeHandle | create_strong_lock () const |
Return a strong handle if possible using thread safe atomics. More... | |
RCPNodeHandle | create_weak () const |
Return a weak handle. More... | |
RCPNodeHandle | create_strong () const |
Return a strong handle. More... | |
RCPNode * | node_ptr () const |
Return a pointer to the underlying RCPNode. More... | |
bool | is_node_null () const |
Whether the underlying RCPNode is NULL. More... | |
bool | is_valid_ptr () const |
Whether the underlying pointer is valid. More... | |
bool | same_node (const RCPNodeHandle &node2) const |
Whether the RCPNode for which node2 is a handle is the same RCPNode as this object's RCPNode. More... | |
int | strong_count () const |
The strong count for this RCPNode, or 0 if the node is NULL. More... | |
int | weak_count () const |
The weak count for this RCPNode, or 0 if the node is NULL. More... | |
int | total_count () const |
The sum of the weak and string counts. More... | |
ERCPStrength | strength () const |
The strength of this handle. More... | |
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) |
any & | get_extra_data (const std::string &type_name, const std::string &name) |
const any & | get_extra_data (const std::string &type_name, const std::string &name) const |
any * | get_optional_extra_data (const std::string &type_name, const std::string &name) |
const any * | get_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. More... | |
Handle class that manages the RCPNode's reference counting.
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 716 of file Teuchos_RCPNode.hpp.
|
inline |
Default constructor.
Definition at line 719 of file Teuchos_RCPNode.hpp.
|
inline |
Constructor that takes a pointer to an RCPNode.
Definition at line 726 of file Teuchos_RCPNode.hpp.
|
inline |
Copy constructor.
Definition at line 775 of file Teuchos_RCPNode.hpp.
|
inline |
Move constructor.
Definition at line 782 of file Teuchos_RCPNode.hpp.
|
inline |
Destructor.
Definition at line 841 of file Teuchos_RCPNode.hpp.
|
inline |
Swap the contents of node_ref
with *this
.
Definition at line 790 of file Teuchos_RCPNode.hpp.
|
inline |
Null assignment.
This method satisfies the strong exception guarantee: It either returns successfully, or throws an exception without modifying any user-visible state.
Definition at line 802 of file Teuchos_RCPNode.hpp.
|
inline |
Copy assignment operator.
This method satisfies the strong exception guarantee: It either returns successfully, or throws an exception without modifying any user-visible state.
Definition at line 814 of file Teuchos_RCPNode.hpp.
|
inline |
Move assignment operator.
This method satisfies the strong exception guarantee: It either returns successfully, or throws an exception without modifying any user-visible state.
Definition at line 829 of file Teuchos_RCPNode.hpp.
|
inline |
Return a strong handle if possible using thread safe atomics.
Definition at line 847 of file Teuchos_RCPNode.hpp.
|
inline |
Return a weak handle.
Definition at line 857 of file Teuchos_RCPNode.hpp.
|
inline |
Return a strong handle.
Definition at line 864 of file Teuchos_RCPNode.hpp.
|
inline |
Return a pointer to the underlying RCPNode.
Definition at line 871 of file Teuchos_RCPNode.hpp.
|
inline |
Whether the underlying RCPNode is NULL.
Definition at line 875 of file Teuchos_RCPNode.hpp.
|
inline |
Whether the underlying pointer is valid.
Definition at line 881 of file Teuchos_RCPNode.hpp.
|
inline |
Whether the RCPNode for which node2
is a handle is the same RCPNode as this object's RCPNode.
Definition at line 889 of file Teuchos_RCPNode.hpp.
|
inline |
The strong count for this RCPNode, or 0 if the node is NULL.
Definition at line 893 of file Teuchos_RCPNode.hpp.
|
inline |
The weak count for this RCPNode, or 0 if the node is NULL.
Definition at line 900 of file Teuchos_RCPNode.hpp.
|
inline |
The sum of the weak and string counts.
Definition at line 907 of file Teuchos_RCPNode.hpp.
|
inline |
The strength of this handle.
Definition at line 914 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 918 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 924 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 931 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 940 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 948 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 955 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 963 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 970 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 979 of file Teuchos_RCPNode.hpp.
|
inline |
Definition at line 990 of file Teuchos_RCPNode.hpp.
|
related |
Ouput stream operator for RCPNodeHandle.
Definition at line 1053 of file Teuchos_RCPNode.hpp.