/export/rook1/users/build/gfcppsancout64/product/include/gfcpp/ExpirationAction.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_EXPIRATIONACTION_H__
00002 #define __GEMFIRE_EXPIRATIONACTION_H__
00003 /*=========================================================================
00004  * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.
00005  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00006  *========================================================================
00007  */
00008 
00009 #include "gfcpp_globals.hpp"
00010 
00015 namespace gemfire {
00022 class CPPCACHE_EXPORT ExpirationAction {
00023      //public static methods
00024  public:
00025      // types of action
00026 
00027    typedef enum { 
00029      INVALIDATE = 0,
00031      LOCAL_INVALIDATE,
00032     
00034      DESTROY,
00036      LOCAL_DESTROY,
00037 
00039      INVALID_ACTION } Action;
00040     
00044     static Action fromName(const char* name) ;
00045     
00050     inline static bool isInvalidate(const Action type) 
00051     {
00052         return (type==INVALIDATE);
00053     }
00054     
00059     inline static bool isLocalInvalidate(const Action type) 
00060     {
00061         return (type==LOCAL_INVALIDATE);
00062     }
00063     
00067     inline static bool isDestroy(const Action type) 
00068     {
00069         return (type==DESTROY);
00070     }
00071     
00075     inline static bool isLocalDestroy(const Action type)
00076     {
00077         return (type==LOCAL_DESTROY);
00078     }
00079     
00083     inline static bool isLocal(const Action type)
00084     {
00085         return (type == LOCAL_INVALIDATE) || (type==LOCAL_DESTROY);
00086     }
00087     
00091     inline static bool isDistributed(const Action type) 
00092     {
00093         return (type == INVALIDATE) || (type==DESTROY);
00094     }
00095         
00097     static const char*  fromOrdinal(const int ordinal) ;
00098 
00099     private:
00100     ExpirationAction();
00101     ~ExpirationAction();
00102     static  char*  names[] ; 
00103 };
00104 }; //namespace gemfire
00105 #endif //ifndef __GEMFIRE_EXPIRATIONACTION_H__

GemFire C++ Cache API Documentation