#include <Teuchos_RefCountPtrDecl.hpp>
Inheritance diagram for Teuchos::RefCountPtr< T >:
Public Types | |
| typedef T | element_type |
Public Member Functions | |
| RefCountPtr (ENull null_arg=null) | |
Initialize RefCountPtr<T> to NULL. | |
| RefCountPtr (const RefCountPtr< T > &r_ptr) | |
Initialize from another RefCountPtr<T> object. | |
| template<class T2> | |
| RefCountPtr (const RefCountPtr< T2 > &r_ptr) | |
Initialize from another RefCountPtr<T2> object (implicit conversion only). | |
| ~RefCountPtr () | |
| Removes a reference to a dynamically allocated object and possibly deletes the object if owned. | |
| RefCountPtr< T > & | operator= (const RefCountPtr< T > &r_ptr) |
| Copy the pointer to the referenced object and increment the reference count. | |
| T * | operator-> () const |
Pointer (->) access to members of underlying object. | |
| T & | operator * () const |
| Dereference the underlying object. | |
| T * | get () const |
| Get the raw C++ pointer to the underlying object. | |
| T * | release () |
| Release the ownership of the underlying dynamically allocated object. | |
| int | count () const |
Return the number of RefCountPtr<> objects that have a reference to the underlying pointer that is being shared. | |
| void | set_has_ownership () |
Give this and other RefCountPtr<> objects ownership of the referenced object this->get(). | |
| bool | has_ownership () const |
Returns true if this has ownership of object pointed to by this->get() in order to delete it. | |
| bool | shares_resource (const RefCountPtr< T > &r_ptr) const |
| Returns true if the smart pointers share the same underlying reference-counted object. | |
| const RefCountPtr< T > & | assert_not_null () const |
Throws std::logic_error if this->get()==NULL, otherwise returns reference to *this. | |
Private Types | |
| typedef PrivateUtilityPack::RefCountPtr_node | node_t |
Private Attributes | |
| T * | ptr_ |
| node_t * | node_ |
This is a class for smart reference counted pointer objects that deletes an object (if the object is owned) that was allocated by new after all refereces to it have been removed.
To see how to use this class see description.
Definition at line 344 of file Teuchos_RefCountPtrDecl.hpp.
|
|||||
|
Definition at line 347 of file Teuchos_RefCountPtrDecl.hpp. |
|
|||||
|
Definition at line 514 of file Teuchos_RefCountPtrDecl.hpp. |
|
||||||||||
|
Initialize This allows clients to write code like: RefCountPtr<int> p = null; RefCountPtr<int> p; NULL
Definition at line 152 of file Teuchos_RefCountPtr.hpp. |
|
||||||||||
|
Initialize from another
After construction, This form of the copy constructor is required even though the below more general templated version is sufficient since some compilers will generate this function automatically which will give an incorrect implementation. Postconditons:
Definition at line 159 of file Teuchos_RefCountPtr.hpp. |
|
||||||||||||||
|
Initialize from another
This function allows the implicit conversion of smart pointer objects just like with raw C++ pointers. Note that this function will only compile if the statement Postconditons:
Definition at line 168 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Removes a reference to a dynamically allocated object and possibly deletes the object if owned.
Peforms Definition at line 177 of file Teuchos_RefCountPtr.hpp. |
|
||||||||||
|
Copy the pointer to the referenced object and increment the reference count.
If Postconditons:
Definition at line 184 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Pointer ( Preconditions:
Definition at line 200 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Dereference the underlying object. Preconditions:
Definition at line 209 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Get the raw C++ pointer to the underlying object.
Definition at line 218 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Release the ownership of the underlying dynamically allocated object.
After this function is called then the client is responsible for calling delete on the returned pointer no matter how many
Note that this function does not have the exact same semantics as does Postconditions:
Definition at line 224 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Return the number of
Definition at line 232 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Give
See ~RefCountPtr() above. This function does nothing if Postconditions:
Definition at line 240 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Returns true if See ~RefCountPtr() above.
Definition at line 247 of file Teuchos_RefCountPtr.hpp. |
|
||||||||||
|
Returns true if the smart pointers share the same underlying reference-counted object.
This method does more than just check if Definition at line 255 of file Teuchos_RefCountPtr.hpp. |
|
|||||||||
|
Throws
Definition at line 261 of file Teuchos_RefCountPtr.hpp. |
|
|||||
|
Definition at line 519 of file Teuchos_RefCountPtrDecl.hpp. |
|
|||||
|
Definition at line 520 of file Teuchos_RefCountPtrDecl.hpp. |
1.3.9.1