Back to index

plt-scheme  4.2.1
Object.cc
Go to the documentation of this file.
00001 /*                                                      -*- C++ -*-
00002  *
00003  * Purpose: Top level object and memory debugging for wxWindows
00004  *
00005  * Authors: Markus Holzem, Julian Smart and Arthur Seaton
00006  *
00007  * Copyright: (C) 2004-2009 PLT Scheme Inc.
00008  * Copyright: (C) 1995, AIAI, University of Edinburgh (Julian, Arthur)
00009  * Copyright: (C) 1995, GNU (Markus)
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00024  * 02110-1301 USA.
00025  */
00026 
00027 #ifdef __GNUG__
00028 #pragma implementation "Object.h"
00029 #endif
00030 
00031 #define Uses_wxDebugStreamBuf
00032 #define Uses_wxObject
00033 #define Uses_wxHashTable
00034 #define Uses_wxTypeTree
00035 #include "wx.h"
00036 
00037 #include <stdarg.h>
00038 #include <stdio.h>
00039 #include <string.h>
00040 
00041 //-----------------------------------------------------------------------------
00042 // wxObject: top level object
00043 //-----------------------------------------------------------------------------
00044 
00045 int wx_object_count;
00046 
00047 wxObject::wxObject(void)
00048 {
00049   __type = wxTYPE_ANY;
00050 
00051   wx_object_count++;
00052 }
00053 
00054 wxObject::wxObject(Bool cleanup) : gc_cleanup((int)cleanup)
00055 {
00056   __type = wxTYPE_ANY;
00057 
00058   wx_object_count++;
00059 }
00060 
00061 wxObject::~wxObject(void)
00062 {
00063   if (__type < 0) {
00064     printf("bad!\n");
00065   }
00066 
00067   --wx_object_count;
00068   __type = -1;
00069 }
00070 
00071 #ifdef MEMORY_USE_METHOD
00072 long wxObject::MemoryUse(void)
00073 {
00074   return 0;
00075 }
00076 #endif
00077 
00078 #ifdef COMPACT_BACKTRACE_GC
00079 char *wxObject::gcGetName()
00080 {
00081   return wxGetTypeName(__type);
00082 }
00083 #endif