Support Software for Vector Reduction/Transformation Operators Version of the Day
Classes
RTOpPack::Teuchos::RCPNodeTracer Class Reference

Debug-mode RCPNode tracing class. More...

#include <RTOpPack_SPMD_apply_op_def.hpp>

List of all members.

Classes

struct  RCPNodeStatistics
 RCP statistics struct. More...

General user functions (can be called by any client)

static bool isTracingActiveRCPNodes ()
 Return if we are tracing active nodes or not.
static int numActiveRCPNodes ()
 Print the number of active RCPNode objects currently being tracked.
static RCPNodeStatistics getRCPNodeStatistics ()
 Return the statistics on RCPNode allocations.
static void printRCPNodeStatistics (const RCPNodeStatistics &rcpNodeStatistics, std::ostream &out)
 Print the RCPNode allocation statistics.
static void setPrintRCPNodeStatisticsOnExit (bool printRCPNodeStatisticsOnExit)
 Set if RCPNode usage statistics will be printed when the program ends or not.
static bool getPrintRCPNodeStatisticsOnExit ()
 Reteurn if RCPNode usage statistics will be printed when the program ends or not.
static void printActiveRCPNodes (std::ostream &out)
 Print the list of currently active RCP nodes.
static bool isTracingActiveRCPNodes ()
 Return if we are tracing active nodes or not.
static int numActiveRCPNodes ()
 Print the number of active RCPNode objects currently being tracked.
static RCPNodeStatistics getRCPNodeStatistics ()
 Return the statistics on RCPNode allocations.
static void printRCPNodeStatistics (const RCPNodeStatistics &rcpNodeStatistics, std::ostream &out)
 Print the RCPNode allocation statistics.
static void setPrintRCPNodeStatisticsOnExit (bool printRCPNodeStatisticsOnExit)
 Set if RCPNode usage statistics will be printed when the program ends or not.
static bool getPrintRCPNodeStatisticsOnExit ()
 Reteurn if RCPNode usage statistics will be printed when the program ends or not.
static void printActiveRCPNodes (std::ostream &out)
 Print the list of currently active RCP nodes.
static bool isTracingActiveRCPNodes ()
 Return if we are tracing active nodes or not.
static int numActiveRCPNodes ()
 Print the number of active RCPNode objects currently being tracked.
static RCPNodeStatistics getRCPNodeStatistics ()
 Return the statistics on RCPNode allocations.
static void printRCPNodeStatistics (const RCPNodeStatistics &rcpNodeStatistics, std::ostream &out)
 Print the RCPNode allocation statistics.
static void setPrintRCPNodeStatisticsOnExit (bool printRCPNodeStatisticsOnExit)
 Set if RCPNode usage statistics will be printed when the program ends or not.
static bool getPrintRCPNodeStatisticsOnExit ()
 Reteurn if RCPNode usage statistics will be printed when the program ends or not.
static void printActiveRCPNodes (std::ostream &out)
 Print the list of currently active RCP nodes.
static bool isTracingActiveRCPNodes ()
 Return if we are tracing active nodes or not.
static int numActiveRCPNodes ()
 Print the number of active RCPNode objects currently being tracked.
static RCPNodeStatistics getRCPNodeStatistics ()
 Return the statistics on RCPNode allocations.
static void printRCPNodeStatistics (const RCPNodeStatistics &rcpNodeStatistics, std::ostream &out)
 Print the RCPNode allocation statistics.
static void setPrintRCPNodeStatisticsOnExit (bool printRCPNodeStatisticsOnExit)
 Set if RCPNode usage statistics will be printed when the program ends or not.
static bool getPrintRCPNodeStatisticsOnExit ()
 Reteurn if RCPNode usage statistics will be printed when the program ends or not.
static void printActiveRCPNodes (std::ostream &out)
 Print the list of currently active RCP nodes.

Internal implementation functions (not to be called by general

clients).

static void addNewRCPNode (RCPNode *rcp_node, const std::string &info)
 Add new RCPNode to the global list.
static void removeRCPNode (RCPNode *rcp_node)
 Remove an RCPNode from global list.
template<class T >
static const void * getRCPNodeBaseObjMapKeyVoidPtr (T *p)
 Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.
static RCPNodegetExistingRCPNodeGivenLookupKey (const void *lookupKey)
 Return a raw pointer to an existing owning RCPNode given its lookup key.
template<class T >
static RCPNodegetExistingRCPNode (T *p)
 Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.
static std::string getActiveRCPNodeHeaderString ()
 Header string used in printActiveRCPNodes().
static std::string getCommonDebugNotesString ()
 Common error message string on how to debug RCPNode problems.
