VMware GemFire Native Client Cache Reference  9.0.6
RegionFactory.hpp
Go to the documentation of this file.
1 #ifndef __GEMFIRE_REGIONFACTORY_H__
2 #define __GEMFIRE_REGIONFACTORY_H__
3 /*=========================================================================
4  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
5  * This product is protected by U.S. and international copyright
6  * and intellectual property laws. Pivotal products are covered by
7  * more patents listed at http://www.pivotal.io/patents.
8  *========================================================================
9  */
10 
11 #include "gfcpp_globals.hpp"
12 #include "gf_types.hpp"
13 #include "AttributesFactory.hpp"
18 namespace gemfire {
19  class CacheImpl;
20 class CPPCACHE_EXPORT RegionFactory: public SharedBase{
21  public:
22 
23  /*
24  * To create the (@link Region}.
25  * @param name
26  * the name of the Region.
27  * @throws RegionExistsException if a region is already in
28  * this cache
29  * @throws CacheClosedException if the cache is closed
30  */
31  RegionPtr create(const char* name);
32 
37  RegionFactoryPtr setCacheLoader(const CacheLoaderPtr& cacheLoader);
38 
43  RegionFactoryPtr setCacheWriter(const CacheWriterPtr& cacheWriter);
44 
49  RegionFactoryPtr setCacheListener(const CacheListenerPtr& aListener);
50 
55  RegionFactoryPtr setPartitionResolver(const PartitionResolverPtr& aResolver);
56 
61  RegionFactoryPtr setCacheLoader(const char* libpath, const char* factoryFuncName);
62 
67  RegionFactoryPtr setCacheWriter(const char* libpath, const char* factoryFuncName);
68 
73  RegionFactoryPtr setCacheListener(const char* libpath, const char* factoryFuncName);
74 
79  RegionFactoryPtr setPartitionResolver(const char* libpath, const char* factoryFuncName);
80 
81  // EXPIRATION ATTRIBUTES
82 
89  RegionFactoryPtr setEntryIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
90 
97  RegionFactoryPtr setEntryTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
98 
99 
106  RegionFactoryPtr setRegionIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
107 
114  RegionFactoryPtr setRegionTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
115 
116  // PERSISTENCE
123  RegionFactoryPtr setPersistenceManager(const char* libpath, const char* factoryFuncName,
124  const PropertiesPtr& config = NULLPTR);
125 
130  RegionFactoryPtr setPersistenceManager(const PersistenceManagerPtr& persistenceManager,
131  const PropertiesPtr& config = NULLPTR);
132 
133  // MAP ATTRIBUTES
141  RegionFactoryPtr setInitialCapacity( int initialCapacity);
142 
150  RegionFactoryPtr setLoadFactor( float loadFactor);
151 
158  RegionFactoryPtr setConcurrencyLevel(uint8_t concurrencyLevel);
159 
168  RegionFactoryPtr setLruEntriesLimit( const uint32_t entriesLimit );
169 
175  RegionFactoryPtr setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
176 
186  RegionFactoryPtr setCachingEnabled( bool cachingEnabled );
187 
188  /*
189  * Set the PoolName to attach the Region with that Pool.
190  * Use only when Cache ha more than one Pool
191  * @param name
192  * the name of the Pool to which region will be attached.
193  * @return a reference to <code>this</code>
194  */
195  RegionFactoryPtr setPoolName( const char * name );
196 
197  /*
198  * Set boolean to enable/disable cloning while applying delta.
199  * @param isClonable whether to enable cloning or not.
200  * @return a reference to <code>this</code>
201  */
202  RegionFactoryPtr setCloningEnabled( bool isClonable );
203 
210  RegionFactoryPtr setConcurrencyChecksEnabled( bool enable );
211 
218  RegionFactoryPtr setTombstoneTimeout( uint32_t tombstoneTimeoutInMSec);
219 
220  private :
221  RegionFactory(gemfire::RegionShortcut preDefinedRegion);
222 
223  RegionShortcut m_preDefinedRegion;
224 
225  AttributesFactoryPtr m_attributeFactory;
226 
227  void setRegionShortcut();
228 
229  ~RegionFactory();
230  friend class CacheImpl;
231 };
232 }; //namespace gemfire
233 
234 #endif //ifndef __GEMFIRE_REGIONFACTORY_H__
Action
Definition: ExpirationAction.hpp:29
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
RegionShortcut
Definition: RegionShortcut.hpp:24
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
PolicyType
Values for setting PolicyType.
Definition: DiskPolicyType.hpp:29

GemFire C++ Cache API Documentation