00001 /* 00002 * Copyright (C) 2006-2011, SRI International (R) 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU Lesser General Public License as published by 00006 * the Free Software Foundation, either version 3 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 Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #pragma once 00019 00020 #ifndef __OpenKarto_Referenced_h__ 00021 #define __OpenKarto_Referenced_h__ 00022 00023 #include <OpenKarto/Macros.h> 00024 #include <OpenKarto/Types.h> 00025 00026 namespace karto 00027 { 00028 00030 00031 00035 00036 struct ReferencedPrivate; 00037 00042 class KARTO_EXPORT Referenced 00043 { 00044 public: 00048 Referenced(); 00049 00050 protected: 00051 //@cond EXCLUDE 00055 virtual ~Referenced(); 00056 //@endcond 00057 00058 public: 00063 kt_int32s Reference() const; 00064 00069 kt_int32s Unreference() const; 00070 00077 kt_int32s UnreferenceNoDelete() const; 00078 00083 kt_int32s GetReferenceCount(); 00084 00085 private: 00086 // restrict the following functions 00087 Referenced(const Referenced&); 00088 const Referenced& operator=(const Referenced&); 00089 00090 private: 00091 ReferencedPrivate* m_pReferencedPrivate; 00092 }; // Referenced 00093 00095 } 00096 00097 #endif // __OpenKarto_Referenced_h__