policyHelper.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef POLICYHELPER_H
00009 #define POLICYHELPER_H
00010 
00011 #include <cadef.h>
00012 #include "helper.h"
00013 #include "defines.h"
00014 #include "hashConduit.h"
00015 #include "hashConduitGroup.h"
00016 #include "conduitFriends.h"
00017 
00018 class PolicyHelper : Helper
00019 {
00020 private:
00021     CAFEStatus cafeStatus;
00022     cafeConduit_set::iterator itcs;
00023                 cafeGroup_set::iterator itgs;
00024 public:
00025     PolicyHelper(){};
00026     ~PolicyHelper(){};
00027 
00028         int  getChannelGetActionWhenMonitorPolicy(unsigned int _handle, ChannelGetActionWhenMonitorPolicy & awmp);
00029         int  setChannelGetActionWhenMonitorPolicy(unsigned int _handle, ChannelGetActionWhenMonitorPolicy awmp);
00030         int  setChannelGetActionWhenMonitorPolicy(ChannelGetActionWhenMonitorPolicy awmp);
00031         int  setChannelGetActionWhenMonitorPolicyAllHandles(ChannelGetActionWhenMonitorPolicy awmp){
00032                 return  setChannelGetActionWhenMonitorPolicy(awmp);}
00033 
00034         int  getChannelGetCacheWaitPolicy(unsigned int  _handle, ChannelGetCacheWaitPolicy & cwp);
00035         int  setChannelGetCacheWaitPolicy(unsigned int  _handle, ChannelGetCacheWaitPolicy  cwp);
00036         int  setChannelGetCacheWaitPolicy(ChannelGetCacheWaitPolicy  cwp);
00037         int  setChannelGetCacheWaitPolicyAllHandles(ChannelGetCacheWaitPolicy  cwp){
00038                 return  setChannelGetCacheWaitPolicy(cwp);}
00039 
00040     int  getChannelRequestDataTypePolicy(unsigned int  _handle, ChannelRequestDataTypePolicy &crdtp);
00041     int  setChannelRequestDataTypePolicy(unsigned int  _handle, ChannelRequestDataTypePolicy crdtp);
00042     int  setChannelRequestDataTypePolicy(ChannelRequestDataTypePolicy crdtp);
00043           int  setChannelRequestDataTypePolicyAllHandles(ChannelRequestDataTypePolicy crdtp){
00044                                                                                                                                         return  setChannelRequestDataTypePolicy(crdtp);}
00045 
00046     int  getChannelRequestPolicyGet (unsigned int  _handle, ChannelRequestPolicy & crpg);
00047     int  setChannelRequestPolicyGet (unsigned int  _handle, ChannelRequestPolicy crpg);
00048     int  setChannelRequestPolicyGet (ChannelRequestPolicy crpg);
00049           int  setChannelRequestPolicyGetAllHandles (ChannelRequestPolicy crpg) {return setChannelRequestPolicyGet (crpg);}
00050         
00051     int  getChannelRequestPolicyPut (unsigned int  _handle, ChannelRequestPolicy & crpp);
00052     int  setChannelRequestPolicyPut (unsigned int  _handle, ChannelRequestPolicy crpp);
00053     int  setChannelRequestPolicyPut (ChannelRequestPolicy crpp);
00054           int  setChannelRequestPolicyPutAllHandles (ChannelRequestPolicy crpp) {return setChannelRequestPolicyPut (crpp);}
00055 
00056     int  getChannelTimeoutPolicyGet (unsigned int  _handle, ChannelTimeoutPolicy & ctpg);
00057     int  setChannelTimeoutPolicyGet (unsigned int  _handle, ChannelTimeoutPolicy ctpg);
00058 
00059     int  getChannelTimeoutPolicyPut (unsigned int  _handle, ChannelTimeoutPolicy & ctpp);
00060     int  setChannelTimeoutPolicyPut (unsigned int  _handle, ChannelTimeoutPolicy ctpp);
00061 
00062 
00063         int  setSelfGoverningTimeout(bool b);
00064         int  setSelfGoverningTimeout(unsigned int _handle, bool b);
00065         int  setSelfGoverningTimeoutPut(unsigned int _handle, bool p);
00066         int  setSelfGoverningTimeoutGet(unsigned int _handle, bool g);
00067         int  getSelfGoverningTimeout(unsigned int _handle, bool &p, bool &g);
00068 
00069         int  setSGSelfGoverningTimeout(bool b);
00070         int  setSGSelfGoverningTimeout(unsigned int _handle, bool b);
00071         int  setSGSelfGoverningTimeoutPut(unsigned int _handle, bool p);
00072         int  setSGSelfGoverningTimeoutGet(unsigned int _handle, bool g);
00073         int  getSGSelfGoverningTimeout(unsigned int _handle, bool &p, bool &g);
00074 
00075 
00076     //Short cuts
00077     //put, get, put, get
00078     int  getTimeoutRange (double &p, double &p2, double &g, double &g2) { int  stp; int  stg;
00079             stp=getTimeoutMin(p,g);  stg=getTimeoutMax(p2, g2);
00080             if (stp!=ICAFE_NORMAL){return stp;} else if(stg!=ICAFE_NORMAL){return stg;}
00081             else {return ICAFE_NORMAL;}
00082     };
00083 
00084     int  getTimeoutMin (double &p, double &g);
00085     int  getTimeoutMax (double &p, double &g);
00086 
00087     int  getTimeout (unsigned int  _handle, double &p, double &g);
00088     //returns lesser of the two
00089     int  getTimeout (unsigned int  _handle, double &pg) {double p; double g; int  st;
00090                      st=getTimeout(_handle, p, g); pg=std::min(p,g); return st;}
00091     int  getTimeoutPut(unsigned int  _handle, double &p) {double g; return getTimeout(_handle, p, g);}
00092     int  getTimeoutGet(unsigned int  _handle, double &g) {double p; return getTimeout(_handle, p, g);}
00093 
00094     int  printTimeout ();
00095     int  printTimeout (unsigned int  _handle);
00096 
00097     int  setTimeout   (double p, double g); // for all handles put and get separately
00098     int  setTimeout   (double pg){return setTimeout(pg, pg);};
00099     int  setTimeoutPut(double p) {return setTimeout(p, (double) NULL);};
00100     int  setTimeoutGet(double g) {return setTimeout((double) NULL, g);};
00101 
00102     int  setTimeout   (unsigned int  _handle, double p, double g);
00103     int  setTimeout   (unsigned int  _handle, double pg){return setTimeout(_handle, pg, pg); };
00104     int  setTimeoutPut(unsigned int  _handle, double p) {return setTimeout(_handle, p, (double) NULL);};
00105     int  setTimeoutGet(unsigned int  _handle, double g) {return setTimeout(_handle, (double) NULL, g);};
00106     int  setTimeoutToDefault(unsigned int  _handle);
00107                 int  setTimeoutToDefault(); 
00108 
00109  
00110 
00111           //get SGTimeout
00112                 int  getSGTimeoutRange (double &p, double &p2, double &g, double &g2) { int  stp; int  stg;
00113             stp=getSGTimeoutMin(p,g);  stg=getSGTimeoutMax(p2, g2);
00114             if (stp!=ICAFE_NORMAL){return stp;} else if(stg!=ICAFE_NORMAL){return stg;}
00115             else {return ICAFE_NORMAL;}
00116     };
00117                 
00118                 int  getSGTimeoutMin (double &p, double &g);
00119     int  getSGTimeoutMax (double &p, double &g);   
00120                 int  printSGTimeout ();
00121     int  printSGTimeout (unsigned int  _handle);         
00122                          
00123                         
00124     int  getSGTimeout (unsigned int  _handle, double &p, double &g);
00125     //returns lesser of the two
00126     int  getSGTimeout (unsigned int  _handle, double &pg) {double p; double g; int  st;
00127                      st=getSGTimeout(_handle, p, g); pg=std::min(p,g); return st;}
00128     int  getSGTimeoutPut(unsigned int  _handle, double &p) {double g; return getSGTimeout(_handle, p, g);}
00129     int  getSGTimeoutGet(unsigned int  _handle, double &g) {double p; return getSGTimeout(_handle, p, g);}
00130 
00131 
00132                 //set SGTimeout
00133                 int  setSGTimeout   (double p, double g); // for all group handles put and get separately
00134     int  setSGTimeout   (double pg){return setSGTimeout(pg, pg);};
00135     int  setSGTimeoutPut(double p) {return setSGTimeout(p, (double) NULL);};
00136     int  setSGTimeoutGet(double g) {return setSGTimeout((double) NULL, g);};
00137                 int  setSGTimeout   (unsigned int  _gHandle, double p, double g);
00138     int  setSGTimeout   (unsigned int  _gHandle, double pg){return setSGTimeout(_gHandle, pg, pg); };
00139     int  setSGTimeoutPut(unsigned int  _gHandle, double p) {return setSGTimeout(_gHandle, p, (double) NULL);};
00140     int  setSGTimeoutGet(unsigned int  _gHandle, double g) {return setSGTimeout(_gHandle, (double) NULL, g);};
00141 
00142     int  setSGTimeoutToDefault(unsigned int  _handle);
00143                 int  setSGTimeoutToDefault();
00144 
00145 
00146 };
00147 #endif

Generated on 3 May 2017 for CAFE by  doxygen 1.6.1