static void addNewRCPNode (RCPNode *rcp_node, const std::string &info)
 Add new RCPNode to the global list.
static void removeRCPNode (RCPNode *rcp_node)
 Remove an RCPNode from global list.
template<class T >
static const void * getRCPNodeBaseObjMapKeyVoidPtr (T *p)
 Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.
static RCPNodegetExistingRCPNodeGivenLookupKey (const void *lookupKey)
 Return a raw pointer to an existing owning RCPNode given its lookup key.
template<class T >
static RCPNodegetExistingRCPNode (T *p)
 Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.
static std::string getActiveRCPNodeHeaderString ()
 Header string used in printActiveRCPNodes().
static std::string getCommonDebugNotesString ()
 Common error message string on how to debug RCPNode problems.
static void addNewRCPNode (RCPNode *rcp_node, const std::string &info)
 Add new RCPNode to the global list.
static void removeRCPNode (RCPNode *rcp_node)
 Remove an RCPNode from global list.
template<class T >
static const void * getRCPNodeBaseObjMapKeyVoidPtr (T *p)
 Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.
static RCPNodegetExistingRCPNodeGivenLookupKey (const void *lookupKey)
 Return a raw pointer to an existing owning RCPNode given its lookup key.
template<class T >
static RCPNodegetExistingRCPNode (T *p)
 Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.
static std::string getActiveRCPNodeHeaderString ()
 Header string used in printActiveRCPNodes().
static std::string getCommonDebugNotesString ()
 Common error message string on how to debug RCPNode problems.
static void addNewRCPNode (RCPNode *rcp_node, const std::string &info)
 Add new RCPNode to the global list.
static void removeRCPNode (RCPNode *rcp_node)
 Remove an RCPNode from global list.
template<class T >
static const void * getRCPNodeBaseObjMapKeyVoidPtr (T *p)
 Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.
static RCPNodegetExistingRCPNodeGivenLookupKey (const void *lookupKey)
 Return a raw pointer to an existing owning RCPNode given its lookup key.
template<class T >
static RCPNodegetExistingRCPNode (T *p)
 Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.
static std::string getActiveRCPNodeHeaderString ()
 Header string used in printActiveRCPNodes().
static std::string getCommonDebugNotesString ()
 Common error message string on how to debug RCPNode problems.

Detailed Description

Debug-mode RCPNode tracing class.

This is a static class that is used to trace all RCP nodes that are created and destroyed and to look-up RCPNodes given an an object's address. This database is used for several different types of debug-mode runtime checking including a) the detection of cicular references, b) detecting the creation of duplicate owning RCPNode objects for the same reference-counted object, and c) to create weak RCP objects for existing RCPNode objects.

This is primarily an internal implementation class but there are a few functions (maked as such below) that can be called by general users to turn on and off node tracing and to print the active RCPNode objects at any time.

Definition at line 307 of file RTOpPack_SPMD_apply_op_def.hpp.


Member Function Documentation

static bool RTOpPack::Teuchos::RCPNodeTracer::isTracingActiveRCPNodes ( ) [static]

Return if we are tracing active nodes or not.

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

static int RTOpPack::Teuchos::RCPNodeTracer::numActiveRCPNodes ( ) [static]

Print the number of active RCPNode objects currently being tracked.

static RCPNodeStatistics RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeStatistics ( ) [static]

Return the statistics on RCPNode allocations.

static void RTOpPack::Teuchos::RCPNodeTracer::printRCPNodeStatistics ( const RCPNodeStatistics rcpNodeStatistics,
std::ostream &  out 
) [static]

Print the RCPNode allocation statistics.

static void RTOpPack::Teuchos::RCPNodeTracer::setPrintRCPNodeStatisticsOnExit ( bool  printRCPNodeStatisticsOnExit) [static]

Set if RCPNode usage statistics will be printed when the program ends or not.

static bool RTOpPack::Teuchos::RCPNodeTracer::getPrintRCPNodeStatisticsOnExit ( ) [static]

Reteurn if RCPNode usage statistics will be printed when the program ends or not.

static void RTOpPack::Teuchos::RCPNodeTracer::printActiveRCPNodes ( std::ostream &  out) [static]

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!

static void RTOpPack::Teuchos::RCPNodeTracer::addNewRCPNode ( RCPNode rcp_node,
const std::string &  info 
) [static]

Add new RCPNode to the global list.

Only gets called when RCPNode tracing has been activated.

static void RTOpPack::Teuchos::RCPNodeTracer::removeRCPNode ( RCPNode rcp_node) [static]

Remove an RCPNode from global list.

Always gets called in a debug build (TEUCHOS_DEBUG defined) when node tracing is enabled.

