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
00030
00031
00032
00033
00034
00035 #ifndef _INTERFACEMETHOD_H
00036 #define _INTERFACEMETHOD_H
00037
00038
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00067 class SCInterfaceMethod
00068 {
00069
00070 public:
00071 SCMethParam * _firstMethParam;
00072 SCMethParam * _lastMethParam;
00073 int _countMethParam;
00074
00075 protected:
00076 void AddMethParamFirst(SCMethParam* item);
00077 void AddMethParamLast(SCMethParam* item);
00078 void AddMethParamAfter(SCMethParam* item, SCMethParam* pos);
00079 void AddMethParamBefore(SCMethParam* item, SCMethParam* pos);
00080 void RemoveMethParam(SCMethParam* item);
00081 void ReplaceMethParam(SCMethParam* item, SCMethParam* newItem);
00082
00083 public:
00084 void DeleteAllMethParam();
00085 SCMethParam* GetFirstMethParam() const;
00086 SCMethParam* GetLastMethParam() const;
00087 SCMethParam* GetNextMethParam(SCMethParam* pos) const;
00088 SCMethParam* GetPrevMethParam(SCMethParam* pos) const;
00089 int GetMethParamCount() const;
00090 void MoveMethParamFirst(SCMethParam* item);
00091 void MoveMethParamLast(SCMethParam* item);
00092 void MoveMethParamAfter(SCMethParam* item, SCMethParam* pos);
00093 void MoveMethParamBefore(SCMethParam* item, SCMethParam* pos);
00094 void SortMethParam(int (*comp)(SCMethParam*, SCMethParam*));
00095
00096 class MethParamIterator
00097 {
00098 private:
00099 SCMethParam* _refMethParam;
00100 SCMethParam* _prevMethParam;
00101 SCMethParam* _nextMethParam;
00102 const SCInterfaceMethod* _iterInterfaceMethod;
00103
00104 MethParamIterator* _prev;
00105 MethParamIterator* _next;
00106
00107 int (SCMethParam::*_method)() const;
00108
00109 static MethParamIterator* _first;
00110 static MethParamIterator* _last;
00111
00112 public:
00113 MethParamIterator(const SCInterfaceMethod* iterInterfaceMethod,
00114 int (SCMethParam::*method)() const = 0,
00115 SCMethParam* refMethParam = 0);
00116 MethParamIterator(const SCInterfaceMethod& iterInterfaceMethod,
00117 int (SCMethParam::*method)() const = 0,
00118 SCMethParam* refMethParam = 0);
00119 MethParamIterator(const MethParamIterator& iterator,
00120 int (SCMethParam::*method)() const = 0);
00121 ~MethParamIterator();
00122
00123 MethParamIterator& operator= (const MethParamIterator& iterator)
00124 {
00125 _iterInterfaceMethod = iterator._iterInterfaceMethod;
00126 _refMethParam = iterator._refMethParam;
00127 _prevMethParam = iterator._prevMethParam;
00128 _nextMethParam = iterator._nextMethParam;
00129 _method = iterator._method;
00130 return *this;
00131 }
00132 SCMethParam* operator++ ()
00133 {
00134 _nextMethParam = _iterInterfaceMethod->GetNextMethParam(_nextMethParam);
00135 if (_method != 0)
00136 {
00137 while (_nextMethParam && !(_nextMethParam->*_method)())
00138 _nextMethParam = _iterInterfaceMethod->GetNextMethParam(_nextMethParam);
00139 }
00140 _refMethParam = _prevMethParam = _nextMethParam;
00141 return _refMethParam;
00142 }
00143 SCMethParam* operator-- ()
00144 {
00145 _prevMethParam = _iterInterfaceMethod->GetPrevMethParam(_prevMethParam);
00146 if (_method != 0)
00147 {
00148 while (_prevMethParam && !(_prevMethParam->*_method)())
00149 _prevMethParam = _iterInterfaceMethod->GetPrevMethParam(_prevMethParam);
00150 }
00151 _refMethParam = _nextMethParam = _prevMethParam;
00152 return _refMethParam;
00153 }
00154 operator SCMethParam*() { return _refMethParam; }
00155 SCMethParam* operator-> () { return _refMethParam; }
00156 SCMethParam* Get() { return _refMethParam; }
00157 void Reset() { _refMethParam = _prevMethParam = _nextMethParam = (SCMethParam*)0; }
00158
00159 int IsLast() { return (_iterInterfaceMethod->GetLastMethParam() == _refMethParam); }
00160 int IsFirst() { return (_iterInterfaceMethod->GetFirstMethParam() == _refMethParam); }
00161
00162 static void Check(SCMethParam* itemMethParam);
00163 static void Check(SCMethParam* itemMethParam, SCMethParam* newItemMethParam);
00164 };
00165
00166
00167 public:
00168 SCInterfaceRepository * _refInterfaceRepository;
00169 SCInterfaceMethod * _prevInterfaceRepository;
00170 SCInterfaceMethod * _nextInterfaceRepository;
00171
00172 public:
00173 SCInterfaceRepository* GetInterfaceRepository() const { return _refInterfaceRepository; };
00174
00175
00176
00177
00178
00179 private:
00180
00181 protected:
00182
00183 public:
00184 int m_mthId;
00185 CString m_mthPath;
00186 int m_convId;
00187 CString m_convInfo;
00188
00189
00190 private:
00191 void ConstructorInclude(SCInterfaceRepository* pInterfaceRepository);
00192 void DestructorInclude();
00193
00194 protected:
00195
00196 public:
00197 SCInterfaceMethod(SCInterfaceRepository* pInterfaceRepository, int mthId,
00198 const char* mthPath);
00199 virtual ~SCInterfaceMethod();
00200 };
00201
00202 #endif
00203
00204
00205 #ifdef CB_INLINES
00206 #ifndef _INTERFACEMETHOD_H_INLINES
00207 #define _INTERFACEMETHOD_H_INLINES
00208
00209
00210
00211
00212 #endif
00213 #endif
00214