Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/express/memoryUsagePointerCounts.h

Go to the documentation of this file.
00001 // Filename: memoryUsagePointerCounts.h
00002 // Created by:  drose (04Jun01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef MEMORYUSAGEPOINTERCOUNTS_H
00020 #define MEMORYUSAGEPOINTERCOUNTS_H
00021 
00022 #include "pandabase.h"
00023 
00024 #ifdef DO_MEMORY_USAGE
00025 
00026 class MemoryInfo;
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : MemoryUsagePointerCounts
00030 // Description : This is a supporting class for MemoryUsage.  It
00031 //               tracks the relative counts of a number of pointers of
00032 //               some type (or age), for use by TypeHistogram and
00033 //               AgeHistogram.  It's not exported from the DLL, and it
00034 //               doesn't even exist if we're compiling NDEBUG.
00035 ////////////////////////////////////////////////////////////////////
00036 class MemoryUsagePointerCounts {
00037 public:
00038   INLINE MemoryUsagePointerCounts();
00039   INLINE MemoryUsagePointerCounts(const MemoryUsagePointerCounts &copy);
00040   INLINE void operator = (const MemoryUsagePointerCounts &copy);
00041 
00042   INLINE void clear();
00043   void add_info(MemoryInfo &info);
00044   void output(ostream &out) const;
00045 
00046   INLINE bool is_size_unknown() const;
00047   INLINE size_t get_size() const;
00048   INLINE int get_count() const;
00049 
00050   INLINE bool operator < (const MemoryUsagePointerCounts &other) const;
00051 
00052 private:
00053   static void output_bytes(ostream &out, size_t size);
00054 
00055 private:
00056   int _count;
00057   int _unknown_size_count;
00058   size_t _size;
00059 };
00060 
00061 INLINE ostream &operator << (ostream &out, const MemoryUsagePointerCounts &c);
00062 
00063 #include "memoryUsagePointerCounts.I"
00064 
00065 #endif  // DO_MEMORY_USAGE
00066 
00067 #endif
00068 

Generated on Fri May 2 00:38:25 2003 for Panda by doxygen1.3