1 #ifndef __GEMFIRE_REGION_H__ 2 #define __GEMFIRE_REGION_H__ 17 #include "gfcpp_globals.hpp" 33 #include "PartitionResolver.hpp" 41 #define DEFAULT_RESPONSE_TIMEOUT 15 82 virtual const char* getName()
const = 0;
88 virtual const char* getFullPath()
const = 0;
93 virtual RegionPtr getParentRegion()
const = 0;
125 virtual void invalidateRegion(
126 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
145 virtual void localInvalidateRegion(
146 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
180 virtual void destroyRegion(
181 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
189 virtual void clear(
const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
197 virtual void localClear(
const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
217 virtual void localDestroyRegion(
218 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
221 virtual RegionPtr getSubregion(
const char* path ) = 0;
224 virtual RegionPtr createSubregion(
const char* subregionName,
232 virtual void subregions(
const bool recursive,
VectorOfRegion& sr) = 0;
240 template<
class KEYTYPE >
243 return getEntry( createKey( key ) );
281 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
284 template<
class KEYTYPE>
288 return get(createKey(key), callbackArg);
329 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
332 template<
class KEYTYPE,
class VALUETYPE >
333 inline void put(
const KEYTYPE& key,
const VALUETYPE& value,
336 put( createKey( key ), createValue( value ), arg );
340 template<
class KEYTYPE >
344 put( createKey( key ), value, arg );
348 template<
class VALUETYPE >
352 put( key, createValue( value ), arg );
375 uint32_t timeout = DEFAULT_RESPONSE_TIMEOUT,
376 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
400 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
403 template<
class KEYTYPE,
class VALUETYPE>
404 inline void localPut(
const KEYTYPE& key,
const VALUETYPE& value,
407 localPut(createKey(key), createValue(value), arg);
411 template<
class KEYTYPE>
415 localPut(createKey(key), value, arg);
419 template<
class VALUETYPE>
423 localPut(key, createValue(value), arg);
468 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
471 template<
class KEYTYPE,
class VALUETYPE >
472 inline void create(
const KEYTYPE& key,
const VALUETYPE& value,
475 create( createKey( key ), createValue( value ), arg );
479 template<
class KEYTYPE >
483 create( createKey( key ), value, arg );
487 template<
class VALUETYPE >
491 create( key, createValue( value ), arg );
520 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
523 template<
class KEYTYPE,
class VALUETYPE>
524 inline void localCreate(
const KEYTYPE& key,
const VALUETYPE& value,
527 localCreate(createKey(key), createValue(value), arg);
531 template<
class KEYTYPE>
535 localCreate(createKey(key), value, arg);
539 template<
class VALUETYPE>
543 localCreate(key, createValue(value), arg);
568 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
571 template<
class KEYTYPE >
575 invalidate( createKey( key ), arg );
598 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
601 template<
class KEYTYPE >
605 localInvalidate( createKey( key ), arg );
650 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
653 template<
class KEYTYPE >
656 destroy( createKey( key ), arg );
682 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
685 template<
class KEYTYPE >
689 localDestroy( createKey( key ), arg );
735 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
738 template<
class KEYTYPE,
class VALUETYPE >
739 inline bool remove(
const KEYTYPE& key,
const VALUETYPE& value,
742 return remove( createKey( key ), createValue( value ), arg );
746 template<
class KEYTYPE >
750 return remove( createKey( key ), value, arg );
754 template<
class VALUETYPE >
758 return remove( key, createValue( value ), arg );
763 return removeEx(key);
767 template<
class KEYTYPE>
768 inline bool remove(
const KEYTYPE& key)
770 return remove( createKey( key ));
815 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
818 template<
class KEYTYPE >
821 return removeEx( createKey( key ), arg );
849 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
853 template<
class KEYTYPE,
class VALUETYPE >
854 inline bool localRemove(
const KEYTYPE& key,
const VALUETYPE& value,
857 return localRemove( createKey( key ), createValue( value ), arg );
861 template<
class KEYTYPE >
865 return localRemove( createKey( key ), value, arg );
869 template<
class VALUETYPE >
873 return localRemove( key, createValue( value ), arg );
901 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
904 template<
class KEYTYPE >
907 return localRemoveEx( createKey( key ), arg );
953 virtual CachePtr getCache()
const = 0;
961 virtual bool isDestroyed()
const = 0;
968 virtual bool containsValueForKey(
const CacheableKeyPtr& keyPtr)
const = 0;
976 template<
class KEYTYPE >
979 return containsValueForKey( createKey( key ) );
992 virtual bool containsKeyOnServer(
const CacheableKeyPtr& keyPtr)
const = 0;
1011 template<
class KEYTYPE >
1014 return containsKey( createKey( key ) );
1048 bool isDurable =
false,
bool getInitialValues =
false,
1049 bool receiveValues =
true) = 0;
1103 virtual void registerAllKeys(
bool isDurable =
false,
1105 bool getInitialValues =
false,
bool receiveValues =
true) = 0;
1124 virtual void unregisterAllKeys()= 0;
1163 virtual void registerRegex(
const char * regex,
bool isDurable =
false,
1165 bool getInitialValues =
false,
bool receiveValues =
true) = 0;
1187 virtual void unregisterRegex(
const char * regex)=0;
1231 bool addToLocalCache =
false,
1232 const UserDataPtr& aCallbackArgument = NULLPTR) = 0;
1334 virtual uint32_t size() = 0;
1336 virtual const PoolPtr& getPool() =0;
1351 #endif //ifndef __GEMFIRE_REGION_H__ Vector template type class.
Definition: VectorT.hpp:24
void create(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:472
void localPut(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:420
void create(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:480
void localPut(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:412
void localCreate(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:540
This class manages subregions and cached data.
Definition: Region.hpp:75
void invalidate(const KEYTYPE &key, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:572
bool localRemove(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:862
Contains generic template definitions for Cacheable types and instantiations for built-in types...
#define DEFAULT_QUERY_RESPONSE_TIMEOUT
default timeout for query response
Definition: gf_base.hpp:214
A vector of CacheableKey objects that also extends SharedBase for smart pointers. ...
Definition: VectorT.hpp:300
bool localRemove(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:870
void localCreate(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:524
void put(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:349
void localPut(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:404
RegionEntryPtr getEntry(const KEYTYPE &key)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:241
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:1012
A vector of Cacheable objects that also extends SharedBase for smart pointers.
Definition: VectorT.hpp:269
void put(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:333
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
void localInvalidate(const KEYTYPE &key, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:602
void put(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:341
A map of CacheableKey objects to Cacheable that also extends SharedBase for smart pointers...
Definition: HashMapT.hpp:240
void localDestroy(const KEYTYPE &key, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:686
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:31
void create(const CacheableKeyPtr &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing value to be a const char*.
Definition: Region.hpp:488
void localCreate(const KEYTYPE &key, const CacheablePtr &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:532
bool removeEx(const KEYTYPE &key, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:819
void destroy(const KEYTYPE &key, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:654
bool localRemoveEx(const KEYTYPE &key, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing key to be a const char*.
Definition: Region.hpp:905
bool localRemove(const KEYTYPE &key, const VALUETYPE &value, const UserDataPtr &arg=gemfire::NullSharedBase::s_instancePtr)
Convenience method allowing both key and value to be a const char*.
Definition: Region.hpp:854
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:977