VMware Tanzu GemFire Native C++ Reference 10.2.7
CacheableBuiltins.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#ifndef GEODE_CACHEABLEBUILTINS_H_
21#define GEODE_CACHEABLEBUILTINS_H_
22
28#include <cstring>
29
30#include "CacheableKey.hpp"
31#include "CacheableString.hpp"
32#include "Serializable.hpp"
33#include "Serializer.hpp"
34#include "internal/CacheableBuiltinTemplates.hpp"
35#include "internal/CacheableKeys.hpp"
36
37namespace apache {
38namespace geode {
39namespace client {
40
46 internal::CacheableKeyPrimitive<bool, internal::DSCode::CacheableBoolean>;
47extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
48 internal::CacheableKeyPrimitive<bool, internal::DSCode::CacheableBoolean>;
49template <>
50inline std::shared_ptr<CacheableKey> CacheableKey::create(bool value) {
51 return CacheableBoolean::create(value);
52}
53template <>
54inline std::shared_ptr<Cacheable> Serializable::create(bool value) {
55 return CacheableBoolean::create(value);
56}
57
63 internal::CacheableKeyPrimitive<int8_t, internal::DSCode::CacheableByte>;
64extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
65 internal::CacheableKeyPrimitive<int8_t, internal::DSCode::CacheableByte>;
66template <>
67inline std::shared_ptr<CacheableKey> CacheableKey::create(int8_t value) {
68 return CacheableByte::create(value);
69}
70template <>
71inline std::shared_ptr<Cacheable> Serializable::create(int8_t value) {
72 return CacheableByte::create(value);
73}
74
80 internal::CacheableKeyPrimitive<double, internal::DSCode::CacheableDouble>;
81extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
82 internal::CacheableKeyPrimitive<double, internal::DSCode::CacheableDouble>;
83template <>
84inline std::shared_ptr<CacheableKey> CacheableKey::create(double value) {
85 return CacheableDouble::create(value);
86}
87template <>
88inline std::shared_ptr<Cacheable> Serializable::create(double value) {
89 return CacheableDouble::create(value);
90}
91
98 internal::CacheableKeyPrimitive<float, internal::DSCode::CacheableFloat>;
99extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
100 internal::CacheableKeyPrimitive<float, internal::DSCode::CacheableFloat>;
101template <>
102inline std::shared_ptr<CacheableKey> CacheableKey::create(float value) {
103 return CacheableFloat::create(value);
104}
105template <>
106inline std::shared_ptr<Cacheable> Serializable::create(float value) {
107 return CacheableFloat::create(value);
108}
109
115 internal::CacheableKeyPrimitive<int16_t, internal::DSCode::CacheableInt16>;
116extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
117 internal::CacheableKeyPrimitive<int16_t, internal::DSCode::CacheableInt16>;
118template <>
119inline std::shared_ptr<CacheableKey> CacheableKey::create(int16_t value) {
120 return CacheableInt16::create(value);
121}
122template <>
123inline std::shared_ptr<Cacheable> Serializable::create(int16_t value) {
124 return CacheableInt16::create(value);
125}
126
132 internal::CacheableKeyPrimitive<int32_t, internal::DSCode::CacheableInt32>;
133extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
134 internal::CacheableKeyPrimitive<int32_t, internal::DSCode::CacheableInt32>;
135template <>
136inline std::shared_ptr<CacheableKey> CacheableKey::create(int32_t value) {
137 return CacheableInt32::create(value);
138}
139template <>
140inline std::shared_ptr<Cacheable> Serializable::create(int32_t value) {
141 return CacheableInt32::create(value);
142}
143
149 internal::CacheableKeyPrimitive<int64_t, internal::DSCode::CacheableInt64>;
150extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
151 internal::CacheableKeyPrimitive<int64_t, internal::DSCode::CacheableInt64>;
152template <>
153inline std::shared_ptr<CacheableKey> CacheableKey::create(int64_t value) {
154 return CacheableInt64::create(value);
155}
156template <>
157inline std::shared_ptr<Cacheable> Serializable::create(int64_t value) {
158 return CacheableInt64::create(value);
159}
160
166 internal::CacheableKeyPrimitive<char16_t,
167 internal::DSCode::CacheableCharacter>;
168extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
169 internal::CacheableKeyPrimitive<char16_t,
170 internal::DSCode::CacheableCharacter>;
171template <>
172inline std::shared_ptr<CacheableKey> CacheableKey::create(char16_t value) {
173 return CacheableCharacter::create(value);
174}
175template <>
176inline std::shared_ptr<Cacheable> Serializable::create(char16_t value) {
177 return CacheableCharacter::create(value);
178}
179
185 internal::CacheableArrayPrimitive<int8_t, internal::DSCode::CacheableBytes>;
186extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
187 internal::CacheableArrayPrimitive<int8_t, internal::DSCode::CacheableBytes>;
188
193using BooleanArray =
194 internal::CacheableArrayPrimitive<bool, internal::DSCode::BooleanArray>;
195extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
196 internal::CacheableArrayPrimitive<bool, internal::DSCode::BooleanArray>;
197
202using CharArray =
203 internal::CacheableArrayPrimitive<char16_t, internal::DSCode::CharArray>;
204extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
205 internal::CacheableArrayPrimitive<char16_t, internal::DSCode::CharArray>;
206
212 internal::CacheableArrayPrimitive<double,
213 internal::DSCode::CacheableDoubleArray>;
214extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
215 internal::CacheableArrayPrimitive<double,
216 internal::DSCode::CacheableDoubleArray>;
217
223 internal::CacheableArrayPrimitive<float,
224 internal::DSCode::CacheableFloatArray>;
225extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
226 internal::CacheableArrayPrimitive<float,
227 internal::DSCode::CacheableFloatArray>;
228
234 internal::CacheableArrayPrimitive<int16_t,
235 internal::DSCode::CacheableInt16Array>;
236extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
237 internal::CacheableArrayPrimitive<int16_t,
238 internal::DSCode::CacheableInt16Array>;
239
245 internal::CacheableArrayPrimitive<int32_t,
246 internal::DSCode::CacheableInt32Array>;
247extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
248 internal::CacheableArrayPrimitive<int32_t,
249 internal::DSCode::CacheableInt32Array>;
250
256 internal::CacheableArrayPrimitive<int64_t,
257 internal::DSCode::CacheableInt64Array>;
258extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
259 internal::CacheableArrayPrimitive<int64_t,
260 internal::DSCode::CacheableInt64Array>;
261
267 internal::CacheableArrayPrimitive<std::shared_ptr<CacheableString>,
268 internal::DSCode::CacheableStringArray>;
269extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
270 internal::CacheableArrayPrimitive<std::shared_ptr<CacheableString>,
271 internal::DSCode::CacheableStringArray>;
272
273// The following are defined as classes to avoid the issues with MSVC++
274// warning/erroring on C4503
275
280class APACHE_GEODE_EXPORT CacheableVector
281 : public internal::CacheableContainerPrimitive<
282 std::vector<std::shared_ptr<Cacheable>>,
283 internal::DSCode::CacheableVector, CacheableVector> {
284 public:
285 using CacheableContainerPrimitive::CacheableContainerPrimitive;
286};
287
288template class internal::CacheableContainerPrimitive<
289 std::vector<std::shared_ptr<Cacheable>>, internal::DSCode::CacheableVector,
291
296class APACHE_GEODE_EXPORT CacheableHashMap
297 : public internal::CacheableContainerPrimitive<
298 HashMapOfCacheable, internal::DSCode::CacheableHashMap,
299 CacheableHashMap> {
300 public:
301 using CacheableContainerPrimitive::CacheableContainerPrimitive;
302};
303
304template class internal::CacheableContainerPrimitive<
305 HashMapOfCacheable, internal::DSCode::CacheableHashMap, CacheableHashMap>;
306
311class APACHE_GEODE_EXPORT CacheableHashSet
312 : public internal::CacheableContainerPrimitive<
313 HashSetOfCacheableKey, internal::DSCode::CacheableHashSet,
314 CacheableHashSet> {
315 public:
316 using CacheableContainerPrimitive::CacheableContainerPrimitive;
317};
318
319template class internal::CacheableContainerPrimitive<
320 HashSetOfCacheableKey, internal::DSCode::CacheableHashSet,
322
327class APACHE_GEODE_EXPORT CacheableArrayList
328 : public internal::CacheableContainerPrimitive<
329 std::vector<std::shared_ptr<Cacheable>>,
330 internal::DSCode::CacheableArrayList, CacheableArrayList> {
331 public:
332 using CacheableContainerPrimitive::CacheableContainerPrimitive;
333};
334
335template class internal::CacheableContainerPrimitive<
336 std::vector<std::shared_ptr<Cacheable>>,
337 internal::DSCode::CacheableArrayList, CacheableArrayList>;
338
343class APACHE_GEODE_EXPORT CacheableLinkedList
344 : public internal::CacheableContainerPrimitive<
345 std::vector<std::shared_ptr<Cacheable>>,
346 internal::DSCode::CacheableLinkedList, CacheableLinkedList> {
347 public:
348 using CacheableContainerPrimitive::CacheableContainerPrimitive;
349};
350
351template class internal::CacheableContainerPrimitive<
352 std::vector<std::shared_ptr<Cacheable>>,
353 internal::DSCode::CacheableLinkedList, CacheableLinkedList>;
354
359class APACHE_GEODE_EXPORT CacheableStack
360 : public internal::CacheableContainerPrimitive<
361 std::vector<std::shared_ptr<Cacheable>>,
362 internal::DSCode::CacheableStack, CacheableStack> {
363 public:
364 using CacheableContainerPrimitive::CacheableContainerPrimitive;
365};
366
367template class internal::CacheableContainerPrimitive<
368 HashMapOfCacheable, internal::DSCode::CacheableStack, CacheableStack>;
369
374class APACHE_GEODE_EXPORT CacheableHashTable
375 : public internal::CacheableContainerPrimitive<
376 HashMapOfCacheable, internal::DSCode::CacheableHashTable,
377 CacheableHashTable> {
378 public:
379 using CacheableContainerPrimitive::CacheableContainerPrimitive;
380};
381
382template class internal::CacheableContainerPrimitive<
383 HashMapOfCacheable, internal::DSCode::CacheableHashTable,
385
393class APACHE_GEODE_EXPORT CacheableIdentityHashMap
394 : public internal::CacheableContainerPrimitive<
395 HashMapOfCacheable, internal::DSCode::CacheableIdentityHashMap,
396 CacheableIdentityHashMap> {
397 public:
398 using CacheableContainerPrimitive::CacheableContainerPrimitive;
399};
400
401template class internal::CacheableContainerPrimitive<
402 HashMapOfCacheable, internal::DSCode::CacheableIdentityHashMap,
404
412class APACHE_GEODE_EXPORT CacheableLinkedHashSet
413 : public internal::CacheableContainerPrimitive<
414 HashSetOfCacheableKey, internal::DSCode::CacheableLinkedHashSet,
415 CacheableLinkedHashSet> {
416 public:
417 using CacheableContainerPrimitive::CacheableContainerPrimitive;
418};
419
420template class internal::CacheableContainerPrimitive<
421 HashSetOfCacheableKey, internal::DSCode::CacheableLinkedHashSet,
423
424} // namespace client
425} // namespace geode
426} // namespace apache
427
428#endif // GEODE_CACHEABLEBUILTINS_H_
internal::CacheableArrayPrimitive< int32_t, internal::DSCode::CacheableInt32Array > CacheableInt32Array
An immutable wrapper for array of 32-bit integers that can serve as a distributable object for cachin...
internal::CacheableArrayPrimitive< int16_t, internal::DSCode::CacheableInt16Array > CacheableInt16Array
An immutable wrapper for array of 16-bit integers that can serve as a distributable object for cachin...
internal::CacheableArrayPrimitive< int8_t, internal::DSCode::CacheableBytes > CacheableBytes
An immutable wrapper for byte arrays that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:185
internal::CacheableKeyPrimitive< int8_t, internal::DSCode::CacheableByte > CacheableByte
An immutable wrapper for byte that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:63
internal::CacheableArrayPrimitive< float, internal::DSCode::CacheableFloatArray > CacheableFloatArray
An immutable wrapper for array of floats that can serve as a distributable object for caching.
internal::CacheableKeyPrimitive< int16_t, internal::DSCode::CacheableInt16 > CacheableInt16
An immutable wrapper for 16-bit integers that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:115
internal::CacheableKeyPrimitive< int64_t, internal::DSCode::CacheableInt64 > CacheableInt64
An immutable wrapper for 64-bit integers that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:149
internal::CacheableKeyPrimitive< int32_t, internal::DSCode::CacheableInt32 > CacheableInt32
An immutable wrapper for 32-bit integers that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:132
internal::CacheableArrayPrimitive< int64_t, internal::DSCode::CacheableInt64Array > CacheableInt64Array
An immutable wrapper for array of 64-bit integers that can serve as a distributable object for cachin...
internal::CacheableKeyPrimitive< char16_t, internal::DSCode::CacheableCharacter > CacheableCharacter
An immutable wrapper for 16-bit characters that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:167
internal::CacheableArrayPrimitive< double, internal::DSCode::CacheableDoubleArray > CacheableDoubleArray
An immutable wrapper for array of doubles that can serve as a distributable object for caching.
internal::CacheableArrayPrimitive< std::shared_ptr< CacheableString >, internal::DSCode::CacheableStringArray > CacheableStringArray
An immutable wrapper for array of strings that can serve as a distributable object for caching.
internal::CacheableKeyPrimitive< bool, internal::DSCode::CacheableBoolean > CacheableBoolean
An immutable wrapper for bool that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:46
internal::CacheableKeyPrimitive< float, internal::DSCode::CacheableFloat > CacheableFloat
An immutable wrapper for floats that can serve as.
Definition: CacheableBuiltins.hpp:98
internal::CacheableArrayPrimitive< char16_t, internal::DSCode::CharArray > CharArray
An immutable wrapper for array of wide-characters that can serve as a distributable object for cachin...
internal::CacheableArrayPrimitive< bool, internal::DSCode::BooleanArray > BooleanArray
An immutable wrapper for array of booleans that can serve as a distributable object for caching.
internal::CacheableKeyPrimitive< double, internal::DSCode::CacheableDouble > CacheableDouble
An immutable wrapper for doubles that can serve as a distributable key object for caching.
Definition: CacheableBuiltins.hpp:80
A mutable Cacheable vector wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:283
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:299
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:314
A mutable Cacheable array list wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:330
A mutable Cacheable array list wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:346
A mutable Cacheable stack wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:362
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:377
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:396
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:415
static std::shared_ptr< CacheableKey > create(_T value)
Factory method that creates the key type that matches the type of value.
static std::shared_ptr< Serializable > create(_T value)
Factory method that creates the Serializable object that matches the type of value.

Apache Geode C++ Cache API Documentation