VMware GemFire Native C++ Reference  9.1
CacheableKey.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_CACHEABLEKEY_H_
4 #define GEODE_CACHEABLEKEY_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 "Cacheable.hpp"
26 
31 namespace apache {
32 namespace geode {
33 namespace client {
34 
37  protected:
40 
42  virtual ~CacheableKey() {}
43 
44  public:
46  virtual bool operator==(const CacheableKey& other) const = 0;
47 
49  virtual int32_t hashcode() const = 0;
50 
59  virtual int32_t logString(char* buffer, int32_t maxLength) const;
60 
69  template <class PRIM>
70  inline static CacheableKeyPtr create(const PRIM value);
71 
72  private:
73  // Never defined.
74  CacheableKey(const CacheableKey& other);
75  void operator=(const CacheableKey& other);
76 };
77 
78 template <class TKEY>
79 inline CacheableKeyPtr createKey(const SharedPtr<TKEY>& value);
80 
81 template <typename TKEY>
82 inline CacheableKeyPtr createKey(const TKEY* value);
83 } // namespace client
84 } // namespace geode
85 } // namespace apache
86 
87 #endif // GEODE_CACHEABLEKEY_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
virtual ~CacheableKey()
Destructor.
Definition: CacheableKey.hpp:42
CacheableKey()
Constructor.
Definition: CacheableKey.hpp:39
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
Represents a cacheable key.
Definition: CacheableKey.hpp:36
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation