VMware GemFire Native C++ Reference  9.1
RegionFactory.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_REGIONFACTORY_H_
4 #define GEODE_REGIONFACTORY_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include "geode_globals.hpp"
24 #include "geode_types.hpp"
25 #include "AttributesFactory.hpp"
30 namespace apache {
31 namespace geode {
32 namespace client {
33 class CacheImpl;
34 class CPPCACHE_EXPORT RegionFactory : public SharedBase {
35  public:
36  /*
37  * To create the (@link Region}.
38  * @param name
39  * the name of the Region.
40  * @throws RegionExistsException if a region is already in
41  * this cache
42  * @throws CacheClosedException if the cache is closed
43  */
44  RegionPtr create(const char* name);
45 
50  RegionFactoryPtr setCacheLoader(const CacheLoaderPtr& cacheLoader);
51 
56  RegionFactoryPtr setCacheWriter(const CacheWriterPtr& cacheWriter);
57 
62  RegionFactoryPtr setCacheListener(const CacheListenerPtr& aListener);
63 
69  RegionFactoryPtr setPartitionResolver(const PartitionResolverPtr& aResolver);
70 
76  RegionFactoryPtr setCacheLoader(const char* libpath,
77  const char* factoryFuncName);
78 
84  RegionFactoryPtr setCacheWriter(const char* libpath,
85  const char* factoryFuncName);
86 
92  RegionFactoryPtr setCacheListener(const char* libpath,
93  const char* factoryFuncName);
94 
100  RegionFactoryPtr setPartitionResolver(const char* libpath,
101  const char* factoryFuncName);
102 
103  // EXPIRATION ATTRIBUTES
104 
111  RegionFactoryPtr setEntryIdleTimeout(ExpirationAction::Action action,
112  int32_t idleTimeout);
113 
120  RegionFactoryPtr setEntryTimeToLive(ExpirationAction::Action action,
121  int32_t timeToLive);
122 
129  RegionFactoryPtr setRegionIdleTimeout(ExpirationAction::Action action,
130  int32_t idleTimeout);
131 
138  RegionFactoryPtr setRegionTimeToLive(ExpirationAction::Action action,
139  int32_t timeToLive);
140 
141  // PERSISTENCE
150  RegionFactoryPtr setPersistenceManager(const char* libpath,
151  const char* factoryFuncName,
152  const PropertiesPtr& config = NULLPTR);
153 
160  RegionFactoryPtr setPersistenceManager(
161  const PersistenceManagerPtr& persistenceManager,
162  const PropertiesPtr& config = NULLPTR);
163 
164  // MAP ATTRIBUTES
172  RegionFactoryPtr setInitialCapacity(int initialCapacity);
173 
181  RegionFactoryPtr setLoadFactor(float loadFactor);
182 
189  RegionFactoryPtr setConcurrencyLevel(uint8_t concurrencyLevel);
190 
199  RegionFactoryPtr setLruEntriesLimit(const uint32_t entriesLimit);
200 
207  RegionFactoryPtr setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
208 
220  RegionFactoryPtr setCachingEnabled(bool cachingEnabled);
221 
222  /*
223  * Set the PoolName to attach the Region with that Pool.
224  * Use only when Cache ha more than one Pool
225  * @param name
226  * the name of the Pool to which region will be attached.
227  * @return a reference to <code>this</code>
228  */
229  RegionFactoryPtr setPoolName(const char* name);
230 
231  /*
232  * Set boolean to enable/disable cloning while applying delta.
233  * @param isClonable whether to enable cloning or not.
234  * @return a reference to <code>this</code>
235  */
236  RegionFactoryPtr setCloningEnabled(bool isClonable);
237 
245  RegionFactoryPtr setConcurrencyChecksEnabled(bool enable);
246 
253  RegionFactoryPtr setTombstoneTimeout(uint32_t tombstoneTimeoutInMSec);
254 
255  private:
256  RegionFactory(apache::geode::client::RegionShortcut preDefinedRegion);
257 
258  RegionShortcut m_preDefinedRegion;
259 
260  AttributesFactoryPtr m_attributeFactory;
261 
262  void setRegionShortcut();
263 
264  ~RegionFactory();
265  friend class CacheImpl;
266 };
267 } // namespace client
268 } // namespace geode
269 } // namespace apache
270 
271 #endif // GEODE_REGIONFACTORY_H_
PolicyType
Values for setting PolicyType.
Definition: DiskPolicyType.hpp:43
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
Action
Definition: ExpirationAction.hpp:43
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation