EchoSample.cpp
Go to the documentation of this file.
00001 // **********************************************************************
00002 //
00003 // Copyright (c) 2003-2007 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.2.1
00011 // Generated from file `EchoSample.ice'
00012 
00013 #include <EchoSample.h>
00014 #include <Ice/LocalException.h>
00015 #include <Ice/ObjectFactory.h>
00016 #include <Ice/BasicStream.h>
00017 #include <Ice/Object.h>
00018 #include <IceUtil/Iterator.h>
00019 #include <IceUtil/ScopedArray.h>
00020 
00021 #ifndef ICE_IGNORE_VERSION
00022 #   if ICE_INT_VERSION / 100 != 302
00023 #       error Ice version mismatch!
00024 #   endif
00025 #   if ICE_INT_VERSION % 100 > 50
00026 #       error Beta header file detected
00027 #   endif
00028 #   if ICE_INT_VERSION % 100 < 1
00029 #       error Ice patch level mismatch!
00030 #   endif
00031 #endif
00032 
00033 static const ::std::string __Demo__EchoSample__echo_name = "echo";
00034 
00035 void
00036 IceInternal::incRef(::Demo::EchoSample* p)
00037 {
00038     p->__incRef();
00039 }
00040 
00041 void
00042 IceInternal::decRef(::Demo::EchoSample* p)
00043 {
00044     p->__decRef();
00045 }
00046 
00047 void
00048 IceInternal::incRef(::IceProxy::Demo::EchoSample* p)
00049 {
00050     p->__incRef();
00051 }
00052 
00053 void
00054 IceInternal::decRef(::IceProxy::Demo::EchoSample* p)
00055 {
00056     p->__decRef();
00057 }
00058 
00059 void
00060 Demo::__write(::IceInternal::BasicStream* __os, const ::Demo::EchoSamplePrx& v)
00061 {
00062     __os->write(::Ice::ObjectPrx(v));
00063 }
00064 
00065 void
00066 Demo::__read(::IceInternal::BasicStream* __is, ::Demo::EchoSamplePrx& v)
00067 {
00068     ::Ice::ObjectPrx proxy;
00069     __is->read(proxy);
00070     if(!proxy)
00071     {
00072         v = 0;
00073     }
00074     else
00075     {
00076         v = new ::IceProxy::Demo::EchoSample;
00077         v->__copyFrom(proxy);
00078     }
00079 }
00080 
00081 void
00082 Demo::__write(::IceInternal::BasicStream* __os, const ::Demo::EchoSamplePtr& v)
00083 {
00084     __os->write(::Ice::ObjectPtr(v));
00085 }
00086 
00087 void
00088 Demo::__addObject(const EchoSamplePtr& p, ::IceInternal::GCCountMap& c)
00089 {
00090     p->__addObject(c);
00091 }
00092 
00093 bool
00094 Demo::__usesClasses(const EchoSamplePtr& p)
00095 {
00096     return p->__usesClasses();
00097 }
00098 
00099 void
00100 Demo::__decRefUnsafe(const EchoSamplePtr& p)
00101 {
00102     p->__decRefUnsafe();
00103 }
00104 
00105 void
00106 Demo::__clearHandleUnsafe(EchoSamplePtr& p)
00107 {
00108     p.__clearHandleUnsafe();
00109 }
00110 
00111 void
00112 IceProxy::Demo::EchoSample::echo(const ::std::string& msg, const ::Ice::Context* __ctx)
00113 {
00114     int __cnt = 0;
00115     while(true)
00116     {
00117         ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase;
00118         try
00119         {
00120             __delBase = __getDelegate();
00121             ::IceDelegate::Demo::EchoSample* __del = dynamic_cast< ::IceDelegate::Demo::EchoSample*>(__delBase.get());
00122             __del->echo(msg, __ctx);
00123             return;
00124         }
00125         catch(const ::IceInternal::LocalExceptionWrapper& __ex)
00126         {
00127             __handleExceptionWrapper(__delBase, __ex);
00128         }
00129         catch(const ::Ice::LocalException& __ex)
00130         {
00131             __handleException(__delBase, __ex, __cnt);
00132         }
00133     }
00134 }
00135 
00136 const ::std::string&
00137 IceProxy::Demo::EchoSample::ice_staticId()
00138 {
00139     return ::Demo::EchoSample::ice_staticId();
00140 }
00141 
00142 ::IceInternal::Handle< ::IceDelegateM::Ice::Object>
00143 IceProxy::Demo::EchoSample::__createDelegateM()
00144 {
00145     return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>(new ::IceDelegateM::Demo::EchoSample);
00146 }
00147 
00148 ::IceInternal::Handle< ::IceDelegateD::Ice::Object>
00149 IceProxy::Demo::EchoSample::__createDelegateD()
00150 {
00151     return ::IceInternal::Handle< ::IceDelegateD::Ice::Object>(new ::IceDelegateD::Demo::EchoSample);
00152 }
00153 
00154 bool
00155 IceProxy::Demo::operator==(const ::IceProxy::Demo::EchoSample& l, const ::IceProxy::Demo::EchoSample& r)
00156 {
00157     return static_cast<const ::IceProxy::Ice::Object&>(l) == static_cast<const ::IceProxy::Ice::Object&>(r);
00158 }
00159 
00160 bool
00161 IceProxy::Demo::operator!=(const ::IceProxy::Demo::EchoSample& l, const ::IceProxy::Demo::EchoSample& r)
00162 {
00163     return static_cast<const ::IceProxy::Ice::Object&>(l) != static_cast<const ::IceProxy::Ice::Object&>(r);
00164 }
00165 
00166 bool
00167 IceProxy::Demo::operator<(const ::IceProxy::Demo::EchoSample& l, const ::IceProxy::Demo::EchoSample& r)
00168 {
00169     return static_cast<const ::IceProxy::Ice::Object&>(l) < static_cast<const ::IceProxy::Ice::Object&>(r);
00170 }
00171 
00172 bool
00173 IceProxy::Demo::operator<=(const ::IceProxy::Demo::EchoSample& l, const ::IceProxy::Demo::EchoSample& r)
00174 {
00175     return l < r || l == r;
00176 }
00177 
00178 bool
00179 IceProxy::Demo::operator>(const ::IceProxy::Demo::EchoSample& l, const ::IceProxy::Demo::EchoSample& r)
00180 {
00181     return !(l < r) && !(l == r);
00182 }
00183 
00184 bool
00185 IceProxy::Demo::operator>=(const ::IceProxy::Demo::EchoSample& l, const ::IceProxy::Demo::EchoSample& r)
00186 {
00187     return !(l < r);
00188 }
00189 
00190 void
00191 IceDelegateM::Demo::EchoSample::echo(const ::std::string& msg, const ::Ice::Context* __context)
00192 {
00193     ::IceInternal::Outgoing __og(__connection.get(), __reference.get(), __Demo__EchoSample__echo_name, ::Ice::Normal, __context, __compress);
00194     try
00195     {
00196         ::IceInternal::BasicStream* __os = __og.os();
00197         __os->write(msg);
00198     }
00199     catch(const ::Ice::LocalException& __ex)
00200     {
00201         __og.abort(__ex);
00202     }
00203     bool __ok = __og.invoke();
00204     try
00205     {
00206         ::IceInternal::BasicStream* __is = __og.is();
00207         if(!__ok)
00208         {
00209             try
00210             {
00211                 __is->throwException();
00212             }
00213             catch(const ::Ice::UserException& __ex)
00214             {
00215                 throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
00216             }
00217         }
00218     }
00219     catch(const ::Ice::LocalException& __ex)
00220     {
00221         throw ::IceInternal::LocalExceptionWrapper(__ex, false);
00222     }
00223 }
00224 
00225 void
00226 IceDelegateD::Demo::EchoSample::echo(const ::std::string& msg, const ::Ice::Context* __context)
00227 {
00228     ::Ice::Current __current;
00229     __initCurrent(__current, __Demo__EchoSample__echo_name, ::Ice::Normal, __context);
00230     while(true)
00231     {
00232         ::IceInternal::Direct __direct(__current);
00233         try
00234         {
00235             ::Demo::EchoSample* __servant = dynamic_cast< ::Demo::EchoSample*>(__direct.servant().get());
00236             if(!__servant)
00237             {
00238                 ::Ice::OperationNotExistException __opEx(__FILE__, __LINE__);
00239                 __opEx.id = __current.id;
00240                 __opEx.facet = __current.facet;
00241                 __opEx.operation = __current.operation;
00242                 throw __opEx;
00243             }
00244             try
00245             {
00246                 __servant->echo(msg, __current);
00247             }
00248             catch(const ::Ice::LocalException& __ex)
00249             {
00250                 throw ::IceInternal::LocalExceptionWrapper(__ex, false);
00251             }
00252         }
00253         catch(...)
00254         {
00255             __direct.destroy();
00256             throw;
00257         }
00258         __direct.destroy();
00259         return;
00260     }
00261 }
00262 
00263 ::Ice::ObjectPtr
00264 Demo::EchoSample::ice_clone() const
00265 {
00266     throw ::Ice::CloneNotImplementedException(__FILE__, __LINE__);
00267     return 0; // to avoid a warning with some compilers
00268 }
00269 
00270 static const ::std::string __Demo__EchoSample_ids[2] =
00271 {
00272     "::Demo::EchoSample",
00273     "::Ice::Object"
00274 };
00275 
00276 bool
00277 Demo::EchoSample::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
00278 {
00279     return ::std::binary_search(__Demo__EchoSample_ids, __Demo__EchoSample_ids + 2, _s);
00280 }
00281 
00282 ::std::vector< ::std::string>
00283 Demo::EchoSample::ice_ids(const ::Ice::Current&) const
00284 {
00285     return ::std::vector< ::std::string>(&__Demo__EchoSample_ids[0], &__Demo__EchoSample_ids[2]);
00286 }
00287 
00288 const ::std::string&
00289 Demo::EchoSample::ice_id(const ::Ice::Current&) const
00290 {
00291     return __Demo__EchoSample_ids[0];
00292 }
00293 
00294 const ::std::string&
00295 Demo::EchoSample::ice_staticId()
00296 {
00297     return __Demo__EchoSample_ids[0];
00298 }
00299 
00300 ::IceInternal::DispatchStatus
00301 Demo::EchoSample::___echo(::IceInternal::Incoming&__inS, const ::Ice::Current& __current)
00302 {
00303     __checkMode(::Ice::Normal, __current.mode);
00304     ::IceInternal::BasicStream* __is = __inS.is();
00305     ::std::string msg;
00306     __is->read(msg);
00307     echo(msg, __current);
00308     return ::IceInternal::DispatchOK;
00309 }
00310 
00311 static ::std::string __Demo__EchoSample_all[] =
00312 {
00313     "echo",
00314     "ice_id",
00315     "ice_ids",
00316     "ice_isA",
00317     "ice_ping"
00318 };
00319 
00320 ::IceInternal::DispatchStatus
00321 Demo::EchoSample::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
00322 {
00323     ::std::pair< ::std::string*, ::std::string*> r = ::std::equal_range(__Demo__EchoSample_all, __Demo__EchoSample_all + 5, current.operation);
00324     if(r.first == r.second)
00325     {
00326         return ::IceInternal::DispatchOperationNotExist;
00327     }
00328 
00329     switch(r.first - __Demo__EchoSample_all)
00330     {
00331         case 0:
00332         {
00333             return ___echo(in, current);
00334         }
00335         case 1:
00336         {
00337             return ___ice_id(in, current);
00338         }
00339         case 2:
00340         {
00341             return ___ice_ids(in, current);
00342         }
00343         case 3:
00344         {
00345             return ___ice_isA(in, current);
00346         }
00347         case 4:
00348         {
00349             return ___ice_ping(in, current);
00350         }
00351     }
00352 
00353     assert(false);
00354     return ::IceInternal::DispatchOperationNotExist;
00355 }
00356 
00357 void
00358 Demo::EchoSample::__write(::IceInternal::BasicStream* __os) const
00359 {
00360     __os->writeTypeId(ice_staticId());
00361     __os->startWriteSlice();
00362     __os->endWriteSlice();
00363 #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
00364     Object::__write(__os);
00365 #else
00366     ::Ice::Object::__write(__os);
00367 #endif
00368 }
00369 
00370 void
00371 Demo::EchoSample::__read(::IceInternal::BasicStream* __is, bool __rid)
00372 {
00373     if(__rid)
00374     {
00375         ::std::string myId;
00376         __is->readTypeId(myId);
00377     }
00378     __is->startReadSlice();
00379     __is->endReadSlice();
00380 #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
00381     Object::__read(__is, true);
00382 #else
00383     ::Ice::Object::__read(__is, true);
00384 #endif
00385 }
00386 
00387 void
00388 Demo::EchoSample::__write(const ::Ice::OutputStreamPtr&) const
00389 {
00390     Ice::MarshalException ex(__FILE__, __LINE__);
00391     ex.reason = "type Demo::EchoSample was not generated with stream support";
00392     throw ex;
00393 }
00394 
00395 void
00396 Demo::EchoSample::__read(const ::Ice::InputStreamPtr&, bool)
00397 {
00398     Ice::MarshalException ex(__FILE__, __LINE__);
00399     ex.reason = "type Demo::EchoSample was not generated with stream support";
00400     throw ex;
00401 }
00402 
00403 void 
00404 Demo::__patch__EchoSamplePtr(void* __addr, ::Ice::ObjectPtr& v)
00405 {
00406     ::Demo::EchoSamplePtr* p = static_cast< ::Demo::EchoSamplePtr*>(__addr);
00407     assert(p);
00408     *p = ::Demo::EchoSamplePtr::dynamicCast(v);
00409     if(v && !*p)
00410     {
00411         ::Ice::UnexpectedObjectException e(__FILE__, __LINE__);
00412         e.type = v->ice_id();
00413         e.expectedType = ::Demo::EchoSample::ice_staticId();
00414         throw e;
00415     }
00416 }
00417 
00418 bool
00419 Demo::operator==(const ::Demo::EchoSample& l, const ::Demo::EchoSample& r)
00420 {
00421     return static_cast<const ::Ice::Object&>(l) == static_cast<const ::Ice::Object&>(r);
00422 }
00423 
00424 bool
00425 Demo::operator!=(const ::Demo::EchoSample& l, const ::Demo::EchoSample& r)
00426 {
00427     return static_cast<const ::Ice::Object&>(l) != static_cast<const ::Ice::Object&>(r);
00428 }
00429 
00430 bool
00431 Demo::operator<(const ::Demo::EchoSample& l, const ::Demo::EchoSample& r)
00432 {
00433     return static_cast<const ::Ice::Object&>(l) < static_cast<const ::Ice::Object&>(r);
00434 }
00435 
00436 bool
00437 Demo::operator<=(const ::Demo::EchoSample& l, const ::Demo::EchoSample& r)
00438 {
00439     return l < r || l == r;
00440 }
00441 
00442 bool
00443 Demo::operator>(const ::Demo::EchoSample& l, const ::Demo::EchoSample& r)
00444 {
00445     return !(l < r) && !(l == r);
00446 }
00447 
00448 bool
00449 Demo::operator>=(const ::Demo::EchoSample& l, const ::Demo::EchoSample& r)
00450 {
00451     return !(l < r);
00452 }


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sat Jun 8 2019 18:49:04