00001 // ********************************************************************** 00002 // 00003 // Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. 00004 // 00005 // This copy of Ice is licensed to you under the terms described in the 00006 // ICE_LICENSE file included in this distribution. 00007 // 00008 // ********************************************************************** 00009 00010 // Ice version 3.3.1 00011 // Generated from file `ScorbotSimple.ice' 00012 00013 #include <ScorbotSimple.ice.H> 00014 #include <Ice/LocalException.h> 00015 #include <Ice/ObjectFactory.h> 00016 #include <Ice/BasicStream.h> 00017 #include <IceUtil/Iterator.h> 00018 #include <IceUtil/ScopedArray.h> 00019 00020 #ifndef ICE_IGNORE_VERSION 00021 # if ICE_INT_VERSION / 100 != 303 00022 # error Ice version mismatch! 00023 # endif 00024 # if ICE_INT_VERSION % 100 > 50 00025 # error Beta header file detected 00026 # endif 00027 # if ICE_INT_VERSION % 100 < 1 00028 # error Ice patch level mismatch! 00029 # endif 00030 #endif 00031 00032 static const ::std::string __ScorbotSimpleIce__ScorbotSimple__getState_name = "getState"; 00033 00034 static const ::std::string __ScorbotSimpleIce__ScorbotSimple__setNext_name = "setNext"; 00035 00036 static const ::std::string __ScorbotSimpleIce__ScorbotSimple__reset_name = "reset"; 00037 00038 ::Ice::Object* IceInternal::upCast(::ScorbotSimpleIce::ScorbotSimple* p) { return p; } 00039 ::IceProxy::Ice::Object* IceInternal::upCast(::IceProxy::ScorbotSimpleIce::ScorbotSimple* p) { return p; } 00040 00041 void 00042 ScorbotSimpleIce::__read(::IceInternal::BasicStream* __is, ::ScorbotSimpleIce::ScorbotSimplePrx& v) 00043 { 00044 ::Ice::ObjectPrx proxy; 00045 __is->read(proxy); 00046 if(!proxy) 00047 { 00048 v = 0; 00049 } 00050 else 00051 { 00052 v = new ::IceProxy::ScorbotSimpleIce::ScorbotSimple; 00053 v->__copyFrom(proxy); 00054 } 00055 } 00056 00057 bool 00058 IceProxy::ScorbotSimpleIce::ScorbotSimple::getState(const ::Ice::Context* __ctx) 00059 { 00060 int __cnt = 0; 00061 while(true) 00062 { 00063 ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase; 00064 try 00065 { 00066 #if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) // C++Builder 2009 compiler bug 00067 IceUtil::DummyBCC dummy; 00068 #endif 00069 __checkTwowayOnly(__ScorbotSimpleIce__ScorbotSimple__getState_name); 00070 __delBase = __getDelegate(false); 00071 ::IceDelegate::ScorbotSimpleIce::ScorbotSimple* __del = dynamic_cast< ::IceDelegate::ScorbotSimpleIce::ScorbotSimple*>(__delBase.get()); 00072 return __del->getState(__ctx); 00073 } 00074 catch(const ::IceInternal::LocalExceptionWrapper& __ex) 00075 { 00076 __handleExceptionWrapper(__delBase, __ex, 0); 00077 } 00078 catch(const ::Ice::LocalException& __ex) 00079 { 00080 __handleException(__delBase, __ex, 0, __cnt); 00081 } 00082 } 00083 } 00084 00085 void 00086 IceProxy::ScorbotSimpleIce::ScorbotSimple::setNext(const ::Ice::Context* __ctx) 00087 { 00088 int __cnt = 0; 00089 while(true) 00090 { 00091 ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase; 00092 try 00093 { 00094 #if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) // C++Builder 2009 compiler bug 00095 IceUtil::DummyBCC dummy; 00096 #endif 00097 __delBase = __getDelegate(false); 00098 ::IceDelegate::ScorbotSimpleIce::ScorbotSimple* __del = dynamic_cast< ::IceDelegate::ScorbotSimpleIce::ScorbotSimple*>(__delBase.get()); 00099 __del->setNext(__ctx); 00100 return; 00101 } 00102 catch(const ::IceInternal::LocalExceptionWrapper& __ex) 00103 { 00104 __handleExceptionWrapper(__delBase, __ex, 0); 00105 } 00106 catch(const ::Ice::LocalException& __ex) 00107 { 00108 __handleException(__delBase, __ex, 0, __cnt); 00109 } 00110 } 00111 } 00112 00113 void 00114 IceProxy::ScorbotSimpleIce::ScorbotSimple::reset(const ::Ice::Context* __ctx) 00115 { 00116 int __cnt = 0; 00117 while(true) 00118 { 00119 ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase; 00120 try 00121 { 00122 #if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) // C++Builder 2009 compiler bug 00123 IceUtil::DummyBCC dummy; 00124 #endif 00125 __delBase = __getDelegate(false); 00126 ::IceDelegate::ScorbotSimpleIce::ScorbotSimple* __del = dynamic_cast< ::IceDelegate::ScorbotSimpleIce::ScorbotSimple*>(__delBase.get()); 00127 __del->reset(__ctx); 00128 return; 00129 } 00130 catch(const ::IceInternal::LocalExceptionWrapper& __ex) 00131 { 00132 __handleExceptionWrapper(__delBase, __ex, 0); 00133 } 00134 catch(const ::Ice::LocalException& __ex) 00135 { 00136 __handleException(__delBase, __ex, 0, __cnt); 00137 } 00138 } 00139 } 00140 00141 const ::std::string& 00142 IceProxy::ScorbotSimpleIce::ScorbotSimple::ice_staticId() 00143 { 00144 return ::ScorbotSimpleIce::ScorbotSimple::ice_staticId(); 00145 } 00146 00147 ::IceInternal::Handle< ::IceDelegateM::Ice::Object> 00148 IceProxy::ScorbotSimpleIce::ScorbotSimple::__createDelegateM() 00149 { 00150 return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>(new ::IceDelegateM::ScorbotSimpleIce::ScorbotSimple); 00151 } 00152 00153 ::IceInternal::Handle< ::IceDelegateD::Ice::Object> 00154 IceProxy::ScorbotSimpleIce::ScorbotSimple::__createDelegateD() 00155 { 00156 return ::IceInternal::Handle< ::IceDelegateD::Ice::Object>(new ::IceDelegateD::ScorbotSimpleIce::ScorbotSimple); 00157 } 00158 00159 ::IceProxy::Ice::Object* 00160 IceProxy::ScorbotSimpleIce::ScorbotSimple::__newInstance() const 00161 { 00162 return new ScorbotSimple; 00163 } 00164 00165 bool 00166 IceDelegateM::ScorbotSimpleIce::ScorbotSimple::getState(const ::Ice::Context* __context) 00167 { 00168 ::IceInternal::Outgoing __og(__handler.get(), __ScorbotSimpleIce__ScorbotSimple__getState_name, ::Ice::Normal, __context); 00169 bool __ok = __og.invoke(); 00170 bool __ret; 00171 try 00172 { 00173 if(!__ok) 00174 { 00175 try 00176 { 00177 __og.throwUserException(); 00178 } 00179 catch(const ::Ice::UserException& __ex) 00180 { 00181 ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name()); 00182 throw __uue; 00183 } 00184 } 00185 ::IceInternal::BasicStream* __is = __og.is(); 00186 __is->startReadEncaps(); 00187 __is->read(__ret); 00188 __is->endReadEncaps(); 00189 return __ret; 00190 } 00191 catch(const ::Ice::LocalException& __ex) 00192 { 00193 throw ::IceInternal::LocalExceptionWrapper(__ex, false); 00194 } 00195 } 00196 00197 void 00198 IceDelegateM::ScorbotSimpleIce::ScorbotSimple::setNext(const ::Ice::Context* __context) 00199 { 00200 ::IceInternal::Outgoing __og(__handler.get(), __ScorbotSimpleIce__ScorbotSimple__setNext_name, ::Ice::Normal, __context); 00201 bool __ok = __og.invoke(); 00202 if(!__og.is()->b.empty()) 00203 { 00204 try 00205 { 00206 if(!__ok) 00207 { 00208 try 00209 { 00210 __og.throwUserException(); 00211 } 00212 catch(const ::Ice::UserException& __ex) 00213 { 00214 ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name()); 00215 throw __uue; 00216 } 00217 } 00218 __og.is()->skipEmptyEncaps(); 00219 } 00220 catch(const ::Ice::LocalException& __ex) 00221 { 00222 throw ::IceInternal::LocalExceptionWrapper(__ex, false); 00223 } 00224 } 00225 } 00226 00227 void 00228 IceDelegateM::ScorbotSimpleIce::ScorbotSimple::reset(const ::Ice::Context* __context) 00229 { 00230 ::IceInternal::Outgoing __og(__handler.get(), __ScorbotSimpleIce__ScorbotSimple__reset_name, ::Ice::Normal, __context); 00231 bool __ok = __og.invoke(); 00232 if(!__og.is()->b.empty()) 00233 { 00234 try 00235 { 00236 if(!__ok) 00237 { 00238 try 00239 { 00240 __og.throwUserException(); 00241 } 00242 catch(const ::Ice::UserException& __ex) 00243 { 00244 ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name()); 00245 throw __uue; 00246 } 00247 } 00248 __og.is()->skipEmptyEncaps(); 00249 } 00250 catch(const ::Ice::LocalException& __ex) 00251 { 00252 throw ::IceInternal::LocalExceptionWrapper(__ex, false); 00253 } 00254 } 00255 } 00256 00257 bool 00258 IceDelegateD::ScorbotSimpleIce::ScorbotSimple::getState(const ::Ice::Context* __context) 00259 { 00260 class _DirectI : public ::IceInternal::Direct 00261 { 00262 public: 00263 00264 _DirectI(bool& __result, const ::Ice::Current& __current) : 00265 ::IceInternal::Direct(__current), 00266 _result(__result) 00267 { 00268 } 00269 00270 virtual ::Ice::DispatchStatus 00271 run(::Ice::Object* object) 00272 { 00273 ::ScorbotSimpleIce::ScorbotSimple* servant = dynamic_cast< ::ScorbotSimpleIce::ScorbotSimple*>(object); 00274 if(!servant) 00275 { 00276 throw ::Ice::OperationNotExistException(__FILE__, __LINE__, _current.id, _current.facet, _current.operation); 00277 } 00278 _result = servant->getState(_current); 00279 return ::Ice::DispatchOK; 00280 } 00281 00282 private: 00283 00284 bool& _result; 00285 }; 00286 00287 ::Ice::Current __current; 00288 __initCurrent(__current, __ScorbotSimpleIce__ScorbotSimple__getState_name, ::Ice::Normal, __context); 00289 bool __result; 00290 try 00291 { 00292 _DirectI __direct(__result, __current); 00293 try 00294 { 00295 __direct.servant()->__collocDispatch(__direct); 00296 } 00297 catch(...) 00298 { 00299 __direct.destroy(); 00300 throw; 00301 } 00302 __direct.destroy(); 00303 } 00304 catch(const ::Ice::SystemException&) 00305 { 00306 throw; 00307 } 00308 catch(const ::IceInternal::LocalExceptionWrapper&) 00309 { 00310 throw; 00311 } 00312 catch(const ::std::exception& __ex) 00313 { 00314 ::IceInternal::LocalExceptionWrapper::throwWrapper(__ex); 00315 } 00316 catch(...) 00317 { 00318 throw ::IceInternal::LocalExceptionWrapper(::Ice::UnknownException(__FILE__, __LINE__, "unknown c++ exception"), false); 00319 } 00320 return __result; 00321 } 00322 00323 void 00324 IceDelegateD::ScorbotSimpleIce::ScorbotSimple::setNext(const ::Ice::Context* __context) 00325 { 00326 class _DirectI : public ::IceInternal::Direct 00327 { 00328 public: 00329 00330 _DirectI(const ::Ice::Current& __current) : 00331 ::IceInternal::Direct(__current) 00332 { 00333 } 00334 00335 virtual ::Ice::DispatchStatus 00336 run(::Ice::Object* object) 00337 { 00338 ::ScorbotSimpleIce::ScorbotSimple* servant = dynamic_cast< ::ScorbotSimpleIce::ScorbotSimple*>(object); 00339 if(!servant) 00340 { 00341 throw ::Ice::OperationNotExistException(__FILE__, __LINE__, _current.id, _current.facet, _current.operation); 00342 } 00343 servant->setNext(_current); 00344 return ::Ice::DispatchOK; 00345 } 00346 00347 private: 00348 00349 }; 00350 00351 ::Ice::Current __current; 00352 __initCurrent(__current, __ScorbotSimpleIce__ScorbotSimple__setNext_name, ::Ice::Normal, __context); 00353 try 00354 { 00355 _DirectI __direct(__current); 00356 try 00357 { 00358 __direct.servant()->__collocDispatch(__direct); 00359 } 00360 catch(...) 00361 { 00362 __direct.destroy(); 00363 throw; 00364 } 00365 __direct.destroy(); 00366 } 00367 catch(const ::Ice::SystemException&) 00368 { 00369 throw; 00370 } 00371 catch(const ::IceInternal::LocalExceptionWrapper&) 00372 { 00373 throw; 00374 } 00375 catch(const ::std::exception& __ex) 00376 { 00377 ::IceInternal::LocalExceptionWrapper::throwWrapper(__ex); 00378 } 00379 catch(...) 00380 { 00381 throw ::IceInternal::LocalExceptionWrapper(::Ice::UnknownException(__FILE__, __LINE__, "unknown c++ exception"), false); 00382 } 00383 } 00384 00385 void 00386 IceDelegateD::ScorbotSimpleIce::ScorbotSimple::reset(const ::Ice::Context* __context) 00387 { 00388 class _DirectI : public ::IceInternal::Direct 00389 { 00390 public: 00391 00392 _DirectI(const ::Ice::Current& __current) : 00393 ::IceInternal::Direct(__current) 00394 { 00395 } 00396 00397 virtual ::Ice::DispatchStatus 00398 run(::Ice::Object* object) 00399 { 00400 ::ScorbotSimpleIce::ScorbotSimple* servant = dynamic_cast< ::ScorbotSimpleIce::ScorbotSimple*>(object); 00401 if(!servant) 00402 { 00403 throw ::Ice::OperationNotExistException(__FILE__, __LINE__, _current.id, _current.facet, _current.operation); 00404 } 00405 servant->reset(_current); 00406 return ::Ice::DispatchOK; 00407 } 00408 00409 private: 00410 00411 }; 00412 00413 ::Ice::Current __current; 00414 __initCurrent(__current, __ScorbotSimpleIce__ScorbotSimple__reset_name, ::Ice::Normal, __context); 00415 try 00416 { 00417 _DirectI __direct(__current); 00418 try 00419 { 00420 __direct.servant()->__collocDispatch(__direct); 00421 } 00422 catch(...) 00423 { 00424 __direct.destroy(); 00425 throw; 00426 } 00427 __direct.destroy(); 00428 } 00429 catch(const ::Ice::SystemException&) 00430 { 00431 throw; 00432 } 00433 catch(const ::IceInternal::LocalExceptionWrapper&) 00434 { 00435 throw; 00436 } 00437 catch(const ::std::exception& __ex) 00438 { 00439 ::IceInternal::LocalExceptionWrapper::throwWrapper(__ex); 00440 } 00441 catch(...) 00442 { 00443 throw ::IceInternal::LocalExceptionWrapper(::Ice::UnknownException(__FILE__, __LINE__, "unknown c++ exception"), false); 00444 } 00445 } 00446 00447 ::Ice::ObjectPtr 00448 ScorbotSimpleIce::ScorbotSimple::ice_clone() const 00449 { 00450 throw ::Ice::CloneNotImplementedException(__FILE__, __LINE__); 00451 return 0; // to avoid a warning with some compilers 00452 } 00453 00454 static const ::std::string __ScorbotSimpleIce__ScorbotSimple_ids[2] = 00455 { 00456 "::Ice::Object", 00457 "::ScorbotSimpleIce::ScorbotSimple" 00458 }; 00459 00460 bool 00461 ScorbotSimpleIce::ScorbotSimple::ice_isA(const ::std::string& _s, const ::Ice::Current&) const 00462 { 00463 return ::std::binary_search(__ScorbotSimpleIce__ScorbotSimple_ids, __ScorbotSimpleIce__ScorbotSimple_ids + 2, _s); 00464 } 00465 00466 ::std::vector< ::std::string> 00467 ScorbotSimpleIce::ScorbotSimple::ice_ids(const ::Ice::Current&) const 00468 { 00469 return ::std::vector< ::std::string>(&__ScorbotSimpleIce__ScorbotSimple_ids[0], &__ScorbotSimpleIce__ScorbotSimple_ids[2]); 00470 } 00471 00472 const ::std::string& 00473 ScorbotSimpleIce::ScorbotSimple::ice_id(const ::Ice::Current&) const 00474 { 00475 return __ScorbotSimpleIce__ScorbotSimple_ids[1]; 00476 } 00477 00478 const ::std::string& 00479 ScorbotSimpleIce::ScorbotSimple::ice_staticId() 00480 { 00481 return __ScorbotSimpleIce__ScorbotSimple_ids[1]; 00482 } 00483 00484 ::Ice::DispatchStatus 00485 ScorbotSimpleIce::ScorbotSimple::___getState(::IceInternal::Incoming& __inS, const ::Ice::Current& __current) 00486 { 00487 __checkMode(::Ice::Normal, __current.mode); 00488 __inS.is()->skipEmptyEncaps(); 00489 ::IceInternal::BasicStream* __os = __inS.os(); 00490 bool __ret = getState(__current); 00491 __os->write(__ret); 00492 return ::Ice::DispatchOK; 00493 } 00494 00495 ::Ice::DispatchStatus 00496 ScorbotSimpleIce::ScorbotSimple::___setNext(::IceInternal::Incoming& __inS, const ::Ice::Current& __current) 00497 { 00498 __checkMode(::Ice::Normal, __current.mode); 00499 __inS.is()->skipEmptyEncaps(); 00500 setNext(__current); 00501 return ::Ice::DispatchOK; 00502 } 00503 00504 ::Ice::DispatchStatus 00505 ScorbotSimpleIce::ScorbotSimple::___reset(::IceInternal::Incoming& __inS, const ::Ice::Current& __current) 00506 { 00507 __checkMode(::Ice::Normal, __current.mode); 00508 __inS.is()->skipEmptyEncaps(); 00509 reset(__current); 00510 return ::Ice::DispatchOK; 00511 } 00512 00513 static ::std::string __ScorbotSimpleIce__ScorbotSimple_all[] = 00514 { 00515 "getState", 00516 "ice_id", 00517 "ice_ids", 00518 "ice_isA", 00519 "ice_ping", 00520 "reset", 00521 "setNext" 00522 }; 00523 00524 ::Ice::DispatchStatus 00525 ScorbotSimpleIce::ScorbotSimple::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current) 00526 { 00527 ::std::pair< ::std::string*, ::std::string*> r = ::std::equal_range(__ScorbotSimpleIce__ScorbotSimple_all, __ScorbotSimpleIce__ScorbotSimple_all + 7, current.operation); 00528 if(r.first == r.second) 00529 { 00530 throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); 00531 } 00532 00533 switch(r.first - __ScorbotSimpleIce__ScorbotSimple_all) 00534 { 00535 case 0: 00536 { 00537 return ___getState(in, current); 00538 } 00539 case 1: 00540 { 00541 return ___ice_id(in, current); 00542 } 00543 case 2: 00544 { 00545 return ___ice_ids(in, current); 00546 } 00547 case 3: 00548 { 00549 return ___ice_isA(in, current); 00550 } 00551 case 4: 00552 { 00553 return ___ice_ping(in, current); 00554 } 00555 case 5: 00556 { 00557 return ___reset(in, current); 00558 } 00559 case 6: 00560 { 00561 return ___setNext(in, current); 00562 } 00563 } 00564 00565 assert(false); 00566 throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); 00567 } 00568 00569 void 00570 ScorbotSimpleIce::ScorbotSimple::__write(::IceInternal::BasicStream* __os) const 00571 { 00572 __os->writeTypeId(ice_staticId()); 00573 __os->startWriteSlice(); 00574 __os->endWriteSlice(); 00575 #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug 00576 Object::__write(__os); 00577 #else 00578 ::Ice::Object::__write(__os); 00579 #endif 00580 } 00581 00582 void 00583 ScorbotSimpleIce::ScorbotSimple::__read(::IceInternal::BasicStream* __is, bool __rid) 00584 { 00585 if(__rid) 00586 { 00587 ::std::string myId; 00588 __is->readTypeId(myId); 00589 } 00590 __is->startReadSlice(); 00591 __is->endReadSlice(); 00592 #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug 00593 Object::__read(__is, true); 00594 #else 00595 ::Ice::Object::__read(__is, true); 00596 #endif 00597 } 00598 00599 void 00600 ScorbotSimpleIce::ScorbotSimple::__write(const ::Ice::OutputStreamPtr&) const 00601 { 00602 Ice::MarshalException ex(__FILE__, __LINE__); 00603 ex.reason = "type ScorbotSimpleIce::ScorbotSimple was not generated with stream support"; 00604 throw ex; 00605 } 00606 00607 void 00608 ScorbotSimpleIce::ScorbotSimple::__read(const ::Ice::InputStreamPtr&, bool) 00609 { 00610 Ice::MarshalException ex(__FILE__, __LINE__); 00611 ex.reason = "type ScorbotSimpleIce::ScorbotSimple was not generated with stream support"; 00612 throw ex; 00613 } 00614 00615 void 00616 ScorbotSimpleIce::__patch__ScorbotSimplePtr(void* __addr, ::Ice::ObjectPtr& v) 00617 { 00618 ::ScorbotSimpleIce::ScorbotSimplePtr* p = static_cast< ::ScorbotSimpleIce::ScorbotSimplePtr*>(__addr); 00619 assert(p); 00620 *p = ::ScorbotSimpleIce::ScorbotSimplePtr::dynamicCast(v); 00621 if(v && !*p) 00622 { 00623 IceInternal::Ex::throwUOE(::ScorbotSimpleIce::ScorbotSimple::ice_staticId(), v->ice_id()); 00624 } 00625 } 00626 00627 bool 00628 ScorbotSimpleIce::operator==(const ::ScorbotSimpleIce::ScorbotSimple& l, const ::ScorbotSimpleIce::ScorbotSimple& r) 00629 { 00630 return static_cast<const ::Ice::Object&>(l) == static_cast<const ::Ice::Object&>(r); 00631 } 00632 00633 bool 00634 ScorbotSimpleIce::operator<(const ::ScorbotSimpleIce::ScorbotSimple& l, const ::ScorbotSimpleIce::ScorbotSimple& r) 00635 { 00636 return static_cast<const ::Ice::Object&>(l) < static_cast<const ::Ice::Object&>(r); 00637 }