00001 /* Resource.h 00002 * 00003 * Copyright 1992 by Algorithmic Arts, Inc. 00004 * All Rights Reserved. Use, disclosure or reproduction of this software 00005 * is prohibited without prior express written consent of Algorithmic Arts. 00006 * 00007 * $XRevision: 1.1.1.1 $ 00008 * 00009 */ 00010 00011 #ifndef TESSERA_RESOURCE_H 00012 #define TESSERA_RESOURCE_H 00013 00014 #include "TS_API.h" 00015 // Base class for reference counted objects. 00016 class TS_API TS_Resource { 00017 public: 00018 TS_Resource() : count(0) { } 00019 virtual ~TS_Resource(); 00020 void ref() { count++; } 00021 void unref() { count--; if (!count) delete this; } 00022 int refCount() const { return count; } 00023 private: 00024 int count; 00025 }; 00026 00027 #endif // TESSERA_RESOURCE_H
1.5.9