HelloWorld.ice.C

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 `HelloWorld.ice'
00012 
00013 #include <HelloWorld.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 __Demo__HelloWorld__printString_name = "printString";
00033 
00034 ::Ice::Object* IceInternal::upCast(::Demo::HelloWorld* p) { return p; }
00035 ::IceProxy::Ice::Object* IceInternal::upCast(::IceProxy::Demo::HelloWorld* p) { return p; }
00036 
00037 void
00038 Demo::__read(::IceInternal::BasicStream* __is, ::Demo::HelloWorldPrx& v)
00039 {
00040     ::Ice::ObjectPrx proxy;
00041     __is->read(proxy);
00042     if(!proxy)
00043     {
00044         v = 0;
00045     }
00046     else
00047     {
00048         v = new ::IceProxy::Demo::HelloWorld;
00049         v->__copyFrom(proxy);
00050     }
00051 }
00052 
00053 void
00054 IceProxy::Demo::HelloWorld::printString(const ::std::string& s, const ::Ice::Context* __ctx)
00055 {
00056     int __cnt = 0;
00057     while(true)
00058     {
00059         ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase;
00060         try
00061         {
00062 #if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) // C++Builder 2009 compiler bug
00063             IceUtil::DummyBCC dummy;
00064 #endif
00065             __delBase = __getDelegate(false);
00066             ::IceDelegate::Demo::HelloWorld* __del = dynamic_cast< ::IceDelegate::Demo::HelloWorld*>(__delBase.get());
00067             __del->printString(s, __ctx);
00068             return;
00069         }
00070         catch(const ::IceInternal::LocalExceptionWrapper& __ex)
00071         {
00072             __handleExceptionWrapper(__delBase, __ex, 0);
00073         }
00074         catch(const ::Ice::LocalException& __ex)
00075         {
00076             __handleException(__delBase, __ex, 0, __cnt);
00077         }
00078     }
00079 }
00080 
00081 const ::std::string&
00082 IceProxy::Demo::HelloWorld::ice_staticId()
00083 {
00084     return ::Demo::HelloWorld::ice_staticId();
00085 }
00086 
00087 ::IceInternal::Handle< ::IceDelegateM::Ice::Object>
00088 IceProxy::Demo::HelloWorld::__createDelegateM()
00089 {
00090     return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>(new ::IceDelegateM::Demo::HelloWorld);
00091 }
00092 
00093 ::IceInternal::Handle< ::IceDelegateD::Ice::Object>
00094 IceProxy::Demo::HelloWorld::__createDelegateD()
00095 {
00096     return ::IceInternal::Handle< ::IceDelegateD::Ice::Object>(new ::IceDelegateD::Demo::HelloWorld);
00097 }
00098 
00099 ::IceProxy::Ice::Object*
00100 IceProxy::Demo::HelloWorld::__newInstance() const
00101 {
00102     return new HelloWorld;
00103 }
00104 
00105 void
00106 IceDelegateM::Demo::HelloWorld::printString(const ::std::string& s, const ::Ice::Context* __context)
00107 {
00108     ::IceInternal::Outgoing __og(__handler.get(), __Demo__HelloWorld__printString_name, ::Ice::Normal, __context);
00109     try
00110     {
00111         ::IceInternal::BasicStream* __os = __og.os();
00112         __os->write(s);
00113     }
00114     catch(const ::Ice::LocalException& __ex)
00115     {
00116         __og.abort(__ex);
00117     }
00118     bool __ok = __og.invoke();
00119     if(!__og.is()->b.empty())
00120     {
00121         try
00122         {
00123             if(!__ok)
00124             {
00125                 try
00126                 {
00127                     __og.throwUserException();
00128                 }
00129                 catch(const ::Ice::UserException& __ex)
00130                 {
00131                     ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
00132                     throw __uue;
00133                 }
00134             }
00135             __og.is()->skipEmptyEncaps();
00136         }
00137         catch(const ::Ice::LocalException& __ex)
00138         {
00139             throw ::IceInternal::LocalExceptionWrapper(__ex, false);
00140         }
00141     }
00142 }
00143 
00144 void
00145 IceDelegateD::Demo::HelloWorld::printString(const ::std::string& s, const ::Ice::Context* __context)
00146 {
00147     class _DirectI : public ::IceInternal::Direct
00148     {
00149     public:
00150 
00151         _DirectI(const ::std::string& s, const ::Ice::Current& __current) :
00152             ::IceInternal::Direct(__current),
00153             _m_s(s)
00154         {
00155         }
00156 
00157         virtual ::Ice::DispatchStatus
00158         run(::Ice::Object* object)
00159         {
00160             ::Demo::HelloWorld* servant = dynamic_cast< ::Demo::HelloWorld*>(object);
00161             if(!servant)
00162             {
00163                 throw ::Ice::OperationNotExistException(__FILE__, __LINE__, _current.id, _current.facet, _current.operation);
00164             }
00165             servant->printString(_m_s, _current);
00166             return ::Ice::DispatchOK;
00167         }
00168 
00169     private:
00170 
00171         const ::std::string& _m_s;
00172     };
00173 
00174     ::Ice::Current __current;
00175     __initCurrent(__current, __Demo__HelloWorld__printString_name, ::Ice::Normal, __context);
00176     try
00177     {
00178         _DirectI __direct(s, __current);
00179         try
00180         {
00181             __direct.servant()->__collocDispatch(__direct);
00182         }
00183         catch(...)
00184         {
00185             __direct.destroy();
00186             throw;
00187         }
00188         __direct.destroy();
00189     }
00190     catch(const ::Ice::SystemException&)
00191     {
00192         throw;
00193     }
00194     catch(const ::IceInternal::LocalExceptionWrapper&)
00195     {
00196         throw;
00197     }
00198     catch(const ::std::exception& __ex)
00199     {
00200         ::IceInternal::LocalExceptionWrapper::throwWrapper(__ex);
00201     }
00202     catch(...)
00203     {
00204         throw ::IceInternal::LocalExceptionWrapper(::Ice::UnknownException(__FILE__, __LINE__, "unknown c++ exception"), false);
00205     }
00206 }
00207 
00208 ::Ice::ObjectPtr
00209 Demo::HelloWorld::ice_clone() const
00210 {
00211     throw ::Ice::CloneNotImplementedException(__FILE__, __LINE__);
00212     return 0; // to avoid a warning with some compilers
00213 }
00214 
00215 static const ::std::string __Demo__HelloWorld_ids[2] =
00216 {
00217     "::Demo::HelloWorld",
00218     "::Ice::Object"
00219 };
00220 
00221 bool
00222 Demo::HelloWorld::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
00223 {
00224     return ::std::binary_search(__Demo__HelloWorld_ids, __Demo__HelloWorld_ids + 2, _s);
00225 }
00226 
00227 ::std::vector< ::std::string>
00228 Demo::HelloWorld::ice_ids(const ::Ice::Current&) const
00229 {
00230     return ::std::vector< ::std::string>(&__Demo__HelloWorld_ids[0], &__Demo__HelloWorld_ids[2]);
00231 }
00232 
00233 const ::std::string&
00234 Demo::HelloWorld::ice_id(const ::Ice::Current&) const
00235 {
00236     return __Demo__HelloWorld_ids[0];
00237 }
00238 
00239 const ::std::string&
00240 Demo::HelloWorld::ice_staticId()
00241 {
00242     return __Demo__HelloWorld_ids[0];
00243 }
00244 
00245 ::Ice::DispatchStatus
00246 Demo::HelloWorld::___printString(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
00247 {
00248     __checkMode(::Ice::Normal, __current.mode);
00249     ::IceInternal::BasicStream* __is = __inS.is();
00250     __is->startReadEncaps();
00251     ::std::string s;
00252     __is->read(s);
00253     __is->endReadEncaps();
00254     printString(s, __current);
00255     return ::Ice::DispatchOK;
00256 }
00257 
00258 static ::std::string __Demo__HelloWorld_all[] =
00259 {
00260     "ice_id",
00261     "ice_ids",
00262     "ice_isA",
00263     "ice_ping",
00264     "printString"
00265 };
00266 
00267 ::Ice::DispatchStatus
00268 Demo::HelloWorld::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
00269 {
00270     ::std::pair< ::std::string*, ::std::string*> r = ::std::equal_range(__Demo__HelloWorld_all, __Demo__HelloWorld_all + 5, current.operation);
00271     if(r.first == r.second)
00272     {
00273         throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
00274     }
00275 
00276     switch(r.first - __Demo__HelloWorld_all)
00277     {
00278         case 0:
00279         {
00280             return ___ice_id(in, current);
00281         }
00282         case 1:
00283         {
00284             return ___ice_ids(in, current);
00285         }
00286         case 2:
00287         {
00288             return ___ice_isA(in, current);
00289         }
00290         case 3:
00291         {
00292             return ___ice_ping(in, current);
00293         }
00294         case 4:
00295         {
00296             return ___printString(in, current);
00297         }
00298     }
00299 
00300     assert(false);
00301     throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
00302 }
00303 
00304 void
00305 Demo::HelloWorld::__write(::IceInternal::BasicStream* __os) const
00306 {
00307     __os->writeTypeId(ice_staticId());
00308     __os->startWriteSlice();
00309     __os->endWriteSlice();
00310 #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
00311     Object::__write(__os);
00312 #else
00313     ::Ice::Object::__write(__os);
00314 #endif
00315 }
00316 
00317 void
00318 Demo::HelloWorld::__read(::IceInternal::BasicStream* __is, bool __rid)
00319 {
00320     if(__rid)
00321     {
00322         ::std::string myId;
00323         __is->readTypeId(myId);
00324     }
00325     __is->startReadSlice();
00326     __is->endReadSlice();
00327 #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
00328     Object::__read(__is, true);
00329 #else
00330     ::Ice::Object::__read(__is, true);
00331 #endif
00332 }
00333 
00334 void
00335 Demo::HelloWorld::__write(const ::Ice::OutputStreamPtr&) const
00336 {
00337     Ice::MarshalException ex(__FILE__, __LINE__);
00338     ex.reason = "type Demo::HelloWorld was not generated with stream support";
00339     throw ex;
00340 }
00341 
00342 void
00343 Demo::HelloWorld::__read(const ::Ice::InputStreamPtr&, bool)
00344 {
00345     Ice::MarshalException ex(__FILE__, __LINE__);
00346     ex.reason = "type Demo::HelloWorld was not generated with stream support";
00347     throw ex;
00348 }
00349 
00350 void
00351 Demo::__patch__HelloWorldPtr(void* __addr, ::Ice::ObjectPtr& v)
00352 {
00353     ::Demo::HelloWorldPtr* p = static_cast< ::Demo::HelloWorldPtr*>(__addr);
00354     assert(p);
00355     *p = ::Demo::HelloWorldPtr::dynamicCast(v);
00356     if(v && !*p)
00357     {
00358         IceInternal::Ex::throwUOE(::Demo::HelloWorld::ice_staticId(), v->ice_id());
00359     }
00360 }
00361 
00362 bool
00363 Demo::operator==(const ::Demo::HelloWorld& l, const ::Demo::HelloWorld& r)
00364 {
00365     return static_cast<const ::Ice::Object&>(l) == static_cast<const ::Ice::Object&>(r);
00366 }
00367 
00368 bool
00369 Demo::operator<(const ::Demo::HelloWorld& l, const ::Demo::HelloWorld& r)
00370 {
00371     return static_cast<const ::Ice::Object&>(l) < static_cast<const ::Ice::Object&>(r);
00372 }
Generated on Sun May 8 08:40:44 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3