00001 #ifndef _GEMFIRE_CACHEABLEFILENAME_HPP_ 00002 #define _GEMFIRE_CACHEABLEFILENAME_HPP_ 00003 00004 /*========================================================================= 00005 * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved. 00006 * 1260 NW Waterhouse Ave., Suite 200, Beaverton, OR 97006 00007 *========================================================================= 00008 */ 00009 00010 #include "gfcpp_globals.hpp" 00011 #include "gf_types.hpp" 00012 #include "CacheableKey.hpp" 00013 #include "CacheableString.hpp" 00014 00018 namespace gemfire 00019 { 00024 class CPPCACHE_EXPORT CacheableFileName: public CacheableString 00025 { 00026 public: 00027 00031 virtual void toData(DataOutput& output) const; 00032 00038 virtual Serializable* fromData(DataInput& input); 00039 00045 virtual int32_t classId() const; 00046 00052 virtual int8_t typeId() const; 00053 00057 static Serializable* createDeserializable() 00058 { 00059 return new CacheableFileName(); 00060 } 00061 00066 static CacheableFileNamePtr create(const char* value, int32_t len = 0) 00067 { 00068 CacheableFileNamePtr str = NULLPTR; 00069 if (value != NULL) { 00070 str = new CacheableFileName(); 00071 str->initString(value, len); 00072 } 00073 return str; 00074 } 00075 00080 static CacheableFileNamePtr create(const wchar_t* value, int32_t len = 0) 00081 { 00082 CacheableFileNamePtr str = NULLPTR; 00083 if (value != NULL) { 00084 str = new CacheableFileName(); 00085 str->initString(value, len); 00086 } 00087 return str; 00088 } 00089 00091 virtual const char* className() const 00092 { 00093 return "CacheableFileName"; 00094 } 00095 00097 virtual uint32_t hashcode() const; 00098 00099 protected: 00100 00102 inline CacheableFileName() : 00103 CacheableString(),m_hashcode(0) 00104 { 00105 } 00106 00107 private: 00108 // never implemented. 00109 void operator =(const CacheableFileName& other); 00110 CacheableFileName(const CacheableFileName& other); 00111 00112 private: 00113 mutable int m_hashcode; 00114 }; 00115 00116 } 00117 00118 #endif