00001 #ifndef __rmControl_
00002 #define __rmControl_
00003
00004 #include "ResourceMonitor/ResourceMonitorTypes.h"
00005 #include "rmRefArray.h"
00006 #include "rmClientTypes.h"
00007
00031 struct GenericControl
00032 {
00033 long thresholdControlId;
00034 long leakyBucketControlId;
00035 rmMonitorControl control;
00036 long refCnt;
00037 int status;
00038
00039 };
00040
00058 struct ThresholdControl
00059 {
00060 rmThresholdControl control;
00061 long refCnt;
00062 int status;
00063
00064 };
00065
00066 struct WatermarkControl
00067 {
00068
00069 long refCnt;
00070 int status;
00071
00072 };
00073
00074 struct LeakyBucketControl
00075 {
00076 rmLeakyBucketControl control;
00077 long refCnt;
00078 int status;
00079 };
00080
00086 class rmThresholdMonitorControl;
00087 class rmLeakyBucketMonitorControl;
00088
00089 class rmGenericMonitorControl : public rmRefArray<GenericControl>
00090 {
00091 public:
00092 rmGenericMonitorControl(rmThresholdMonitorControl * aThresholdControl,
00093 rmLeakyBucketMonitorControl * aLeakyBucketControl) :
00094 mThresholdControl(aThresholdControl),
00095 mLeakyBucketControl(aLeakyBucketControl) {}
00096
00097 virtual ~rmGenericMonitorControl(){}
00098
00100 virtual int removeElement(unsigned long aID);
00101
00102 virtual bool elementIsReady(const GenericControl & aElement) const;
00103
00104 virtual int getInteger32(RMAttribute aName, unsigned long aID, long & aValue);
00105 virtual int setInteger32(RMAttribute aName, unsigned long aID, long aValue);
00106
00107 virtual int getUnsigned(RMAttribute aName, unsigned long aID, unsigned long & aValue);
00108 virtual int setUnsigned(RMAttribute aName, unsigned long aID, unsigned long aValue);
00109
00110 virtual int getUUIDString(RMAttribute aName, unsigned long aID, char * aUUIDStr);
00111 virtual int setUUIDString(RMAttribute aName, unsigned long aID, char * aUUIDStr);
00112
00113 virtual int getUUID(RMAttribute aName, unsigned long aID, uuid_t aUUID);
00114
00115 virtual long addRef(unsigned long aID);
00116
00117 private:
00118 rmThresholdMonitorControl * mThresholdControl;
00119 rmLeakyBucketMonitorControl * mLeakyBucketControl;
00120 };
00121
00127 class rmThresholdMonitorControl : public rmRefArray<ThresholdControl>
00128 {
00129 public:
00130 rmThresholdMonitorControl(){}
00131 virtual ~rmThresholdMonitorControl(){}
00132
00133 virtual bool elementIsReady(const ThresholdControl & aElement) const;
00134
00135 virtual int getInteger32(RMAttribute aName, unsigned long aID, long & aValue);
00136 virtual int setInteger32(RMAttribute aName, unsigned long aID, long aValue);
00137
00138 virtual int getUnsigned(RMAttribute aName, unsigned long aID, unsigned long & aValue);
00139 virtual int setUnsigned(RMAttribute aName, unsigned long aID, unsigned long aValue);
00140
00141 virtual int getUnsigned64(RMAttribute aName, unsigned long aID, u_int64_t & aValue);
00142 virtual int setUnsigned64(RMAttribute aName, unsigned long aID, u_int64_t aValue);
00143
00144 private:
00145 };
00146
00147 class rmLeakyBucketMonitorControl : public rmRefArray<LeakyBucketControl>
00148 {
00149 public:
00150 rmLeakyBucketMonitorControl(){}
00151 virtual ~rmLeakyBucketMonitorControl(){}
00152
00153 virtual bool elementIsReady(const LeakyBucketControl & aElement) const;
00154
00155 virtual int getInteger32(RMAttribute aName, unsigned long aID, long & aValue);
00156 virtual int setInteger32(RMAttribute aName, unsigned long aID, long aValue);
00157
00158 virtual int getUnsigned(RMAttribute aName, unsigned long aID, unsigned long & aValue);
00159 virtual int setUnsigned(RMAttribute aName, unsigned long aID, unsigned long aValue);
00160
00161 private:
00162 };
00163
00164
00165 #endif // __rmControl_