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

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_EXPIRATIONACTION_H__
00002 #define __GEMFIRE_EXPIRATIONACTION_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 
00011 #include "gfcpp_globals.hpp"
00012 
00017 namespace gemfire {
00024 class CPPCACHE_EXPORT ExpirationAction {
00025      //public static methods
00026  public:
00027      // types of action
00028 
00029    typedef enum { 
00031      INVALIDATE = 0,
00033      LOCAL_INVALIDATE,
00034     
00036      DESTROY,
00038      LOCAL_DESTROY,
00039 
00041      INVALID_ACTION } Action;
00042     
00046     static Action fromName(const char* name) ;
00047     
00052     inline static bool isInvalidate(const Action type) 
00053     {
00054         return (type==INVALIDATE);
00055     }
00056     
00061     inline static bool isLocalInvalidate(const Action type) 
00062     {
00063         return (type==LOCAL_INVALIDATE);
00064     }
00065     
00069     inline static bool isDestroy(const Action type) 
00070     {
00071         return (type==DESTROY);
00072     }
00073     
00077     inline static bool isLocalDestroy(const Action type)
00078     {
00079         return (type==LOCAL_DESTROY);
00080     }
00081     
00085     inline static bool isLocal(const Action type)
00086     {
00087         return (type == LOCAL_INVALIDATE) || (type==LOCAL_DESTROY);
00088     }
00089     
00093     inline static bool isDistributed(const Action type) 
00094     {
00095         return (type == INVALIDATE) || (type==DESTROY);
00096     }
00097         
00099     static const char*  fromOrdinal(const int ordinal) ;
00100 
00101     private:
00102     ExpirationAction();
00103     ~ExpirationAction();
00104     static  char*  names[] ; 
00105 };
00106 }; //namespace gemfire
00107 #endif //ifndef __GEMFIRE_EXPIRATIONACTION_H__

GemFire C++ Cache API Documentation