GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

trackable.hh

Go to the documentation of this file.
00001 /* GFC-Core: GTK+ Foundation Classes (Core Library) 00002 * Copyright (C) 2003-2004 The GFC 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 00025 00026 #ifndef GFC_TRACKABLE_HH 00027 #define GFC_TRACKABLE_HH 00028 00029 #ifndef SIGCXX_SIGCXX_H 00030 #include <sigc++/sigc++.h> 00031 #endif 00032 00033 #ifndef GFC_POINTER_HH 00034 #include <gfc/pointer.hh> 00035 #endif 00036 00037 #ifndef GFC_UTF_STRING_HH 00038 #include <gfc/utfstring.hh> 00039 #endif 00040 00041 namespace GFC { 00042 00085 00086 class Trackable : public sigc::trackable 00087 { 00088 template<typename T> friend class Pointer; 00089 00090 Trackable(const Trackable&); 00091 Trackable& operator=(const Trackable&); 00092 00093 class AllocationList : public std::list<void*> 00094 { 00095 public: 00096 AllocationList(); 00097 ~AllocationList(); 00098 }; 00099 00100 static AllocationList allocation_list_; 00101 static std::new_handler current_handler_; 00102 00103 bool owns_reference_; 00104 00105 protected: 00108 00109 Trackable(); 00111 00112 virtual ~Trackable() = 0; 00114 00118 00119 void set_owns_reference(bool setting) { owns_reference_ = setting; } 00129 00131 00132 public: 00135 00136 bool is_dynamic() const; 00139 00140 bool owns_reference() const { return owns_reference_; } 00146 00150 00151 virtual void ref(); 00153 00154 virtual void unref(); 00162 00164 00165 static std::new_handler set_new_handler(std::new_handler handler); 00168 00169 static void* operator new(size_t size); 00173 00174 static void operator delete(void *ptr); 00178 00179 }; 00180 00181 } // namespace GFC 00182 00183 #endif // GFC_TRACKABLE_HH 00184

Generated on Tue Aug 24 00:04:56 2004 for GFC-Core by doxygen 1.3.8