Main Page - Header
Author: The Inti Development Team

Reference Manual

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

# memoryhandler.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00024
    00025 #ifndef INTI_MEMORY_HANDLER_H
    00026 #define INTI_MEMORY_HANDLER_H
    00027
    00028 #ifndef _CPP_LIST
    00029 #include <list>
    00030 #endif
    00031
    00032 namespace Inti {
    00033
    00074
    00075 class MemoryHandler
    00076 {
    00077         MemoryHandler(const MemoryHandler&);
    00078         MemoryHandler& operator=(const MemoryHandler&);
    00079
    00080         class AllocationList : public std::list<void*>
    00081         {
    00082         public:
    00083                 AllocationList();
    00084                 ~AllocationList();
    00085         };
    00086
    00087         static AllocationList allocation_list;
    00088         static std::new_handler current_handler;
    00089
    00090 protected:
    00091         MemoryHandler();
    00093
    00094         virtual ~MemoryHandler() = 0;
    00096
    00097 public:
    00098         bool is_dynamic() const;
    00100
    00101         static std::new_handler set_new_handler(std::new_handler handler);
    00103
    00104         static void* operator new(size_t size);
    00108
    00109         static void operator delete(void *ptr);
    00113 };
    00114
    00115 } // namespace Inti
    00116
    00117 #endif // INTI_MEMORY_HANDLER_H
    00118

Main Page - Footer