Apache Geode Native C++ Reference 1.15.0
apache::geode::client::GeodeCache Class Referenceabstract

GeodeCache represents the singleton cache that must be created in order to connect to Geode server. More...

#include <GeodeCache.hpp>

Inherits apache::geode::client::RegionService.

Inherited by apache::geode::client::Cache.

Public Member Functions

virtual void close ()=0
 Terminates this object cache and releases all the local resources. More...
 
virtual PdxInstanceFactory createPdxInstanceFactory (const std::string &className) const =0
 Returns a factory that can create a PdxInstance. More...
 
virtual PdxInstanceFactory createPdxInstanceFactory (const std::string &className, bool expectDomainClass) const =0
 Returns a factory that can create a PdxInstance. More...
 
virtual const std::string & getName () const =0
 Returns the name of this cache. More...
 
virtual bool getPdxIgnoreUnreadFields () const =0
 Returns whether Cache saves unread fields for Pdx types. More...
 
virtual bool getPdxReadSerialized () const =0
 Returns whether PdxInstance is preferred for PDX types instead of C++ object. More...
 
virtual std::shared_ptr< QueryServicegetQueryService ()=0
 Gets the QueryService from which a new Query can be obtained. More...
 
virtual std::shared_ptr< RegiongetRegion (const std::string &name) const =0
 Look up a region with the name. More...
 
virtual void initializeDeclarativeCache (const std::string &cacheXml)=0
 Initialize the cache by the contents of an xml file. More...
 
virtual bool isClosed () const =0
 Indicates if this cache has been closed. More...
 
virtual std::vector< std::shared_ptr< Region > > rootRegions () const =0
 Returns a set of root regions in the cache. More...
 

Detailed Description

GeodeCache represents the singleton cache that must be created in order to connect to Geode server.

Users must create a Cache. Instances of this interface are created using one of the following methods:

Member Function Documentation

◆ close()

virtual void apache::geode::client::RegionService::close ( )
pure virtualinherited

Terminates this object cache and releases all the local resources.

After this cache is closed, any further method call on this cache or any region object will throw CacheClosedException, unless otherwise noted. If RegionService is created from Cache#createAuthenticatedView", then it clears user related security data.

Parameters
keepalivewhether to keep a durable CQ kept alive for this user.
Exceptions
CacheClosedException,ifthe cache is already closed.

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.

◆ createPdxInstanceFactory() [1/2]

virtual PdxInstanceFactory apache::geode::client::RegionService::createPdxInstanceFactory ( const std::string &  className) const
pure virtualinherited

Returns a factory that can create a PdxInstance.

Parameters
classNamethe fully qualified class name that the PdxInstance will become when it is fully deserialized.
Returns
the factory

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.

◆ createPdxInstanceFactory() [2/2]

virtual PdxInstanceFactory apache::geode::client::RegionService::createPdxInstanceFactory ( const std::string &  className,
bool  expectDomainClass 
) const
pure virtualinherited

Returns a factory that can create a PdxInstance.

Parameters
classNamethe fully qualified class name that the PdxInstance will become when it is fully deserialized.
expectDomainClassWhether or not created PdxType represents a Java domain class.
Exceptions
IllegalStateExceptionif the className is nullptr or invalid.
Returns
the factory

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.

◆ getName()

virtual const std::string & apache::geode::client::GeodeCache::getName ( ) const
pure virtual

Returns the name of this cache.

Returns
the string name of this cache

Implemented in apache::geode::client::Cache.

◆ getPdxIgnoreUnreadFields()

virtual bool apache::geode::client::GeodeCache::getPdxIgnoreUnreadFields ( ) const
pure virtual

Returns whether Cache saves unread fields for Pdx types.

Implemented in apache::geode::client::Cache.

◆ getPdxReadSerialized()

virtual bool apache::geode::client::GeodeCache::getPdxReadSerialized ( ) const
pure virtual

Returns whether PdxInstance is preferred for PDX types instead of C++ object.

Implemented in apache::geode::client::Cache.

◆ getQueryService()

virtual std::shared_ptr< QueryService > apache::geode::client::RegionService::getQueryService ( )
pure virtualinherited

Gets the QueryService from which a new Query can be obtained.

Returns
A smart pointer to the QueryService.

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.

◆ getRegion()

virtual std::shared_ptr< Region > apache::geode::client::RegionService::getRegion ( const std::string &  name) const
pure virtualinherited

Look up a region with the name.

Parameters
namethe region's name, such as root.
Returns
region, or nullptr if no such region exists.

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.

◆ initializeDeclarativeCache()

virtual void apache::geode::client::GeodeCache::initializeDeclarativeCache ( const std::string &  cacheXml)
pure virtual

Initialize the cache by the contents of an xml file.

Parameters
cacheXmlThe xml file
Exceptions
OutOfMemoryException
CacheXmlExceptionSomething went wrong while parsing the XML
IllegalStateExceptionIf xml file is well-flrmed but not valid
RegionExistsExceptionif a region is already in this cache
CacheClosedExceptionif the cache is closed at the time of region creation
UnknownExceptionotherwise

Implemented in apache::geode::client::Cache.

◆ isClosed()

virtual bool apache::geode::client::RegionService::isClosed ( ) const
pure virtualinherited

Indicates if this cache has been closed.

After a new cache object is created, this method returns false; After the close is called on this cache object, this method returns true.

Returns
true, if this cache is closed; false, otherwise

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.

◆ rootRegions()

virtual std::vector< std::shared_ptr< Region > > apache::geode::client::RegionService::rootRegions ( ) const
pure virtualinherited

Returns a set of root regions in the cache.

This set is a snapshot and is not backed by the Cache. The vector passed in is cleared and the regions are added to it.

Implemented in apache::geode::client::AuthenticatedView, and apache::geode::client::Cache.


Apache Geode C++ Cache API Documentation