VMware Tanzu GemFire Native C++ Reference  10.1.5
CacheFactory.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_CACHEFACTORY_H_
21 #define GEODE_CACHEFACTORY_H_
22 
23 #include <string>
24 
25 #include "Cache.hpp"
26 #include "PoolFactory.hpp"
27 #include "internal/geode_globals.hpp"
28 
33 namespace apache {
34 namespace geode {
35 namespace client {
36 
37 class CppCacheLibrary;
38 class AuthInitialize;
39 
48 class APACHE_GEODE_EXPORT CacheFactory {
49  public:
53  CacheFactory() noexcept;
54 
60  explicit CacheFactory(const std::shared_ptr<Properties>& properties) noexcept;
61 
62  ~CacheFactory() = default;
63 
67  Cache create() const;
68 
73  static const std::string& getVersion();
74 
77  static const std::string& getProductDescription();
78 
100  CacheFactory& setPdxIgnoreUnreadFields(bool ignore);
101 
108  CacheFactory& setAuthInitialize(
109  const std::shared_ptr<AuthInitialize>& authInitialize);
110 
129  CacheFactory& setPdxReadSerialized(bool pdxReadSerialized);
130 
138  CacheFactory& set(std::string name, std::string value);
139 
140  private:
141  std::shared_ptr<Properties> dsProp;
142  bool ignorePdxUnreadFields;
143  bool pdxReadSerialized;
144  std::shared_ptr<AuthInitialize> authInitialize;
145 
146  friend class CppCacheLibrary;
147  friend class RegionFactory;
148  friend class RegionXmlCreation;
149  friend class CacheXmlCreation;
150 };
151 
152 } // namespace client
153 } // namespace geode
154 } // namespace apache
155 
156 #endif // GEODE_CACHEFACTORY_H_
apache::geode::client::Properties
Contains a set of (key, value) pair properties with key being the name of the property; value,...
Definition: Properties.hpp:52
apache::geode::client::Cache
Caches are obtained from the create method on the CacheFactory#create class.
Definition: Cache.hpp:67
apache::geode::client::AuthInitialize
Specifies the mechanism to obtain credentials for a client.
Definition: AuthInitialize.hpp:49
PoolFactory.hpp
apache::geode::client::RegionFactory
Provides for the configuration and creation of instances of Region.
Definition: RegionFactory.hpp:43
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
Cache.hpp
apache::geode::client::CacheFactory::CacheFactory
CacheFactory() noexcept
To create the instance of CacheFactory.

Apache Geode C++ Cache API Documentation