VMware Tanzu GemFire Native C++ Reference 10.2.7
AttributesMutator.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_ATTRIBUTESMUTATOR_H_
21#define GEODE_ATTRIBUTESMUTATOR_H_
22
23#include <chrono>
24#include <iosfwd>
25#include <memory>
26#include <string>
27
28#include "ExpirationAction.hpp"
29#include "internal/geode_globals.hpp"
30
35namespace apache {
36namespace geode {
37namespace client {
38
39class CacheListener;
40class CacheLoader;
41class CacheWriter;
42class Region;
43
61class APACHE_GEODE_EXPORT AttributesMutator {
62 private:
63 std::shared_ptr<Region> m_region;
64
65 public:
68 explicit AttributesMutator(const std::shared_ptr<Region>& region);
69
70 virtual ~AttributesMutator();
71
79 std::chrono::seconds setEntryIdleTimeout(std::chrono::seconds idleTimeout);
80
87
95 std::chrono::seconds setEntryTimeToLive(std::chrono::seconds timeToLive);
96
103
111 std::chrono::seconds setRegionIdleTimeout(std::chrono::seconds idleTimeout);
112
118
126 std::chrono::seconds setRegionTimeToLive(std::chrono::seconds timeToLive);
127
133
140 uint32_t setLruEntriesLimit(uint32_t entriesLimit);
141
147 void setCacheListener(const std::shared_ptr<CacheListener>& aListener);
148
157 void setCacheListener(const std::string& libpath,
158 const std::string& factoryFuncName);
159
165 void setCacheLoader(const std::shared_ptr<CacheLoader>& aLoader);
166
174 void setCacheLoader(const std::string& libpath,
175 const std::string& factoryFuncName);
176
182 void setCacheWriter(const std::shared_ptr<CacheWriter>& aWriter);
183
191 void setCacheWriter(const std::string& libpath,
192 const std::string& factoryFuncName);
193};
194
195} // namespace client
196} // namespace geode
197} // namespace apache
198
199#endif // GEODE_ATTRIBUTESMUTATOR_H_
ExpirationAction
ExpirationAction.hpp Enumerated type for expiration actions.
Definition: ExpirationAction.hpp:42
Supports modification of certain region attributes after the region has been created.
Definition: AttributesMutator.hpp:61
ExpirationAction setEntryTimeToLiveAction(ExpirationAction action)
Set the timeToLive Action for region entries.
void setCacheLoader(const std::shared_ptr< CacheLoader > &aLoader)
Sets cache loader for region.
std::chrono::seconds setRegionIdleTimeout(std::chrono::seconds idleTimeout)
Sets the idleTimeout duration for the region itself.
void setCacheWriter(const std::shared_ptr< CacheWriter > &aWriter)
Sets cache writer for region.
std::chrono::seconds setEntryTimeToLive(std::chrono::seconds timeToLive)
Sets the timeToLive duration for region entries.
void setCacheListener(const std::string &libpath, const std::string &factoryFuncName)
Sets cache listener for region.
ExpirationAction setRegionTimeToLiveAction(ExpirationAction action)
Set the timeToLive Action for the region itself.
void setCacheWriter(const std::string &libpath, const std::string &factoryFuncName)
Sets cache writer for region.
ExpirationAction setRegionIdleTimeoutAction(ExpirationAction action)
Set the idleTimeout Action for the region itself.
void setCacheListener(const std::shared_ptr< CacheListener > &aListener)
Sets cache listener for region.
AttributesMutator(const std::shared_ptr< Region > &region)
Internal constructor.
uint32_t setLruEntriesLimit(uint32_t entriesLimit)
Sets the Maximum entry count in the region before LRU eviction.
std::chrono::seconds setEntryIdleTimeout(std::chrono::seconds idleTimeout)
Sets the idleTimeout duration for region entries.
std::chrono::seconds setRegionTimeToLive(std::chrono::seconds timeToLive)
Sets the timeToLive duration for the region itself.
ExpirationAction setEntryIdleTimeoutAction(ExpirationAction action)
Set the idleTimeout Action for region entries.
void setCacheLoader(const std::string &libpath, const std::string &factoryFuncName)
Sets cache loader for region.

Apache Geode C++ Cache API Documentation