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
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #include "SoapCorba.h"
00058
00059
00060
00061
00062
00063
00064
00065
00066
00070 SCInterfaceMethod::SCInterfaceMethod(SCInterfaceRepository* pInterfaceRepository,
00071 int mthId,
00072 const char* mthPath)
00073 : m_mthId(mthId)
00074 , m_mthPath(mthPath)
00075 , m_convId(0)
00076 , m_convInfo()
00077 {
00078 ConstructorInclude(pInterfaceRepository);
00079
00080
00081 }
00082
00083
00087 SCInterfaceMethod::~SCInterfaceMethod()
00088 {
00089 DestructorInclude();
00090
00091
00092 }
00093
00094
00095
00096
00100 void SCInterfaceMethod::ConstructorInclude(SCInterfaceRepository* pInterfaceRepository)
00101 {
00102
00103
00104 _firstMethParam = (SCMethParam*)0;
00105 _lastMethParam = (SCMethParam*)0;
00106 _countMethParam = 0;
00107
00108 assert(this);
00109 assert(pInterfaceRepository);
00110 pInterfaceRepository->_countInterfaceMethod++;
00111
00112 _refInterfaceRepository = pInterfaceRepository;
00113
00114 if (pInterfaceRepository->_lastInterfaceMethod)
00115 {
00116 _nextInterfaceRepository = (SCInterfaceMethod*)0;
00117 _prevInterfaceRepository = pInterfaceRepository->_lastInterfaceMethod;
00118 _prevInterfaceRepository->_nextInterfaceRepository = this;
00119 pInterfaceRepository->_lastInterfaceMethod = this;
00120 }
00121 else
00122 {
00123 _prevInterfaceRepository = (SCInterfaceMethod*)0;
00124 _nextInterfaceRepository = (SCInterfaceMethod*)0;
00125 pInterfaceRepository->_firstInterfaceMethod = pInterfaceRepository->_lastInterfaceMethod = this;
00126 }
00127 }
00128
00129
00133 void SCInterfaceMethod::DestructorInclude()
00134 {
00135
00136 { for (SCMethParam* item = GetFirstMethParam(); item; item = GetFirstMethParam())
00137 delete item; }
00138
00139
00140 assert(this);
00141 if (_refInterfaceRepository)
00142 {
00143 SCInterfaceRepository::InterfaceMethodIterator::Check(this);
00144
00145 _refInterfaceRepository->_countInterfaceMethod--;
00146
00147 if (_nextInterfaceRepository)
00148 _nextInterfaceRepository->_prevInterfaceRepository = _prevInterfaceRepository;
00149 else
00150 _refInterfaceRepository->_lastInterfaceMethod = _prevInterfaceRepository;
00151
00152 if (_prevInterfaceRepository)
00153 _prevInterfaceRepository->_nextInterfaceRepository = _nextInterfaceRepository;
00154 else
00155 _refInterfaceRepository->_firstInterfaceMethod = _nextInterfaceRepository;
00156
00157 _prevInterfaceRepository = (SCInterfaceMethod*)0;
00158 _nextInterfaceRepository = (SCInterfaceMethod*)0;
00159 _refInterfaceRepository = (SCInterfaceRepository*)0;
00160 }
00161 }
00162
00163
00164
00165
00166 void SCInterfaceMethod::AddMethParamFirst(SCMethParam* item)
00167 {
00168
00169 assert(this);
00170
00171 assert(item);
00172 assert(item->_refInterfaceMethod == (SCInterfaceMethod*)0);
00173
00174 _countMethParam++;
00175
00176 item->_refInterfaceMethod = this;
00177
00178 if (_firstMethParam)
00179 {
00180 _firstMethParam->_prevInterfaceMethod = item;
00181 item->_nextInterfaceMethod = _firstMethParam;
00182 _firstMethParam = item;
00183 }
00184 else
00185 _firstMethParam = _lastMethParam = item;
00186 }
00187
00188 void SCInterfaceMethod::AddMethParamLast(SCMethParam* item)
00189 {
00190
00191 assert(this);
00192
00193 assert(item);
00194 assert(item->_refInterfaceMethod == (SCInterfaceMethod*)0);
00195
00196 _countMethParam++;
00197
00198 item->_refInterfaceMethod = this;
00199
00200 if (_lastMethParam)
00201 {
00202 _lastMethParam->_nextInterfaceMethod = item;
00203 item->_prevInterfaceMethod = _lastMethParam;
00204 _lastMethParam = item;
00205 }
00206 else
00207 _firstMethParam = _lastMethParam = item;
00208 }
00209
00210 void SCInterfaceMethod::AddMethParamAfter(SCMethParam* item, SCMethParam* pos)
00211 {
00212
00213 assert(this);
00214
00215 assert(item);
00216 assert(item->_refInterfaceMethod == (SCInterfaceMethod*)0);
00217
00218 assert(pos);
00219 assert(pos->_refInterfaceMethod == this);
00220
00221 _countMethParam++;
00222
00223 item->_refInterfaceMethod = this;
00224 item->_prevInterfaceMethod = pos;
00225 item->_nextInterfaceMethod = pos->_nextInterfaceMethod;
00226 pos->_nextInterfaceMethod = item;
00227
00228 if (item->_nextInterfaceMethod)
00229 item->_nextInterfaceMethod->_prevInterfaceMethod = item;
00230 else
00231 _lastMethParam = item;
00232 }
00233
00234 void SCInterfaceMethod::AddMethParamBefore(SCMethParam* item, SCMethParam* pos)
00235 {
00236
00237 assert(this);
00238
00239 assert(item);
00240 assert(item->_refInterfaceMethod == (SCInterfaceMethod*)0);
00241
00242 assert(pos);
00243 assert(pos->_refInterfaceMethod == this);
00244
00245 _countMethParam++;
00246
00247 item->_refInterfaceMethod = this;
00248 item->_nextInterfaceMethod = pos;
00249 item->_prevInterfaceMethod = pos->_prevInterfaceMethod;
00250 pos->_prevInterfaceMethod = item;
00251
00252 if (item->_prevInterfaceMethod)
00253 item->_prevInterfaceMethod->_nextInterfaceMethod = item;
00254 else
00255 _firstMethParam = item;
00256 }
00257
00258 void SCInterfaceMethod::RemoveMethParam(SCMethParam* item)
00259 {
00260
00261 assert(this);
00262
00263 assert(item);
00264 assert(item->_refInterfaceMethod == this);
00265
00266 SCInterfaceMethod::MethParamIterator::Check(item);
00267
00268 _countMethParam--;
00269
00270 if (item->_nextInterfaceMethod)
00271 item->_nextInterfaceMethod->_prevInterfaceMethod = item->_prevInterfaceMethod;
00272 else
00273 _lastMethParam = item->_prevInterfaceMethod;
00274
00275 if (item->_prevInterfaceMethod)
00276 item->_prevInterfaceMethod->_nextInterfaceMethod = item->_nextInterfaceMethod;
00277 else
00278 _firstMethParam = item->_nextInterfaceMethod;
00279
00280 item->_prevInterfaceMethod = (SCMethParam*)0;
00281 item->_nextInterfaceMethod = (SCMethParam*)0;
00282 item->_refInterfaceMethod = (SCInterfaceMethod*)0;
00283 }
00284
00285 void SCInterfaceMethod::DeleteAllMethParam()
00286 {
00287
00288 assert(this);
00289
00290 for (SCMethParam* item = GetFirstMethParam(); item; item = GetFirstMethParam())
00291 delete item;
00292 }
00293
00294 void SCInterfaceMethod::ReplaceMethParam(SCMethParam* item, SCMethParam* newItem)
00295 {
00296
00297 assert(this);
00298
00299 assert(item);
00300 assert(item->_refInterfaceMethod == this);
00301
00302 assert(newItem);
00303 assert(newItem->_refInterfaceMethod == (SCInterfaceMethod*)0);
00304
00305 SCInterfaceMethod::MethParamIterator::Check(item, newItem);
00306
00307 if (item->_nextInterfaceMethod)
00308 item->_nextInterfaceMethod->_prevInterfaceMethod = newItem;
00309 else
00310 _lastMethParam = newItem;
00311
00312 if (item->_prevInterfaceMethod)
00313 item->_prevInterfaceMethod->_nextInterfaceMethod = newItem;
00314 else
00315 _firstMethParam = newItem;
00316
00317 newItem->_nextInterfaceMethod = item->_nextInterfaceMethod;
00318 newItem->_prevInterfaceMethod = item->_prevInterfaceMethod;
00319 item->_nextInterfaceMethod = (SCMethParam*)0;
00320 item->_prevInterfaceMethod = (SCMethParam*)0;
00321
00322 item->_refInterfaceMethod = (SCInterfaceMethod*)0;
00323 newItem->_refInterfaceMethod = this;
00324 }
00325
00326 SCMethParam* SCInterfaceMethod::GetFirstMethParam() const
00327 {
00328
00329 assert(this);
00330 return _firstMethParam;
00331 }
00332
00333 SCMethParam* SCInterfaceMethod::GetLastMethParam() const
00334 {
00335
00336 assert(this);
00337 return _lastMethParam;
00338 }
00339
00340 SCMethParam* SCInterfaceMethod::GetNextMethParam(SCMethParam* pos) const
00341 {
00342
00343 assert(this);
00344
00345 if (pos == (SCMethParam*)0)
00346 return _firstMethParam;
00347
00348 assert(pos);
00349 assert(pos->_refInterfaceMethod == this);
00350
00351 return pos->_nextInterfaceMethod;
00352 }
00353
00354 SCMethParam* SCInterfaceMethod::GetPrevMethParam(SCMethParam* pos) const
00355 {
00356
00357 assert(this);
00358
00359 if (pos == (SCMethParam*)0)
00360 return _lastMethParam;
00361
00362 assert(pos);
00363 assert(pos->_refInterfaceMethod == this);
00364
00365 return pos->_prevInterfaceMethod;
00366 }
00367
00368 int SCInterfaceMethod::GetMethParamCount() const
00369 {
00370
00371 assert(this);
00372 return _countMethParam;
00373 }
00374
00375 void SCInterfaceMethod::MoveMethParamFirst(SCMethParam* item)
00376 {
00377
00378 assert(item);
00379 assert(item->_refInterfaceMethod);
00380 item->_refInterfaceMethod->RemoveMethParam(item);
00381 AddMethParamFirst(item);
00382 }
00383
00384 void SCInterfaceMethod::MoveMethParamLast(SCMethParam* item)
00385 {
00386
00387 assert(item);
00388 assert(item->_refInterfaceMethod);
00389 item->_refInterfaceMethod->RemoveMethParam(item);
00390 AddMethParamLast(item);
00391 }
00392
00393 void SCInterfaceMethod::MoveMethParamAfter(SCMethParam* item, SCMethParam* pos)
00394 {
00395
00396 assert(item);
00397 assert(item->_refInterfaceMethod);
00398 item->_refInterfaceMethod->RemoveMethParam(item);
00399 AddMethParamAfter(item, pos);
00400 }
00401
00402 void SCInterfaceMethod::MoveMethParamBefore(SCMethParam* item, SCMethParam* pos)
00403 {
00404
00405 assert(item);
00406 assert(item->_refInterfaceMethod);
00407 item->_refInterfaceMethod->RemoveMethParam(item);
00408 AddMethParamBefore(item, pos);
00409 }
00410
00411 void SCInterfaceMethod::SortMethParam(int (*comp)(SCMethParam*, SCMethParam*))
00412 {
00413
00414 for (SCMethParam* a = GetFirstMethParam(); a; a = GetNextMethParam(a))
00415 {
00416 SCMethParam* b = GetNextMethParam(a);
00417
00418 while (b && (comp(a, b) > 0))
00419 {
00420 SCMethParam* c = GetPrevMethParam(a);
00421 while (c && (comp(c, b) > 0))
00422 c = GetPrevMethParam(c);
00423
00424 if (c)
00425 MoveMethParamAfter(b, c);
00426 else
00427 MoveMethParamFirst(b);
00428
00429 b = GetNextMethParam(a);
00430 }
00431 }
00432 }
00433
00434 SCInterfaceMethod::MethParamIterator* SCInterfaceMethod::MethParamIterator::_first = 0;
00435 SCInterfaceMethod::MethParamIterator* SCInterfaceMethod::MethParamIterator::_last = 0;
00436
00437 SCInterfaceMethod::MethParamIterator::MethParamIterator(
00438 const SCInterfaceMethod* iterInterfaceMethod,
00439 int (SCMethParam::*method)() const,
00440 SCMethParam* refMethParam)
00441 {
00442 assert(iterInterfaceMethod);
00443
00444 _iterInterfaceMethod = iterInterfaceMethod;
00445 _refMethParam = _prevMethParam = _nextMethParam = refMethParam;
00446 _prev = (MethParamIterator*)0;
00447 _next = (MethParamIterator*)0;
00448 _method = method;
00449 if (_last)
00450 {
00451 _last->_next = this;
00452 _prev = _last;
00453 _last = this;
00454 }
00455 else
00456 _first = _last = this;
00457 }
00458
00459 SCInterfaceMethod::MethParamIterator::MethParamIterator(
00460 const SCInterfaceMethod& iterInterfaceMethod,
00461 int (SCMethParam::*method)() const,
00462 SCMethParam* refMethParam)
00463 {
00464 assert(&iterInterfaceMethod);
00465
00466 _iterInterfaceMethod = &iterInterfaceMethod;
00467 _refMethParam = _prevMethParam = _nextMethParam = refMethParam;
00468 _prev = (MethParamIterator*)0;
00469 _next = (MethParamIterator*)0;
00470 _method = method;
00471 if (_last)
00472 {
00473 _last->_next = this;
00474 _prev = _last;
00475 _last = this;
00476 }
00477 else
00478 _first = _last = this;
00479 }
00480
00481 SCInterfaceMethod::MethParamIterator::MethParamIterator(
00482 const MethParamIterator& iterator,
00483 int (SCMethParam::*method)() const)
00484 {
00485 _iterInterfaceMethod = iterator._iterInterfaceMethod;
00486 _refMethParam = iterator._refMethParam;
00487 _prevMethParam = iterator._prevMethParam;
00488 _nextMethParam = iterator._nextMethParam;
00489 _prev = (MethParamIterator*)0;
00490 _next = (MethParamIterator*)0;
00491 _method = method;
00492 if (_last)
00493 {
00494 _last->_next = this;
00495 _prev = _last;
00496 _last = this;
00497 }
00498 else
00499 _first = _last = this;
00500 }
00501
00502 SCInterfaceMethod::MethParamIterator::~MethParamIterator()
00503 {
00504 if (_next)
00505 _next->_prev = _prev;
00506 else
00507 _last = _prev;
00508
00509 if (_prev)
00510 _prev->_next = _next;
00511 else
00512 _first = _next;
00513 }
00514
00515 void SCInterfaceMethod::MethParamIterator::Check(SCMethParam* itemMethParam)
00516 {
00517 for (MethParamIterator* item = _first; item; item = item->_next)
00518 {
00519 if (item->_prevMethParam == itemMethParam)
00520 {
00521 item->_prevMethParam = item->_iterInterfaceMethod->GetNextMethParam(item->_prevMethParam);
00522 item->_refMethParam = 0;
00523 }
00524 if (item->_nextMethParam == itemMethParam)
00525 {
00526 item->_nextMethParam = item->_iterInterfaceMethod->GetPrevMethParam(item->_nextMethParam);
00527 item->_refMethParam = 0;
00528 }
00529 }
00530 }
00531
00532 void SCInterfaceMethod::MethParamIterator::Check(SCMethParam* itemMethParam, SCMethParam* newItemMethParam)
00533 {
00534 for (MethParamIterator* item = _first; item; item = item->_next)
00535 {
00536 if (item->_refMethParam == itemMethParam)
00537 {
00538 item->_refMethParam = item->_prevMethParam = item->_nextMethParam = newItemMethParam;
00539 }
00540 if (item->_prevMethParam == itemMethParam)
00541 {
00542 item->_prevMethParam = newItemMethParam;
00543 item->_refMethParam = 0;
00544 }
00545 if (item->_nextMethParam == itemMethParam)
00546 {
00547 item->_nextMethParam = newItemMethParam;
00548 item->_refMethParam = 0;
00549 }
00550 }
00551 }
00552
00553
00554
00555
00556
00557