00001 #ifndef __GEMFIRE_SCOPETYPE_H__
00002 #define __GEMFIRE_SCOPETYPE_H__
00003
00004
00005
00006
00007
00008
00012 #include "gfcpp_globals.hpp"
00013 #include <string.h>
00014
00015 namespace gemfire {
00029 class CPPCACHE_EXPORT ScopeType {
00030
00031 public:
00035 typedef enum {
00036 LOCAL = 0,
00037 DISTRIBUTED_NO_ACK ,
00038 DISTRIBUTED_ACK ,
00039 GLOBAL ,
00040 INVALID} Scope;
00041
00042
00044 static const char* fromOrdinal(const uint8_t ordinal) ;
00045
00047 static Scope fromName(const char* name) ;
00048
00052 inline static bool isLocal(const Scope type)
00053 {
00054 return (type == ScopeType::LOCAL);
00055 }
00056
00060 inline static bool isDistributed(const Scope type)
00061 {
00062 return (type != ScopeType::LOCAL);
00063 }
00064
00068 inline static bool isDistributedNoAck(const Scope type)
00069 {
00070 return (type == ScopeType::DISTRIBUTED_NO_ACK);
00071 }
00072
00076 inline static bool isDistributedAck(const Scope type)
00077 {
00078 return (type == ScopeType::DISTRIBUTED_ACK);
00079 }
00080
00084 inline static bool isGlobal(const Scope type)
00085 {
00086 return (type == ScopeType::GLOBAL);
00087 }
00088
00092 inline static bool isAck(const Scope type)
00093 {
00094 return (type == ScopeType::GLOBAL || type == ScopeType::DISTRIBUTED_ACK);
00095 }
00096
00097 private:
00099 ScopeType() {};
00100 static char* names[];
00101 };
00102 };
00103 #endif //ifndef __GEMFIRE_SCOPETYPE_H__