MaxHeap.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: MaxHeap.h
00004 
00005     DESCRIPTION:  A base class to control memory management for all 
00006                 for all Max classes
00007 
00008     CREATED BY: Justin  Yong
00009 
00010     HISTORY: created 11/29/05
00011 
00012  *> Copyright (c) 2005, All Rights Reserved.
00013  **********************************************************************/
00014 
00015 #pragma once
00016 
00017 #include <new>
00018 
00019 #include "utilexp.h"
00020 
00021 // Undefine possible new and delete macros, so they won't break our operators declarations. For instance, a debug
00022 // macro for new could look like this: "#define new _debug_new(__FILE__, __LINE__)". In the MaxHeapOperators class,
00023 // we would obtain something like this: "UtilExport static void* _new_debug_new(__FILE, __LINE__)( size_t size );",
00024 // and it wouldn't compile.
00025 #undef new
00026 #undef delete
00027 
00029 
00040 class MaxHeapOperators
00041 {
00042 public:
00043 
00049     UtilExport static void* operator new( size_t size ); 
00050 
00057     UtilExport static void* operator new( size_t size, const std::nothrow_t & e );
00058 
00066     UtilExport static void* operator new( size_t size, const char* filename, int line );
00067 
00076     UtilExport static void* operator new( size_t size, const std::nothrow_t & e, const char * filename, int line );
00077 
00084     UtilExport static void* operator new( size_t size, unsigned long flags );
00085 
00093     UtilExport static void* operator new( size_t size, const std::nothrow_t & e, unsigned long flags );
00094 
00100     UtilExport static void* operator new[]( size_t size );
00101 
00108     UtilExport static void* operator new[]( size_t size, const std::nothrow_t & e );
00109 
00117     UtilExport static void* operator new[]( size_t size, const char* filename, int line );
00118 
00127     UtilExport static void* operator new[]( size_t size, const std::nothrow_t & e, const char * filename, int line );
00128 
00135     UtilExport static void* operator new[]( size_t size, unsigned long flags );
00136 
00144     UtilExport static void* operator new[]( size_t size, const std::nothrow_t & e, unsigned long flags );
00145 
00146 
00152     UtilExport static void operator delete( void * ptr );
00153 
00160     UtilExport static void operator delete( void * ptr, const std::nothrow_t& e );
00161     
00169     UtilExport static void operator delete( void * ptr, const char * filename, int line );
00170     
00179     UtilExport static void operator delete( void * ptr, const std::nothrow_t & e, const char * filename, int line );
00180     
00187     UtilExport static void operator delete( void * ptr, unsigned long flags );
00188     
00196     UtilExport static void operator delete( void * ptr, const std::nothrow_t & e, unsigned long flags );
00197 
00203     UtilExport static void operator delete[]( void * ptr );
00204 
00211     UtilExport static void operator delete[]( void * ptr, const std::nothrow_t& e );
00212     
00220     UtilExport static void operator delete[]( void * ptr, const char * filename, int line );
00221     
00230     UtilExport static void operator delete[]( void * ptr, const std::nothrow_t& e, const char * filename, int line );
00231     
00238     UtilExport static void operator delete[]( void * ptr, unsigned long flags );
00239     
00247     UtilExport static void operator delete[]( void * ptr, const std::nothrow_t&e, unsigned long flags );
00248     
00255     UtilExport static void* operator new( size_t size, void * placement_ptr );
00256     
00262     UtilExport static void  operator delete( void * ptr, void * placement_ptr );
00263 
00264 };
00265