VMware Tanzu GemFire Native C++ Reference 10.3.0
ExpirationAttributes.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_EXPIRATIONATTRIBUTES_H_
21#define GEODE_EXPIRATIONATTRIBUTES_H_
22
23#include <chrono>
24
25#include "ExpirationAction.hpp"
26#include "internal/geode_globals.hpp"
27
32namespace apache {
33namespace geode {
34namespace client {
50class APACHE_GEODE_EXPORT ExpirationAttributes {
54 public:
64
73 const std::chrono::seconds& expirationTime,
74 const ExpirationAction expirationAction = ExpirationAction::INVALIDATE);
75
81 const std::chrono::seconds& getTimeout() const;
82 void setTimeout(const std::chrono::seconds& timeout);
83
90 void setAction(const ExpirationAction& action);
91
92 private:
93 ExpirationAction m_action;
94 std::chrono::seconds m_timeout;
95};
96
97} // namespace client
98} // namespace geode
99} // namespace apache
100
101#endif // GEODE_EXPIRATIONATTRIBUTES_H_
ExpirationAction
ExpirationAction.hpp Enumerated type for expiration actions.
Definition: ExpirationAction.hpp:42
Immutable parameter object for accessing and setting the attributes associated with timeToLive and id...
Definition: ExpirationAttributes.hpp:50
const std::chrono::seconds & getTimeout() const
Returns the duration before a region or value expires.
ExpirationAction getAction() const
Returns the action that should take place when this value or region expires.
ExpirationAttributes(const std::chrono::seconds &expirationTime, const ExpirationAction expirationAction=ExpirationAction::INVALIDATE)
Constructs an ExpirationAttributes with the specified expiration time and expiration action.

Apache Geode C++ Cache API Documentation