3 #ifndef GEODE_REGION_H_ 4 #define GEODE_REGION_H_ 25 #include "geode_globals.hpp" 41 #include "PartitionResolver.hpp" 49 #define DEFAULT_RESPONSE_TIMEOUT 15 92 virtual const char* getName()
const = 0;
98 virtual const char* getFullPath()
const = 0;
103 virtual RegionPtr getParentRegion()
const = 0;
136 virtual void invalidateRegion(
137 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
158 virtual void localInvalidateRegion(
159 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
198 virtual void destroyRegion(
199 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
207 virtual void clear(
const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
215 virtual void localClear(
const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
236 virtual void localDestroyRegion(
237 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
241 virtual RegionPtr getSubregion(
const char* path) = 0;
245 const char* subregionName,
255 virtual void subregions(
const bool recursive,
VectorOfRegion& sr) = 0;
263 template <
class KEYTYPE>
265 return getEntry(createKey(key));
310 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
313 template <
class KEYTYPE>
316 return get(createKey(key), callbackArg);
363 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
366 template <
class KEYTYPE,
class VALUETYPE>
367 inline void put(
const KEYTYPE& key,
const VALUETYPE& value,
369 put(createKey(key), createValue(value), arg);
373 template <
class KEYTYPE>
376 put(createKey(key), value, arg);
380 template <
class VALUETYPE>
383 put(key, createValue(value), arg);
408 uint32_t timeout = DEFAULT_RESPONSE_TIMEOUT,
409 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
436 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
439 template <
class KEYTYPE,
class VALUETYPE>
440 inline void localPut(
const KEYTYPE& key,
const VALUETYPE& value,
442 localPut(createKey(key), createValue(value), arg);
446 template <
class KEYTYPE>
449 localPut(createKey(key), value, arg);
453 template <
class VALUETYPE>
456 localPut(key, createValue(value), arg);
506 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
509 template <
class KEYTYPE,
class VALUETYPE>
510 inline void create(
const KEYTYPE& key,
const VALUETYPE& value,
512 create(createKey(key), createValue(value), arg);
516 template <
class KEYTYPE>
519 create(createKey(key), value, arg);
523 template <
class VALUETYPE>
526 create(key, createValue(value), arg);
556 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
559 template <
class KEYTYPE,
class VALUETYPE>
560 inline void localCreate(
const KEYTYPE& key,
const VALUETYPE& value,
562 localCreate(createKey(key), createValue(value), arg);
566 template <
class KEYTYPE>
569 localCreate(createKey(key), value, arg);
573 template <
class VALUETYPE>
576 localCreate(key, createValue(value), arg);
602 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
605 template <
class KEYTYPE>
607 invalidate(createKey(key), arg);
630 virtual void localInvalidate(
632 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
635 template <
class KEYTYPE>
638 localInvalidate(createKey(key), arg);
686 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
689 template <
class KEYTYPE>
691 destroy(createKey(key), arg);
719 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
722 template <
class KEYTYPE>
725 localDestroy(createKey(key), arg);
777 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
780 template <
class KEYTYPE,
class VALUETYPE>
781 inline bool remove(
const KEYTYPE& key,
const VALUETYPE& value,
783 return remove(createKey(key), createValue(value), arg);
787 template <
class KEYTYPE>
790 return remove(createKey(key), value, arg);
794 template <
class VALUETYPE>
797 return remove(key, createValue(value), arg);
803 template <
class KEYTYPE>
804 inline bool remove(
const KEYTYPE& key) {
805 return remove(createKey(key));
855 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
858 template <
class KEYTYPE>
860 return removeEx(createKey(key), arg);
892 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
895 template <
class KEYTYPE,
class VALUETYPE>
896 inline bool localRemove(
const KEYTYPE& key,
const VALUETYPE& value,
898 return localRemove(createKey(key), createValue(value), arg);
902 template <
class KEYTYPE>
905 return localRemove(createKey(key), value, arg);
909 template <
class VALUETYPE>
912 return localRemove(key, createValue(value), arg);
941 virtual bool localRemoveEx(
943 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
946 template <
class KEYTYPE>
949 return localRemoveEx(createKey(key), arg);
999 virtual bool isDestroyed()
const = 0;
1006 virtual bool containsValueForKey(
const CacheableKeyPtr& keyPtr)
const = 0;
1014 template <
class KEYTYPE>
1016 return containsValueForKey(createKey(key));
1031 virtual bool containsKeyOnServer(
const CacheableKeyPtr& keyPtr)
const = 0;
1052 template <
class KEYTYPE>
1054 return containsKey(createKey(key));
1093 bool isDurable =
false,
1094 bool getInitialValues =
false,
1095 bool receiveValues =
true) = 0;
1159 virtual void registerAllKeys(
bool isDurable =
false,
1161 bool getInitialValues =
false,
1162 bool receiveValues =
true) = 0;
1186 virtual void unregisterAllKeys() = 0;
1231 virtual void registerRegex(
const char* regex,
bool isDurable =
false,
1233 bool getInitialValues =
false,
1234 bool receiveValues =
true) = 0;
1263 virtual void unregisterRegex(
const char* regex) = 0;
1312 bool addToLocalCache =
false,
1313 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
1345 const char* predicate,
1370 virtual bool existsValue(
1371 const char* predicate,
1400 const char* predicate,
1432 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
1438 virtual uint32_t size() = 0;
1440 virtual const PoolPtr& getPool() = 0;
1455 #endif // GEODE_REGION_H_ bool localRemove(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:910
bool localRemove(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:896
void localInvalidate(const KEYTYPE &key, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:636
bool removeEx(const KEYTYPE &key, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:859
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
A vector of Cacheable objects that also extends SharedBase for smart pointers.
Definition: VectorT.hpp:202
bool containsValueForKey(const KEYTYPE &key) const
Convenience method allowing key to be a const char* This operations checks for the value in the local...
Definition: Region.hpp:1015
void localCreate(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:574
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
bool localRemove(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:903
void create(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:510
Contains generic template definitions for Cacheable types and instantiations for built-in types...
bool localRemoveEx(const KEYTYPE &key, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:947
void create(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:517
void destroy(const KEYTYPE &key, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:690
void invalidate(const KEYTYPE &key, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:606
void localDestroy(const KEYTYPE &key, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:723
RegionEntryPtr getEntry(const KEYTYPE &key)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:264
void localCreate(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:567
void put(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:367
void localCreate(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:560
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:40
A map of CacheableKey objects to Cacheable that also extends SharedBase for smart pointers...
Definition: HashMapT.hpp:174
Vector template type class.
Definition: VectorT.hpp:37
A vector of CacheableKey objects that also extends SharedBase for smart pointers. ...
Definition: VectorT.hpp:230
void localPut(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:454
void localPut(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:447
void put(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:374
void localPut(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:440
#define DEFAULT_QUERY_RESPONSE_TIMEOUT
default timeout for query response
Definition: geode_base.hpp:176
This class manages subregions and cached data.
Definition: Region.hpp:87
bool containsKey(const KEYTYPE &key) const
Convenience method allowing key to be a const char* This operations checks for the key in the local c...
Definition: Region.hpp:1053
void put(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:381
This namespace contains all the Geode C++ API classes, enumerations and globals.
void create(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=::apache::geode::client::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:524