template<class T >
static const void* RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeBaseObjMapKeyVoidPtr ( T *  p) [inline, static]

Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.

This only returns the base address reliabily for all types if HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR is defined.

Returns:
0 if p == 0.

Definition at line 426 of file RTOpPack_SPMD_apply_op_def.hpp.

static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNodeGivenLookupKey ( const void *  lookupKey) [static]

Return a raw pointer to an existing owning RCPNode given its lookup key.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.
template<class T >
static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNode ( T *  p) [inline, static]

Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.

Definition at line 456 of file RTOpPack_SPMD_apply_op_def.hpp.

static std::string RTOpPack::Teuchos::RCPNodeTracer::getActiveRCPNodeHeaderString ( ) [static]

Header string used in printActiveRCPNodes().

static std::string RTOpPack::Teuchos::RCPNodeTracer::getCommonDebugNotesString ( ) [static]

Common error message string on how to debug RCPNode problems.

static bool RTOpPack::Teuchos::RCPNodeTracer::isTracingActiveRCPNodes ( ) [static]

Return if we are tracing active nodes or not.

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

static int RTOpPack::Teuchos::RCPNodeTracer::numActiveRCPNodes ( ) [static]

Print the number of active RCPNode objects currently being tracked.

static RCPNodeStatistics RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeStatistics ( ) [static]

Return the statistics on RCPNode allocations.

static void RTOpPack::Teuchos::RCPNodeTracer::printRCPNodeStatistics ( const RCPNodeStatistics rcpNodeStatistics,
std::ostream &  out 
) [static]

Print the RCPNode allocation statistics.

static void RTOpPack::Teuchos::RCPNodeTracer::setPrintRCPNodeStatisticsOnExit ( bool  printRCPNodeStatisticsOnExit) [static]

Set if RCPNode usage statistics will be printed when the program ends or not.

static bool RTOpPack::Teuchos::RCPNodeTracer::getPrintRCPNodeStatisticsOnExit ( ) [static]

Reteurn if RCPNode usage statistics will be printed when the program ends or not.

static void RTOpPack::Teuchos::RCPNodeTracer::printActiveRCPNodes ( std::ostream &  out) [static]

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!

static void RTOpPack::Teuchos::RCPNodeTracer::addNewRCPNode ( RCPNode rcp_node,
const std::string &  info 
) [static]

Add new RCPNode to the global list.

Only gets called when RCPNode tracing has been activated.

static void RTOpPack::Teuchos::RCPNodeTracer::removeRCPNode ( RCPNode rcp_node) [static]

Remove an RCPNode from global list.

Always gets called in a debug build (TEUCHOS_DEBUG defined) when node tracing is enabled.

template<class T >
static const void* RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeBaseObjMapKeyVoidPtr ( T *  p) [inline, static]

Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.

This only returns the base address reliabily for all types if HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR is defined.

Returns:
0 if p == 0.

Definition at line 426 of file RTOpPack_SPMD_apply_op_def.hpp.

static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNodeGivenLookupKey ( const void *  lookupKey) [static]

Return a raw pointer to an existing owning RCPNode given its lookup key.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.
template<class T >
static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNode ( T *  p) [inline, static]

Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.

Definition at line 456 of file RTOpPack_SPMD_apply_op_def.hpp.

static std::string RTOpPack::Teuchos::RCPNodeTracer::getActiveRCPNodeHeaderString ( ) [static]

Header string used in printActiveRCPNodes().

static std::string RTOpPack::Teuchos::RCPNodeTracer::getCommonDebugNotesString ( ) [static]

Common error message string on how to debug RCPNode problems.

static bool RTOpPack::Teuchos::RCPNodeTracer::isTracingActiveRCPNodes ( ) [static]

Return if we are tracing active nodes or not.

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

static int RTOpPack::Teuchos::RCPNodeTracer::numActiveRCPNodes ( ) [static]

Print the number of active RCPNode objects currently being tracked.

static RCPNodeStatistics RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeStatistics ( ) [static]

Return the statistics on RCPNode allocations.

static void RTOpPack::Teuchos::RCPNodeTracer::printRCPNodeStatistics ( const RCPNodeStatistics rcpNodeStatistics,
std::ostream &  out 
) [static]

Print the RCPNode allocation statistics.

static void RTOpPack::Teuchos::RCPNodeTracer::setPrintRCPNodeStatisticsOnExit ( bool  printRCPNodeStatisticsOnExit) [static]

Set if RCPNode usage statistics will be printed when the program ends or not.

static bool RTOpPack::Teuchos::RCPNodeTracer::getPrintRCPNodeStatisticsOnExit ( ) [static]

Reteurn if RCPNode usage statistics will be printed when the program ends or not.

