Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Related Symbols | List of all members
Teuchos::RCPNode Class Referenceabstract

Node class to keep track of address and the reference count for a reference-counted utility class and delete the object. More...

#include <Teuchos_RCPNode.hpp>

Inheritance diagram for Teuchos::RCPNode:
Inheritance graph
[legend]

Classes

struct  extra_data_entry_t
 

Public Member Functions

 RCPNode (bool has_ownership_in)
 
virtual ~RCPNode ()
 
bool attemptIncrementStrongCountFromNonZeroValue ()
 attemptIncrementStrongCountFromNonZeroValue() supports weak to strong conversion but this is forward looking code.
 
int strong_count () const
 
int weak_count () const
 
void incr_count (const ERCPStrength strength)
 
int deincr_count (const ERCPStrength strength)
 
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
 
virtual bool is_valid_ptr () const =0
 
virtual void delete_obj ()=0
 
virtual void throw_invalid_obj_exception (const std::string &rcp_type_name, const void *rcp_ptr, const RCPNode *rcp_node_ptr, const void *rcp_obj_ptr) const =0
 
virtual const std::string get_base_obj_type_name () const =0
 

Protected Member Functions

void pre_delete_extra_data ()
 

Private Types

typedef Teuchos::map< std::string, extra_data_entry_textra_data_map_t
 

Private Member Functions

 TEUCHOS_RCP_DECL_ATOMIC (count_[2], int)
 
 TEUCHOS_RCP_DECL_ATOMIC (has_ownership_, bool)
 
void impl_pre_delete_extra_data ()
 
 RCPNode ()
 
 RCPNode (const RCPNode &)
 
RCPNodeoperator= (const RCPNode &)
 

Private Attributes

extra_data_map_textra_data_map_
 

Related Symbols

(Note that these are not member symbols.)

TEUCHOSCORE_LIB_DLL_EXPORT void throw_null_ptr_error (const std::string &type_name)
 Throw that a pointer passed into an RCP object is null.
 

Detailed Description

Node class to keep track of address and the reference count for a reference-counted utility class and delete the object.

This is not a general user-level class. This is used in the implementation of all of the reference-counting utility classes.

NOTE: The reference counts all start a 0 so the client (i.e. RCPNodeHandle) must increment them from 0 after creation.

Definition at line 153 of file Teuchos_RCPNode.hpp.

Member Typedef Documentation

◆ extra_data_map_t

Definition at line 299 of file Teuchos_RCPNode.hpp.

Constructor & Destructor Documentation

◆ RCPNode() [1/3]

Teuchos::RCPNode::RCPNode ( bool has_ownership_in)
inline

Definition at line 156 of file Teuchos_RCPNode.hpp.

◆ ~RCPNode()

virtual Teuchos::RCPNode::~RCPNode ( )
inlinevirtual

Definition at line 166 of file Teuchos_RCPNode.hpp.

◆ RCPNode() [2/3]

Teuchos::RCPNode::RCPNode ( )
private

◆ RCPNode() [3/3]

Teuchos::RCPNode::RCPNode ( const RCPNode & )
private

Member Function Documentation

◆ attemptIncrementStrongCountFromNonZeroValue()

bool Teuchos::RCPNode::attemptIncrementStrongCountFromNonZeroValue ( )
inline

attemptIncrementStrongCountFromNonZeroValue() supports weak to strong conversion but this is forward looking code.

Definition at line 174 of file Teuchos_RCPNode.hpp.

◆ strong_count()

int Teuchos::RCPNode::strong_count ( ) const
inline

Definition at line 202 of file Teuchos_RCPNode.hpp.

◆ weak_count()

int Teuchos::RCPNode::weak_count ( ) const
inline

Definition at line 207 of file Teuchos_RCPNode.hpp.

◆ incr_count()

void Teuchos::RCPNode::incr_count ( const ERCPStrength strength)
inline

Definition at line 212 of file Teuchos_RCPNode.hpp.

◆ deincr_count()

int Teuchos::RCPNode::deincr_count ( const ERCPStrength strength)
inline

Definition at line 222 of file Teuchos_RCPNode.hpp.

◆ has_ownership() [1/2]

void Teuchos::RCPNode::has_ownership ( bool has_ownership_in)
inline

Definition at line 233 of file Teuchos_RCPNode.hpp.

◆ has_ownership() [2/2]

bool Teuchos::RCPNode::has_ownership ( ) const
inline

Definition at line 238 of file Teuchos_RCPNode.hpp.

◆ set_extra_data()

void Teuchos::RCPNode::set_extra_data ( const any & extra_data,
const std::string & name,
EPrePostDestruction destroy_when,
bool force_unique )

Definition at line 215 of file Teuchos_RCPNode.cpp.

◆ get_extra_data() [1/2]

any & Teuchos::RCPNode::get_extra_data ( const std::string & type_name,
const std::string & name )

Definition at line 245 of file Teuchos_RCPNode.cpp.

◆ get_extra_data() [2/2]

const any & Teuchos::RCPNode::get_extra_data ( const std::string & type_name,
const std::string & name ) const
inline

Definition at line 250 of file Teuchos_RCPNode.hpp.

◆ get_optional_extra_data() [1/2]

any * Teuchos::RCPNode::get_optional_extra_data ( const std::string & type_name,
const std::string & name )

Definition at line 265 of file Teuchos_RCPNode.cpp.

◆ get_optional_extra_data() [2/2]

const any * Teuchos::RCPNode::get_optional_extra_data ( const std::string & type_name,
const std::string & name ) const
inline

Definition at line 260 of file Teuchos_RCPNode.hpp.

◆ is_valid_ptr()

virtual bool Teuchos::RCPNode::is_valid_ptr ( ) const
pure virtual

◆ delete_obj()

virtual void Teuchos::RCPNode::delete_obj ( )
pure virtual

◆ throw_invalid_obj_exception()

virtual void Teuchos::RCPNode::throw_invalid_obj_exception ( const std::string & rcp_type_name,
const void * rcp_ptr,
const RCPNode * rcp_node_ptr,
const void * rcp_obj_ptr ) const
pure virtual

◆ get_base_obj_type_name()

virtual const std::string Teuchos::RCPNode::get_base_obj_type_name ( ) const
pure virtual

◆ pre_delete_extra_data()

void Teuchos::RCPNode::pre_delete_extra_data ( )
inlineprotected

Definition at line 285 of file Teuchos_RCPNode.hpp.

◆ TEUCHOS_RCP_DECL_ATOMIC() [1/2]

Teuchos::RCPNode::TEUCHOS_RCP_DECL_ATOMIC ( count_ [2],
int  )
private

◆ TEUCHOS_RCP_DECL_ATOMIC() [2/2]

Teuchos::RCPNode::TEUCHOS_RCP_DECL_ATOMIC ( has_ownership_ ,
bool  )
private

◆ impl_pre_delete_extra_data()

void Teuchos::RCPNode::impl_pre_delete_extra_data ( )
private

Definition at line 277 of file Teuchos_RCPNode.cpp.

◆ operator=()

RCPNode & Teuchos::RCPNode::operator= ( const RCPNode & )
private

Friends And Related Symbol Documentation

◆ throw_null_ptr_error()

TEUCHOSCORE_LIB_DLL_EXPORT void throw_null_ptr_error ( const std::string & type_name)
related

Throw that a pointer passed into an RCP object is null.

Member Data Documentation

◆ extra_data_map_

extra_data_map_t* Teuchos::RCPNode::extra_data_map_
private

Definition at line 304 of file Teuchos_RCPNode.hpp.


The documentation for this class was generated from the following files: