VMware GemFire Native C++ Reference  9.1
CacheableFileName.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_CACHEABLEFILENAME_H_
4 #define GEODE_CACHEABLEFILENAME_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include "geode_globals.hpp"
24 #include "geode_types.hpp"
25 #include "CacheableKey.hpp"
26 #include "CacheableString.hpp"
27 
31 namespace apache {
32 namespace geode {
33 namespace client {
39  public:
43  virtual void toData(DataOutput& output) const;
44 
50  virtual Serializable* fromData(DataInput& input);
51 
57  virtual int32_t classId() const;
58 
64  virtual int8_t typeId() const;
65 
70  return new CacheableFileName();
71  }
72 
77  static CacheableFileNamePtr create(const char* value, int32_t len = 0) {
78  CacheableFileNamePtr str = NULLPTR;
79  if (value != NULL) {
80  str = new CacheableFileName();
81  str->initString(value, len);
82  }
83  return str;
84  }
85 
90  static CacheableFileNamePtr create(const wchar_t* value, int32_t len = 0) {
91  CacheableFileNamePtr str = NULLPTR;
92  if (value != NULL) {
93  str = new CacheableFileName();
94  str->initString(value, len);
95  }
96  return str;
97  }
98 
100  virtual const char* className() const { return "CacheableFileName"; }
101 
103  virtual int32_t hashcode() const;
104 
105  protected:
107  inline CacheableFileName() : CacheableString(), m_hashcode(0) {}
108 
109  private:
110  // never implemented.
111  void operator=(const CacheableFileName& other);
112  CacheableFileName(const CacheableFileName& other);
113 
114  private:
115  mutable int m_hashcode;
116 };
117 } // namespace client
118 } // namespace geode
119 } // namespace apache
120 
121 #endif // GEODE_CACHEABLEFILENAME_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
virtual const char * className() const
get the name of the class of this object for logging purpose
Definition: CacheableFileName.hpp:100
CacheableFileName()
Default constructor.
Definition: CacheableFileName.hpp:107
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
Implement an immutable wrapper for filenames that can serve as a distributable filename object for ca...
Definition: CacheableFileName.hpp:38
static CacheableFileNamePtr create(const wchar_t *value, int32_t len=0)
Factory method for creating an instance of CacheableFileName from a wide-character C string optionall...
Definition: CacheableFileName.hpp:90
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:74
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:52
Implement a immutable C string wrapper that can serve as a distributable key object for caching as we...
Definition: CacheableString.hpp:45
static CacheableFileNamePtr create(const char *value, int32_t len=0)
Factory method for creating an instance of CacheableFileName from a C string optionally given the len...
Definition: CacheableFileName.hpp:77
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:56
static Serializable * createDeserializable()
creation function for filenames.
Definition: CacheableFileName.hpp:69
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation