AbstractHeapAnalyzer Class Reference

#include <coherence/lang/AbstractHeapAnalyzer.hpp>

Inherits Object, and HeapAnalyzer.

Inherited by ClassBasedHeapAnalyzer.

List of all members.


Detailed Description

AbstractHeapAnalyzer provides a starting point for writting custom heap analyzers.

Most notibly it includes support for detecting analyzer reentrance so that analyzers can avoid endlessly recursing if they create objects as part of the registration process.

Author:
mf 2008.04.27

Public Types

typedef spec::Handle Handle
 AbstractHeapAnalyzer Handle definition.
typedef spec::View View
 AbstractHeapAnalyzer View definition.
typedef spec::Holder Holder
 AbstractHeapAnalyzer Holder definition.

Public Member Functions

virtual void toStream (std::ostream &out) const
 Capture a snapshot and output it to the supplied stream.

Protected Member Functions

virtual void safeRegisterObject (const Object &o)=0
 Registers an object with the heap analyzer.
virtual void safeUnregisterObject (const Object &o)=0
 Unregisters an object with the heap analyzer.
virtual void registerObject (const Object &o)
 Register a newly created Object with the system.

This method is called automatically by coherence::lang::Object once the Object has finished construction.

Parameters:
o the newly created Object.

virtual void unregisterObject (const Object &o)
 Unregister an Object with the system.

This method is called automatically by coherence::lang::Object just prior to the deletion of the Object. No new handles or views may be created to the object.

Parameters:
o the Object to unregister


Member Function Documentation

virtual void safeRegisterObject ( const Object o  )  [protected, pure virtual]

Registers an object with the heap analyzer.

Parameters:
o the object to register

Implemented in ClassBasedHeapAnalyzer.

virtual void safeUnregisterObject ( const Object o  )  [protected, pure virtual]

Unregisters an object with the heap analyzer.

Parameters:
o the object to unregister

Implemented in ClassBasedHeapAnalyzer.

virtual void registerObject ( const Object o  )  [protected, virtual]

Register a newly created Object with the system.

This method is called automatically by coherence::lang::Object once the Object has finished construction.

Parameters:
o the newly created Object.

If the calling thread is reentering this method return immediatley otherwise delegates to safeRegisterObject.

Implements HeapAnalyzer.

Reimplemented in ClassBasedHeapAnalyzer.

virtual void unregisterObject ( const Object o  )  [protected, virtual]

Unregister an Object with the system.

This method is called automatically by coherence::lang::Object just prior to the deletion of the Object. No new handles or views may be created to the object.

Parameters:
o the Object to unregister

If the calling thread is reentering this method return immediatley otherwise delegates to safeUnregisterObject.

Implements HeapAnalyzer.

Reimplemented in ClassBasedHeapAnalyzer.

virtual void toStream ( std::ostream &  out  )  const [virtual]

Capture a snapshot and output it to the supplied stream.

Parameters:
out the stream to output to

Reimplemented from Object.


The documentation for this class was generated from the following file: Copyright (c) 2000-2008 Oracle. All rights reserved.