Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.3.0)

E80355-01

ClassBasedHeapAnalyzer::ClassStats Class Reference

#include <coherence/lang/ClassBasedHeapAnalyzer.hpp>

Inherits Object, and Comparable.

List of all members.


Detailed Description

Statistics relating to a class.

Public Types

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

Public Member Functions

virtual int64_t getObjectCount () const
 Return the instance count for the class.
virtual int64_t getByteCount () const
 Return the byte count for the class.
virtual int64_t getAllocationCount () const
 Return the allocation count for the class.
int32_t compareTo (Object::View v) const
 Compare this object with the specified object for order.

Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

It is strongly recommended, but not strictly required, that (x->compareTo(y) == 0) == (x->equals(y)).

Parameters:
v the Object to be compared
Returns:
a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object
Exceptions:
ClassCastException if the specified Object's type prevents it from being compared to this Object

virtual TypedHandle
< const String
toString () const
 Output a human-readable description of this Object to the given stream.

Note that when overriding this method the return type must be TypedHandle<const String> rather then String::View. These two types are assignment compatible but not equivalent and declaring the override with String::View will not be a compatible override.

coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toString method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents and is generally how toString() will be implemented.

 Object::View vKey   = ...
 Object::View vValue = ...
 std::cout << vKey << " = " << vValue << std::endl;

 String::View vs = COH_TO_STRING(vKey << " = " << vValue);

The COH_TO_STRING macro is also the most common way to implement the toString method. For example:

 virtual TypedHandle<const String> Person::toString() const
     {
     return COH_TO_STRING("Name: " << f_sName << " SSN: " << f_nSSN);
     }

Returns:
a string representation of this object


Protected Member Functions

 ClassStats (int64_t cObjs, int64_t cBytes, int64_t cAlloc)
 Create a new ClassStats.

Protected Attributes

int64_t m_cInstanceCount
 The number of instances of the class.
int64_t m_cByteCount
 The byte size of all the instances.
int64_t m_cAllocationCount
 The total number of allocations of the class.

Constructor & Destructor Documentation

ClassStats ( int64_t  cObjs,
int64_t  cBytes,
int64_t  cAlloc 
) [protected]

Create a new ClassStats.

Parameters:
cObjs the instance count
cBytes the byte count
cAlloc the allocation count
Returns:
the new ClassStats


The documentation for this class was generated from the following file:
Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.