VMware GemFire Native C++ Reference  9.1
ExpirationAction.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_EXPIRATIONACTION_H_
4 #define GEODE_EXPIRATIONACTION_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 
29 namespace apache {
30 namespace geode {
31 namespace client {
39  // public static methods
40  public:
41  // types of action
42 
43  typedef enum {
45  INVALIDATE = 0,
48 
53 
55  INVALID_ACTION
56  } Action;
57 
61  static Action fromName(const char* name);
62 
67  inline static bool isInvalidate(const Action type) {
68  return (type == INVALIDATE);
69  }
70 
75  inline static bool isLocalInvalidate(const Action type) {
76  return (type == LOCAL_INVALIDATE);
77  }
78 
82  inline static bool isDestroy(const Action type) { return (type == DESTROY); }
83 
87  inline static bool isLocalDestroy(const Action type) {
88  return (type == LOCAL_DESTROY);
89  }
90 
94  inline static bool isLocal(const Action type) {
95  return (type == LOCAL_INVALIDATE) || (type == LOCAL_DESTROY);
96  }
97 
101  inline static bool isDistributed(const Action type) {
102  return (type == INVALIDATE) || (type == DESTROY);
103  }
104 
106  static const char* fromOrdinal(const int ordinal);
107 
108  private:
110  ~ExpirationAction();
111  static char* names[];
112 };
113 } // namespace client
114 } // namespace geode
115 } // namespace apache
116 
117 #endif // GEODE_EXPIRATIONACTION_H_
static bool isLocalInvalidate(const Action type)
Returns whether this is the action for local invalidate.
Definition: ExpirationAction.hpp:75
Enumerated type for expiration actions.
Definition: ExpirationAction.hpp:38
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
static bool isLocal(const Action type)
Returns whether this action is local.
Definition: ExpirationAction.hpp:94
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
static bool isInvalidate(const Action type)
Returns whether this is the action for distributed invalidate.
Definition: ExpirationAction.hpp:67
static bool isLocalDestroy(const Action type)
Returns whether this is the action for local destroy.
Definition: ExpirationAction.hpp:87
static bool isDistributed(const Action type)
Returns whether this action is distributed.
Definition: ExpirationAction.hpp:101
When expired, invalidated locally only.
Definition: ExpirationAction.hpp:47
When the region or cached object expires, it is destroyed.
Definition: ExpirationAction.hpp:50
static bool isDestroy(const Action type)
Returns whether this is the action for distributed destroy.
Definition: ExpirationAction.hpp:82
Action
Definition: ExpirationAction.hpp:43
When expired, destroyed locally only.
Definition: ExpirationAction.hpp:52
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation