Pivotal GemFire Native Client Cache Reference  9.0.6
ScopeType.hpp
Go to the documentation of this file.
1 #ifndef __GEMFIRE_SCOPETYPE_H__
2 #define __GEMFIRE_SCOPETYPE_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 
14 #include "gfcpp_globals.hpp"
15 #include <string.h>
16 
17 namespace gemfire {
30  // public static methods
31  public:
35  typedef enum {
36  LOCAL = 0,
37  DISTRIBUTED_NO_ACK ,
38  DISTRIBUTED_ACK ,
39  GLOBAL ,
40  INVALID} Scope;
41 
42 
44  static const char* fromOrdinal(const uint8_t ordinal) ;
45 
47  static Scope fromName(const char* name) ;
48 
52  inline static bool isLocal(const Scope type)
53  {
54  return (type == ScopeType::LOCAL);
55  }
56 
60  inline static bool isDistributed(const Scope type)
61  {
62  return (type != ScopeType::LOCAL);
63  }
64 
68  inline static bool isDistributedNoAck(const Scope type)
69  {
70  return (type == ScopeType::DISTRIBUTED_NO_ACK);
71  }
72 
76  inline static bool isDistributedAck(const Scope type)
77  {
78  return (type == ScopeType::DISTRIBUTED_ACK);
79  }
80 
84  inline static bool isGlobal(const Scope type)
85  {
86  return (type == ScopeType::GLOBAL);
87  }
88 
92  inline static bool isAck(const Scope type)
93  {
94  return (type == ScopeType::GLOBAL || type == ScopeType::DISTRIBUTED_ACK);
95  }
96 
97  private:
99  ScopeType() {};
100  static char* names[];
101 };
102 }; //namespace gemfire
103 #endif //ifndef __GEMFIRE_SCOPETYPE_H__
static bool isLocal(const Scope type)
Returns whether this is local scope.
Definition: ScopeType.hpp:52
static bool isDistributed(const Scope type)
Returns whether this is one of the distributed scopes.
Definition: ScopeType.hpp:60
static bool isAck(const Scope type)
Returns whether acknowledgements are required for this scope.
Definition: ScopeType.hpp:92
Distribute with full interprocess synchronization – not yet implemented.
Definition: ScopeType.hpp:39
static bool isDistributedAck(const Scope type)
Returns whether this is distributed ack scope.
Definition: ScopeType.hpp:76
Distribute without waiting for acknowledgement.
Definition: ScopeType.hpp:37
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
static bool isGlobal(const Scope type)
Returns whether this is global scope.
Definition: ScopeType.hpp:84
Distribute and wait for all peers to acknowledge.
Definition: ScopeType.hpp:38
static bool isDistributedNoAck(const Scope type)
Returns whether this is distributed no ack scope.
Definition: ScopeType.hpp:68
A LOCAL region only has local state and never sends operations to a server.
Definition: RegionShortcut.hpp:49
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
no distribution.
Definition: ScopeType.hpp:36
Scope
Values for setting Scope.
Definition: ScopeType.hpp:35
Enumerated type for region distribution scope.
Definition: ScopeType.hpp:29

GemFire C++ Cache API Documentation