Teuchos::RCPNode Class Reference

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]

List of all members.

Classes

struct  extra_data_entry_t

Public Member Functions

 RCPNode (bool has_ownership_in)
 
virtual ~RCPNode ()
 
int strong_count () const
 
int weak_count () const
 
int 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
 

Protected Member Functions

void pre_delete_extra_data ()
 

Private Types

typedef Teuchos::map
< std::string,
extra_data_entry_t
extra_data_map_t

Private Member Functions

void impl_pre_delete_extra_data ()
 RCPNode ()
 RCPNode (const RCPNode &)
RCPNodeoperator= (const RCPNode &)

Private Attributes

int strong_count_
int weak_count_
bool has_ownership_
extra_data_map_textra_data_map_

Related Functions

(Note that these are not member functions.)



bool isTracingActiveRCPNodes ()
 Return if we are tracing active nodes or not.
void printActiveRCPNodes (std::ostream &out)
 Print the list of currently active RCP nodes.

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.

Definition at line 104 of file Teuchos_RCPNode.hpp.


Member Typedef Documentation

typedef Teuchos::map<std::string,extra_data_entry_t> Teuchos::RCPNode::extra_data_map_t [private]

Definition at line 216 of file Teuchos_RCPNode.hpp.


Constructor & Destructor Documentation

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

Definition at line 107 of file Teuchos_RCPNode.hpp.

virtual Teuchos::RCPNode::~RCPNode (  )  [inline, virtual]

Definition at line 112 of file Teuchos_RCPNode.hpp.

Teuchos::RCPNode::RCPNode (  )  [private]
Teuchos::RCPNode::RCPNode ( const RCPNode  )  [private]

Member Function Documentation

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

Definition at line 118 of file Teuchos_RCPNode.hpp.

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

Definition at line 123 of file Teuchos_RCPNode.hpp.

int Teuchos::RCPNode::incr_count ( const ERCPStrength  strength  )  [inline]

Definition at line 128 of file Teuchos_RCPNode.hpp.

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

Definition at line 142 of file Teuchos_RCPNode.hpp.

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

Definition at line 156 of file Teuchos_RCPNode.hpp.

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

Definition at line 161 of file Teuchos_RCPNode.hpp.

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

Definition at line 93 of file Teuchos_RCPNode.cpp.

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

Definition at line 117 of file Teuchos_RCPNode.cpp.

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

Definition at line 173 of file Teuchos_RCPNode.hpp.

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

Definition at line 137 of file Teuchos_RCPNode.cpp.

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

Definition at line 183 of file Teuchos_RCPNode.hpp.

virtual bool Teuchos::RCPNode::is_valid_ptr (  )  const [pure virtual]
virtual void Teuchos::RCPNode::delete_obj (  )  [pure virtual]
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]

void Teuchos::RCPNode::pre_delete_extra_data (  )  [inline, protected]

Definition at line 202 of file Teuchos_RCPNode.hpp.

void Teuchos::RCPNode::impl_pre_delete_extra_data (  )  [private]

Definition at line 149 of file Teuchos_RCPNode.cpp.

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

Friends And Related Function Documentation

bool isTracingActiveRCPNodes (  )  [related]

Return if we are tracing active nodes or not.

NOTE: This will always return false when TEUCHOS_DEBUG is not defined.

void printActiveRCPNodes ( std::ostream &  out  )  [related]

Print the list of currently active RCP nodes.

When the macro TEUCHOS_SHOW_ACTIVE_REFCOUNTPTR_NODE_TRACE is defined, this function will print out all of the RCP nodes that are currently active. This function can be called at any time during a program.

When the macro TEUCHOS_SHOW_ACTIVE_REFCOUNTPTR_NODE_TRACE is defined this function will get called automatically after the program ends and all of the local and global RCP objects have been destroyed. If any RCP nodes are printed at that time, then this is an indication that there may be some circular references that will caused memory leaks. You memory checking tool such as valgrind or purify should complain about this!


Member Data Documentation

Definition at line 217 of file Teuchos_RCPNode.hpp.

Definition at line 218 of file Teuchos_RCPNode.hpp.

Definition at line 219 of file Teuchos_RCPNode.hpp.

Definition at line 220 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

Generated on Tue Oct 20 10:14:05 2009 for Teuchos Package Browser (Single Doxygen Collection) by  doxygen 1.6.1