Apache Geode Native C++ Reference 1.15.0
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
58template <>
59inline std::shared_ptr<Cacheable> Serializable::create(std::nullptr_t) {
60 return static_cast<std::shared_ptr<Cacheable>>(nullptr);
61}
62
68 internal::CacheableKeyPrimitive<int8_t, internal::DSCode::CacheableByte>;
69extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
70 internal::CacheableKeyPrimitive<int8_t, internal::DSCode::CacheableByte>;
71template <>
72inline std::shared_ptr<CacheableKey> CacheableKey::create(int8_t value) {
73 return CacheableByte::create(value);
74}
75template <>
76inline std::shared_ptr<Cacheable> Serializable::create(int8_t value) {
77 return CacheableByte::create(value);
78}
79
85 internal::CacheableKeyPrimitive<double, internal::DSCode::CacheableDouble>;
86extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
87 internal::CacheableKeyPrimitive<double, internal::DSCode::CacheableDouble>;
88template <>
89inline std::shared_ptr<CacheableKey> CacheableKey::create(double value) {
90 return CacheableDouble::create(value);
91}
92template <>
93inline std::shared_ptr<Cacheable> Serializable::create(double value) {
94 return CacheableDouble::create(value);
95}
96
103 internal::CacheableKeyPrimitive<float, internal::DSCode::CacheableFloat>;
104extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
105 internal::CacheableKeyPrimitive<float, internal::DSCode::CacheableFloat>;
106template <>
107inline std::shared_ptr<CacheableKey> CacheableKey::create(float value) {
108 return CacheableFloat::create(value);
109}
110template <>
111inline std::shared_ptr<Cacheable> Serializable::create(float value) {
112 return CacheableFloat::create(value);
113}
114
120 internal::CacheableKeyPrimitive<int16_t, internal::DSCode::CacheableInt16>;
121extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
122 internal::CacheableKeyPrimitive<int16_t, internal::DSCode::CacheableInt16>;
123template <>
124inline std::shared_ptr<CacheableKey> CacheableKey::create(int16_t value) {
125 return CacheableInt16::create(value);
126}
127template <>
128inline std::shared_ptr<Cacheable> Serializable::create(int16_t value) {
129 return CacheableInt16::create(value);
130}
131
137 internal::CacheableKeyPrimitive<int32_t, internal::DSCode::CacheableInt32>;
138extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
139 internal::CacheableKeyPrimitive<int32_t, internal::DSCode::CacheableInt32>;
140template <>
141inline std::shared_ptr<CacheableKey> CacheableKey::create(int32_t value) {
142 return CacheableInt32::create(value);
143}
144template <>
145inline std::shared_ptr<Cacheable> Serializable::create(int32_t value) {
146 return CacheableInt32::create(value);
147}
148
154 internal::CacheableKeyPrimitive<int64_t, internal::DSCode::CacheableInt64>;
155extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
156 internal::CacheableKeyPrimitive<int64_t, internal::DSCode::CacheableInt64>;
157template <>
158inline std::shared_ptr<CacheableKey> CacheableKey::create(int64_t value) {
159 return CacheableInt64::create(value);
160}
161template <>
162inline std::shared_ptr<Cacheable> Serializable::create(int64_t value) {
163 return CacheableInt64::create(value);
164}
165
171 internal::CacheableKeyPrimitive<char16_t,
172 internal::DSCode::CacheableCharacter>;
173extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
174 internal::CacheableKeyPrimitive<char16_t,
175 internal::DSCode::CacheableCharacter>;
176template <>
177inline std::shared_ptr<CacheableKey> CacheableKey::create(char16_t value) {
178 return CacheableCharacter::create(value);
179}
180template <>
181inline std::shared_ptr<Cacheable> Serializable::create(char16_t value) {
182 return CacheableCharacter::create(value);
183}
184
190 internal::CacheableArrayPrimitive<int8_t, internal::DSCode::CacheableBytes>;
191extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
192 internal::CacheableArrayPrimitive<int8_t, internal::DSCode::CacheableBytes>;
193
198using BooleanArray =
199 internal::CacheableArrayPrimitive<bool, internal::DSCode::BooleanArray>;
200extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
201 internal::CacheableArrayPrimitive<bool, internal::DSCode::BooleanArray>;
202
207using CharArray =
208 internal::CacheableArrayPrimitive<char16_t, internal::DSCode::CharArray>;
209extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
210 internal::CacheableArrayPrimitive<char16_t, internal::DSCode::CharArray>;
211
217 internal::CacheableArrayPrimitive<double,
218 internal::DSCode::CacheableDoubleArray>;
219extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
220 internal::CacheableArrayPrimitive<double,
221 internal::DSCode::CacheableDoubleArray>;
222
228 internal::CacheableArrayPrimitive<float,
229 internal::DSCode::CacheableFloatArray>;
230extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
231 internal::CacheableArrayPrimitive<float,
232 internal::DSCode::CacheableFloatArray>;
233
239 internal::CacheableArrayPrimitive<int16_t,
240 internal::DSCode::CacheableInt16Array>;
241extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
242 internal::CacheableArrayPrimitive<int16_t,
243 internal::DSCode::CacheableInt16Array>;
244
250 internal::CacheableArrayPrimitive<int32_t,
251 internal::DSCode::CacheableInt32Array>;
252extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
253 internal::CacheableArrayPrimitive<int32_t,
254 internal::DSCode::CacheableInt32Array>;
255
261 internal::CacheableArrayPrimitive<int64_t,
262 internal::DSCode::CacheableInt64Array>;
263extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
264 internal::CacheableArrayPrimitive<int64_t,
265 internal::DSCode::CacheableInt64Array>;
266
272 internal::CacheableArrayPrimitive<std::shared_ptr<CacheableString>,
273 internal::DSCode::CacheableStringArray>;
274extern template class APACHE_GEODE_EXTERN_TEMPLATE_EXPORT
275 internal::CacheableArrayPrimitive<std::shared_ptr<CacheableString>,
276 internal::DSCode::CacheableStringArray>;
277
278// The following are defined as classes to avoid the issues with MSVC++
279// warning/erroring on C4503
280
285class APACHE_GEODE_EXPORT CacheableVector
286 : public internal::CacheableContainerPrimitive<
287 std::vector<std::shared_ptr<Cacheable>>,
288 internal::DSCode::CacheableVector, CacheableVector> {
289 public:
290 using CacheableContainerPrimitive::CacheableContainerPrimitive;
291};
292
293template class internal::CacheableContainerPrimitive<
294 std::vector<std::shared_ptr<Cacheable>>, internal::DSCode::CacheableVector,
296
301class APACHE_GEODE_EXPORT CacheableHashMap
302 : public internal::CacheableContainerPrimitive<
303 HashMapOfCacheable, internal::DSCode::CacheableHashMap,
304 CacheableHashMap> {
305 public:
306 using CacheableContainerPrimitive::CacheableContainerPrimitive;
307};
308
309template class internal::CacheableContainerPrimitive<
310 HashMapOfCacheable, internal::DSCode::CacheableHashMap, CacheableHashMap>;
311
316class APACHE_GEODE_EXPORT CacheableHashSet
317 : public internal::CacheableContainerPrimitive<
318 HashSetOfCacheableKey, internal::DSCode::CacheableHashSet,
319 CacheableHashSet> {
320 public:
321 using CacheableContainerPrimitive::CacheableContainerPrimitive;
322};
323
324template class internal::CacheableContainerPrimitive<
325 HashSetOfCacheableKey, internal::DSCode::CacheableHashSet,
327
332class APACHE_GEODE_EXPORT CacheableArrayList
333 : public internal::CacheableContainerPrimitive<
334 std::vector<std::shared_ptr<Cacheable>>,
335 internal::DSCode::CacheableArrayList, CacheableArrayList> {
336 public:
337 using CacheableContainerPrimitive::CacheableContainerPrimitive;
338};
339
340template class internal::CacheableContainerPrimitive<
341 std::vector<std::shared_ptr<Cacheable>>,
342 internal::DSCode::CacheableArrayList, CacheableArrayList>;
343
348class APACHE_GEODE_EXPORT CacheableLinkedList
349 : public internal::CacheableContainerPrimitive<
350 std::vector<std::shared_ptr<Cacheable>>,
351 internal::DSCode::CacheableLinkedList, CacheableLinkedList> {
352 public:
353 using CacheableContainerPrimitive::CacheableContainerPrimitive;
354};
355
356template class internal::CacheableContainerPrimitive<
357 std::vector<std::shared_ptr<Cacheable>>,
358 internal::DSCode::CacheableLinkedList, CacheableLinkedList>;
359
364class APACHE_GEODE_EXPORT CacheableStack
365 : public internal::CacheableContainerPrimitive<
366 std::vector<std::shared_ptr<Cacheable>>,
367 internal::DSCode::CacheableStack, CacheableStack> {
368 public:
369 using CacheableContainerPrimitive::CacheableContainerPrimitive;
370};
371
372template class internal::CacheableContainerPrimitive<
373 HashMapOfCacheable, internal::DSCode::CacheableStack, CacheableStack>;
374
379class APACHE_GEODE_EXPORT CacheableHashTable
380 : public internal::CacheableContainerPrimitive<
381 HashMapOfCacheable, internal::DSCode::CacheableHashTable,
382 CacheableHashTable> {
383 public:
384 using CacheableContainerPrimitive::CacheableContainerPrimitive;
385};
386
387template class internal::CacheableContainerPrimitive<
388 HashMapOfCacheable, internal::DSCode::CacheableHashTable,
390
398class APACHE_GEODE_EXPORT CacheableIdentityHashMap
399 : public internal::CacheableContainerPrimitive<
400 HashMapOfCacheable, internal::DSCode::CacheableIdentityHashMap,
401 CacheableIdentityHashMap> {
402 public:
403 using CacheableContainerPrimitive::CacheableContainerPrimitive;
404};
405
406template class internal::CacheableContainerPrimitive<
407 HashMapOfCacheable, internal::DSCode::CacheableIdentityHashMap,
409
417class APACHE_GEODE_EXPORT CacheableLinkedHashSet
418 : public internal::CacheableContainerPrimitive<
419 HashSetOfCacheableKey, internal::DSCode::CacheableLinkedHashSet,
420 CacheableLinkedHashSet> {
421 public:
422 using CacheableContainerPrimitive::CacheableContainerPrimitive;
423};
424
425template class internal::CacheableContainerPrimitive<
426 HashSetOfCacheableKey, internal::DSCode::CacheableLinkedHashSet,
428
429} // namespace client
430} // namespace geode
431} // namespace apache
432
433#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:190
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:68
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:120
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:154
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:137
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:172
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:103
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:85
A mutable Cacheable vector wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:288
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:304
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:319
A mutable Cacheable array list wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:335
A mutable Cacheable array list wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:351
A mutable Cacheable stack wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:367
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:382
A mutable CacheableKey to Serializable hash map that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:401
A mutable CacheableKey hash set wrapper that can serve as a distributable object for caching.
Definition: CacheableBuiltins.hpp:420
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