build-artifacts/win/product/include/gfcpp/ScopeType.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_SCOPETYPE_H__
00002 #define __GEMFIRE_SCOPETYPE_H__
00003 /*=========================================================================
00004  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00005  * This product is protected by U.S. and international copyright
00006  * and intellectual property laws. Pivotal products are covered by
00007  * more patents listed at http://www.pivotal.io/patents.
00008  *========================================================================
00009  */
00010 
00014 #include "gfcpp_globals.hpp"
00015 #include <string.h>
00016 
00017 namespace gemfire {
00029 class CPPCACHE_EXPORT ScopeType {
00030      // public static methods
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 }; //namespace gemfire
00103 #endif //ifndef __GEMFIRE_SCOPETYPE_H__

GemFire C++ Cache API Documentation