static void RTOpPack::Teuchos::RCPNodeTracer::printActiveRCPNodes ( std::ostream &  out) [static]

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!

static void RTOpPack::Teuchos::RCPNodeTracer::addNewRCPNode ( RCPNode rcp_node,
const std::string &  info 
) [static]

Add new RCPNode to the global list.

Only gets called when RCPNode tracing has been activated.

static void RTOpPack::Teuchos::RCPNodeTracer::removeRCPNode ( RCPNode rcp_node) [static]

Remove an RCPNode from global list.

Always gets called in a debug build (TEUCHOS_DEBUG defined) when node tracing is enabled.

template<class T >
static const void* RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeBaseObjMapKeyVoidPtr ( T *  p) [inline, static]

Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.

This only returns the base address reliabily for all types if HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR is defined.

Returns:
0 if p == 0.

Definition at line 426 of file RTOpPack_SPMD_apply_op_def.hpp.

static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNodeGivenLookupKey ( const void *  lookupKey) [static]

Return a raw pointer to an existing owning RCPNode given its lookup key.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.
template<class T >
static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNode ( T *  p) [inline, static]

Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.

Definition at line 456 of file RTOpPack_SPMD_apply_op_def.hpp.

static std::string RTOpPack::Teuchos::RCPNodeTracer::getActiveRCPNodeHeaderString ( ) [static]

Header string used in printActiveRCPNodes().

static std::string RTOpPack::Teuchos::RCPNodeTracer::getCommonDebugNotesString ( ) [static]

Common error message string on how to debug RCPNode problems.

static bool RTOpPack::Teuchos::RCPNodeTracer::isTracingActiveRCPNodes ( ) [static]

Return if we are tracing active nodes or not.

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

static int RTOpPack::Teuchos::RCPNodeTracer::numActiveRCPNodes ( ) [static]

Print the number of active RCPNode objects currently being tracked.

static RCPNodeStatistics RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeStatistics ( ) [static]

Return the statistics on RCPNode allocations.

static void RTOpPack::Teuchos::RCPNodeTracer::printRCPNodeStatistics ( const RCPNodeStatistics rcpNodeStatistics,
std::ostream &  out 
) [static]

Print the RCPNode allocation statistics.

static void RTOpPack::Teuchos::RCPNodeTracer::setPrintRCPNodeStatisticsOnExit ( bool  printRCPNodeStatisticsOnExit) [static]

Set if RCPNode usage statistics will be printed when the program ends or not.

static bool RTOpPack::Teuchos::RCPNodeTracer::getPrintRCPNodeStatisticsOnExit ( ) [static]

Reteurn if RCPNode usage statistics will be printed when the program ends or not.

static void RTOpPack::Teuchos::RCPNodeTracer::printActiveRCPNodes ( std::ostream &  out) [static]

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!

static void RTOpPack::Teuchos::RCPNodeTracer::addNewRCPNode ( RCPNode rcp_node,
const std::string &  info 
) [static]

Add new RCPNode to the global list.

Only gets called when RCPNode tracing has been activated.

static void RTOpPack::Teuchos::RCPNodeTracer::removeRCPNode ( RCPNode rcp_node) [static]

Remove an RCPNode from global list.

Always gets called in a debug build (TEUCHOS_DEBUG defined) when node tracing is enabled.

template<class T >
static const void* RTOpPack::Teuchos::RCPNodeTracer::getRCPNodeBaseObjMapKeyVoidPtr ( T *  p) [inline, static]

Get a const void* address to be used as the lookup key for an RCPNode given its embedded object's typed pointer.

This only returns the base address reliabily for all types if HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR is defined.

Returns:
0 if p == 0.

Definition at line 426 of file RTOpPack_SPMD_apply_op_def.hpp.

static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNodeGivenLookupKey ( const void *  lookupKey) [static]

Return a raw pointer to an existing owning RCPNode given its lookup key.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.
template<class T >
static RCPNode* RTOpPack::Teuchos::RCPNodeTracer::getExistingRCPNode ( T *  p) [inline, static]

Return a raw pointer to an existing owning RCPNode given the address to the underlying object if it exits.

Returns:
returnVal != 0 if an owning RCPNode exists, 0 otherwsise.

Definition at line 456 of file RTOpPack_SPMD_apply_op_def.hpp.

static std::string RTOpPack::Teuchos::RCPNodeTracer::getActiveRCPNodeHeaderString ( ) [static]

Header string used in printActiveRCPNodes().

static std::string RTOpPack::Teuchos::RCPNodeTracer::getCommonDebugNotesString ( ) [static]

Common error message string on how to debug RCPNode problems.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends