VMware GemFire Native C++ Reference  9.1
AttributesFactory.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_ATTRIBUTESFACTORY_H_
4 #define GEODE_ATTRIBUTESFACTORY_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 "ExceptionTypes.hpp"
26 #include "ExpirationAction.hpp"
27 #include "CacheLoader.hpp"
28 #include "CacheWriter.hpp"
29 #include "CacheListener.hpp"
30 #include "PartitionResolver.hpp"
31 #include "RegionAttributes.hpp"
32 #include "DiskPolicyType.hpp"
33 #include "Pool.hpp"
34 
39 namespace apache {
40 namespace geode {
41 namespace client {
42 
156  public:
165 
172  AttributesFactory(const RegionAttributesPtr& regionAttributes);
173 
177  virtual ~AttributesFactory();
178 
179  // CALLBACKS
180 
184  void setCacheLoader(const CacheLoaderPtr& cacheLoader);
185 
189  void setCacheWriter(const CacheWriterPtr& cacheWriter);
190 
194  void setCacheListener(const CacheListenerPtr& aListener);
195 
200  void setPartitionResolver(const PartitionResolverPtr& aResolver);
201 
206  void setCacheLoader(const char* libpath, const char* factoryFuncName);
207 
213  void setCacheWriter(const char* libpath, const char* factoryFuncName);
214 
219  void setCacheListener(const char* libpath, const char* factoryFuncName);
220 
225  void setPartitionResolver(const char* libpath, const char* factoryFuncName);
226 
227  // EXPIRATION ATTRIBUTES
228 
234  void setEntryIdleTimeout(ExpirationAction::Action action,
235  int32_t idleTimeout);
236 
242  void setEntryTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
243 
249  void setRegionIdleTimeout(ExpirationAction::Action action,
250  int32_t idleTimeout);
251 
257  void setRegionTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
258 
259  // PERSISTENCE
267  void setPersistenceManager(const char* libpath, const char* factoryFuncName,
268  const PropertiesPtr& config = NULLPTR);
269 
275  void setPersistenceManager(const PersistenceManagerPtr& persistenceManager,
276  const PropertiesPtr& config = NULLPTR);
277 
278  public:
279  // DISTRIBUTION ATTRIBUTES
280 
281  // MAP ATTRIBUTES
288  void setInitialCapacity(int initialCapacity);
289 
296  void setLoadFactor(float loadFactor);
297 
303  void setConcurrencyLevel(uint8_t concurrencyLevel);
304 
311  void setLruEntriesLimit(const uint32_t entriesLimit);
312 
318  void setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
319 
329  void setCachingEnabled(bool cachingEnabled);
330 
348  void setPoolName(const char* name);
349 
355  void setCloningEnabled(bool isClonable);
356 
363  void setConcurrencyChecksEnabled(bool concurrencyChecksEnabled);
364 
365  // FACTORY METHOD
366 
372  RegionAttributesPtr createRegionAttributes();
373 
374  private:
375  RegionAttributes m_regionAttributes;
376  static void validateAttributes(RegionAttributes& attrs);
377 };
378 } // namespace client
379 } // namespace geode
380 } // namespace apache
381 
382 #endif // GEODE_ATTRIBUTESFACTORY_H_
PolicyType
Values for setting PolicyType.
Definition: DiskPolicyType.hpp:43
Creates instances of RegionAttributes.
Definition: AttributesFactory.hpp:152
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
Defines attributes for configuring a region.
Definition: RegionAttributes.hpp:72
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:52
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:40
Action
Definition: ExpirationAction.hpp:43
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation