00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __UT_RefCount_h__
00021 #define __UT_RefCount_h__
00022
00023 #include "UT_API.h"
00024
00025 class UT_API UT_RefCount {
00026 public:
00027 explicit UT_RefCount(int ref = 1) { myRefCount = ref; }
00028
00029 void bumpRef() { myRefCount++; }
00030 void downRef() { myRefCount--; if (!myRefCount) delete this; }
00031
00032 protected:
00033 virtual ~UT_RefCount();
00034
00035 private:
00036 int myRefCount;
00037 };
00038
00039 #endif