VMware Tanzu GemFire Native C++ Reference  10.1.5
Cache.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_CACHE_H_
21 #define GEODE_CACHE_H_
22 
23 #include <string>
24 
25 #include "GeodeCache.hpp"
26 #include "internal/geode_globals.hpp"
27 
32 namespace apache {
33 namespace geode {
34 namespace client {
35 
36 class AuthenticatedView;
37 class AuthInitialize;
38 class CacheFactory;
39 class CacheImpl;
40 class CacheRegionHelper;
41 class CacheTransactionManager;
42 class DataInput;
43 class DataOutput;
44 class Pool;
45 class PoolFactory;
46 class PoolManager;
47 class Properties;
48 class QueryService;
49 class Region;
50 class RegionFactory;
51 class TypeRegistry;
52 enum class RegionShortcut;
53 
67 class APACHE_GEODE_EXPORT Cache : public GeodeCache {
71  public:
81 
88  void initializeDeclarativeCache(const std::string& cacheXml) override;
89 
93  const std::string& getName() const override;
94 
103  bool isClosed() const override;
104 
110 
120  void close() override;
121 
132  virtual void close(bool keepalive);
133 
144  std::shared_ptr<Region> getRegion(const std::string& path) const override;
145 
154  std::vector<std::shared_ptr<Region>> rootRegions() const override;
155 
160  std::shared_ptr<QueryService> getQueryService() override;
161 
169  virtual std::shared_ptr<QueryService> getQueryService(
170  const std::string& poolName) const;
171 
175  virtual void readyForEvents();
176 
201  const std::shared_ptr<Properties>& userSecurityProperties,
202  const std::string& poolName);
203 
209  virtual std::shared_ptr<CacheTransactionManager> getCacheTransactionManager()
210  const;
211 
215  bool getPdxIgnoreUnreadFields() const override;
216 
221  bool getPdxReadSerialized() const override;
222 
232  const std::string& className) const override;
233 
234  virtual DataInput createDataInput(const uint8_t* m_buffer, size_t len) const;
235 
236  virtual DataOutput createDataOutput() const;
237 
238  virtual PoolManager& getPoolManager() const;
239 
240  SystemProperties& getSystemProperties() const override;
241 
242  Cache() = delete;
243  virtual ~Cache();
244  Cache(const Cache& other) = delete;
245  Cache& operator=(const Cache& other) = delete;
246  Cache(Cache&& other) noexcept;
247  Cache& operator=(Cache&& other) noexcept;
248 
249  private:
253  Cache(const std::shared_ptr<Properties>& dsProp, bool ignorePdxUnreadFields,
254  bool readPdxSerialized,
255  const std::shared_ptr<AuthInitialize>& authInitialize);
256 
257  std::unique_ptr<CacheImpl> m_cacheImpl;
258 
259  protected:
260  static bool isPoolInMultiuserMode(std::shared_ptr<Region> regionPtr);
261 
262  friend class CacheFactory;
263  friend class CacheRegionHelper;
264  friend class FunctionService;
265  friend class CacheXmlCreation;
266  friend class RegionXmlCreation;
267 };
268 } // namespace client
269 } // namespace geode
270 } // namespace apache
271 
272 #endif // GEODE_CACHE_H_
RegionShortcut
Each enum represents a predefined RegionAttributes in a {}.
apache::geode::client::Cache::getQueryService
virtual std::shared_ptr< QueryService > getQueryService(const std::string &poolName) const
Gets the QueryService from which a new Query can be obtained.
apache::geode::client::AuthenticatedView
Creates an authenticated cache view to allow credential based access to region services.
Definition: AuthenticatedView.hpp:46
apache::geode::client::PoolManager
Manages creation and access to connection pools for clients.
Definition: PoolManager.hpp:61
apache::geode::client::Cache::getQueryService
std::shared_ptr< QueryService > getQueryService() override
Gets the QueryService from which a new Query can be obtained.
apache::geode::client::Cache::rootRegions
std::vector< std::shared_ptr< Region > > rootRegions() const override
Returns a set of root regions in the cache.
apache::geode::client::Cache
Caches are obtained from the create method on the CacheFactory#create class.
Definition: Cache.hpp:67
apache::geode::client::TypeRegistry
Registry for custom serializable types, both PDXSerializable and DataSerializable.
Definition: TypeRegistry.hpp:39
apache::geode::client::Cache::createRegionFactory
virtual RegionFactory createRegionFactory(RegionShortcut regionShortcut)
public methods
apache::geode::client::SystemProperties
The SystemProperties class.
Definition: SystemProperties.hpp:44
apache::geode::client::PdxInstanceFactory
PdxInstanceFactory gives you a way to create PdxInstances.
Definition: PdxInstanceFactory.hpp:52
apache::geode::client::Cache::close
virtual void close(bool keepalive)
Terminates this object cache and releases all the local resources.
apache::geode::client::Cache::createPdxInstanceFactory
PdxInstanceFactory createPdxInstanceFactory(const std::string &className) const override
Returns a factory that can create a PdxInstance.
apache::geode::client::Cache::initializeDeclarativeCache
void initializeDeclarativeCache(const std::string &cacheXml) override
Initializes the cache from an xml file.
apache::geode::client::Cache::getTypeRegistry
TypeRegistry & getTypeRegistry() const
Returns the type registry that this cache was created with.
GeodeCache.hpp
apache::geode::client::Cache::close
void close() override
Terminates this object cache and releases all the local resources.
apache::geode::client::DataOutput
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:48
apache::geode::client::FunctionService
entry point for function execution
Definition: FunctionService.hpp:45
apache::geode::client::Cache::createAuthenticatedView
virtual AuthenticatedView createAuthenticatedView(const std::shared_ptr< Properties > &userSecurityProperties, const std::string &poolName)
Creates an authenticated cache using the given user security properties.
apache::geode::client::Cache::readyForEvents
virtual void readyForEvents()
Send the "client ready" message to the server from a durable client.
apache::geode::client::Cache::getRegion
std::shared_ptr< Region > getRegion(const std::string &path) const override
Look up a region with the full path from root.
apache::geode::client::DataInput
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:59
apache::geode::client::RegionFactory
Provides for the configuration and creation of instances of Region.
Definition: RegionFactory.hpp:43
apache::geode::client::Cache::getPdxReadSerialized
bool getPdxReadSerialized() const override
Returns whether PdxInstance is preferred for PDX types instead of C++ object.
apache::geode::client::Cache::getCacheTransactionManager
virtual std::shared_ptr< CacheTransactionManager > getCacheTransactionManager() const
Get the CacheTransactionManager instance for this Cache.
apache::geode::client::Cache::getPdxIgnoreUnreadFields
bool getPdxIgnoreUnreadFields() const override
Returns whether Cache saves unread fields for Pdx types.
apache::geode::client::GeodeCache
GeodeCache represents the singleton cache that must be created in order to connect to Geode server.
Definition: GeodeCache.hpp:48
apache::geode::client::CacheFactory
Top level class for configuring and using Geode on a client.This should be called once to create Cach...
Definition: CacheFactory.hpp:48
apache::geode::client::Cache::isClosed
bool isClosed() const override
Indicates if this cache has been closed.
apache::geode::client::Cache::getName
const std::string & getName() const override
Returns the name of this cache.

Apache Geode C++ Cache API Documentation