00001 // ///////////////////////////////////////////////////////////////////////////// 00002 // 00003 // Name: ReferenceCounted.h 00004 // Author: Michael Bartsch (ZCCdark203) 00005 // 00006 // Desc : Declaration of the ReferenceCounted class. 00007 // 00008 // License: Copyright (C) 2009 Michael Bartsch and Contributors 00009 // 00010 // This program is free software: you can redistribute it 00011 // and/or modify it under the terms of the zlib/libpng License. 00012 // See main.cpp for conditions of distribution and use. 00013 // 00014 // ///////////////////////////////////////////////////////////////////////////// 00015 00016 #ifndef __REFERENCECOUNTED_H__ 00017 #define __REFERENCECOUNTED_H__ 00018 00019 // Include files 00020 #include "../dependencies.h" 00021 00022 00023 // ReferenceCounted class 00036 class ReferenceCounted 00037 { 00038 public: 00039 00040 // Initialisation and deinitialisation 00042 ReferenceCounted(); 00044 virtual ~ReferenceCounted(); 00045 00046 // Public methods 00048 virtual void grab(); 00050 virtual void drop(); 00051 00053 s32 getReferenceCount(); 00054 00055 private: 00056 00057 // Private members 00058 s32 mRefCount; 00059 }; 00060 00061 #endif