00001 #ifndef _GEMFIRE_CACHEABLEFILENAME_HPP_ 00002 #define _GEMFIRE_CACHEABLEFILENAME_HPP_ 00003 00004 /*========================================================================= 00005 * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. 00006 * This product is protected by U.S. and international copyright 00007 * and intellectual property laws. Pivotal products are covered by 00008 * more patents listed at http://www.pivotal.io/patents. 00009 *========================================================================= 00010 */ 00011 00012 #include "gfcpp_globals.hpp" 00013 #include "gf_types.hpp" 00014 #include "CacheableKey.hpp" 00015 #include "CacheableString.hpp" 00016 00020 namespace gemfire 00021 { 00026 class CPPCACHE_EXPORT CacheableFileName: public CacheableString 00027 { 00028 public: 00029 00033 virtual void toData(DataOutput& output) const; 00034 00040 virtual Serializable* fromData(DataInput& input); 00041 00047 virtual int32_t classId() const; 00048 00054 virtual int8_t typeId() const; 00055 00059 static Serializable* createDeserializable() 00060 { 00061 return new CacheableFileName(); 00062 } 00063 00068 static CacheableFileNamePtr create(const char* value, int32_t len = 0) 00069 { 00070 CacheableFileNamePtr str = NULLPTR; 00071 if (value != NULL) { 00072 str = new CacheableFileName(); 00073 str->initString(value, len); 00074 } 00075 return str; 00076 } 00077 00082 static CacheableFileNamePtr create(const wchar_t* value, int32_t len = 0) 00083 { 00084 CacheableFileNamePtr str = NULLPTR; 00085 if (value != NULL) { 00086 str = new CacheableFileName(); 00087 str->initString(value, len); 00088 } 00089 return str; 00090 } 00091 00093 virtual const char* className() const 00094 { 00095 return "CacheableFileName"; 00096 } 00097 00099 virtual uint32_t hashcode() const; 00100 00101 protected: 00102 00104 inline CacheableFileName() : 00105 CacheableString(),m_hashcode(0) 00106 { 00107 } 00108 00109 private: 00110 // never implemented. 00111 void operator =(const CacheableFileName& other); 00112 CacheableFileName(const CacheableFileName& other); 00113 00114 private: 00115 mutable int m_hashcode; 00116 }; 00117 00118 } 00119 00120 #endif