00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _PARAMLIST_H
00030 #define _PARAMLIST_H
00031
00032
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00061 class SCParamList
00062 {
00063
00064 public:
00065 SCParamValue * _firstParamValue;
00066 SCParamValue * _lastParamValue;
00067 int _countParamValue;
00068
00069 protected:
00070 void AddParamValueFirst(SCParamValue* item);
00071 void AddParamValueLast(SCParamValue* item);
00072 void AddParamValueAfter(SCParamValue* item, SCParamValue* pos);
00073 void AddParamValueBefore(SCParamValue* item, SCParamValue* pos);
00074 void RemoveParamValue(SCParamValue* item);
00075 void ReplaceParamValue(SCParamValue* item, SCParamValue* newItem);
00076
00077 public:
00078 void DeleteAllParamValue();
00079 SCParamValue* GetFirstParamValue() const;
00080 SCParamValue* GetLastParamValue() const;
00081 SCParamValue* GetNextParamValue(SCParamValue* pos) const;
00082 SCParamValue* GetPrevParamValue(SCParamValue* pos) const;
00083 int GetParamValueCount() const;
00084 void MoveParamValueFirst(SCParamValue* item);
00085 void MoveParamValueLast(SCParamValue* item);
00086 void MoveParamValueAfter(SCParamValue* item, SCParamValue* pos);
00087 void MoveParamValueBefore(SCParamValue* item, SCParamValue* pos);
00088 void SortParamValue(int (*comp)(SCParamValue*, SCParamValue*));
00089
00090 class ParamValueIterator
00091 {
00092 private:
00093 SCParamValue* _refParamValue;
00094 SCParamValue* _prevParamValue;
00095 SCParamValue* _nextParamValue;
00096 const SCParamList* _iterParamList;
00097
00098 ParamValueIterator* _prev;
00099 ParamValueIterator* _next;
00100
00101 int (SCParamValue::*_method)() const;
00102
00103 static ParamValueIterator* _first;
00104 static ParamValueIterator* _last;
00105
00106 public:
00107 ParamValueIterator(const SCParamList* iterParamList,
00108 int (SCParamValue::*method)() const = 0,
00109 SCParamValue* refParamValue = 0);
00110 ParamValueIterator(const SCParamList& iterParamList,
00111 int (SCParamValue::*method)() const = 0,
00112 SCParamValue* refParamValue = 0);
00113 ParamValueIterator(const ParamValueIterator& iterator,
00114 int (SCParamValue::*method)() const = 0);
00115 ~ParamValueIterator();
00116
00117 ParamValueIterator& operator= (const ParamValueIterator& iterator)
00118 {
00119 _iterParamList = iterator._iterParamList;
00120 _refParamValue = iterator._refParamValue;
00121 _prevParamValue = iterator._prevParamValue;
00122 _nextParamValue = iterator._nextParamValue;
00123 _method = iterator._method;
00124 return *this;
00125 }
00126 SCParamValue* operator++ ()
00127 {
00128 _nextParamValue = _iterParamList->GetNextParamValue(_nextParamValue);
00129 if (_method != 0)
00130 {
00131 while (_nextParamValue && !(_nextParamValue->*_method)())
00132 _nextParamValue = _iterParamList->GetNextParamValue(_nextParamValue);
00133 }
00134 _refParamValue = _prevParamValue = _nextParamValue;
00135 return _refParamValue;
00136 }
00137 SCParamValue* operator-- ()
00138 {
00139 _prevParamValue = _iterParamList->GetPrevParamValue(_prevParamValue);
00140 if (_method != 0)
00141 {
00142 while (_prevParamValue && !(_prevParamValue->*_method)())
00143 _prevParamValue = _iterParamList->GetPrevParamValue(_prevParamValue);
00144 }
00145 _refParamValue = _nextParamValue = _prevParamValue;
00146 return _refParamValue;
00147 }
00148 operator SCParamValue*() { return _refParamValue; }
00149 SCParamValue* operator-> () { return _refParamValue; }
00150 SCParamValue* Get() { return _refParamValue; }
00151 void Reset() { _refParamValue = _prevParamValue = _nextParamValue = (SCParamValue*)0; }
00152
00153 int IsLast() { return (_iterParamList->GetLastParamValue() == _refParamValue); }
00154 int IsFirst() { return (_iterParamList->GetFirstParamValue() == _refParamValue); }
00155
00156 static void Check(SCParamValue* itemParamValue);
00157 static void Check(SCParamValue* itemParamValue, SCParamValue* newItemParamValue);
00158 };
00159
00160
00161
00162
00163
00164 private:
00165
00166 protected:
00167
00168 public:
00169
00170
00171 private:
00172 void ConstructorInclude();
00173 void DestructorInclude();
00174
00175 protected:
00176
00177 public:
00178 SCParamList(SCInterfaceMethod* pInterfaceMethod,
00179 DynamicAny::DynAnyFactory_ptr dynFact);
00180 virtual ~SCParamList();
00181 };
00182
00183 #endif
00184
00185
00186 #ifdef CB_INLINES
00187 #ifndef _PARAMLIST_H_INLINES
00188 #define _PARAMLIST_H_INLINES
00189
00190
00191
00192
00193 #endif
00194 #endif
00195