00001 00006 #ifndef LIGHTSTRING_H_ 00007 #define LIGHTSTRING_H_ 00008 00012 #define SYNCHRONIZE_LIGHT_STRING 0 00013 00019 class LightString { 00020 00021 public: 00022 00026 char * memoryPointer; 00027 00031 int * refCount; 00032 00036 unsigned size; 00037 00038 #if SYNCHRONIZE_LIGHT_STRING 00039 pthread_mutex_t * mutex; 00040 #endif 00041 00045 LightString(char *memoryPointer, unsigned size); 00046 00050 LightString(const LightString & ls); 00051 00055 const LightString& operator=(const LightString&); 00056 00060 virtual ~LightString(); 00061 00062 }; 00063 00067 bool operator==(const LightString& ls1, const LightString& ls2); 00068 00069 #endif /* LIGHTSTRING_H_ */