00001 // This file is generated by omniidl (C++ backend)- omniORB_4_1. Do not edit. 00002 00003 #include "EchoImageServerSK.hh" 00004 #include <omniORB4/IOP_S.h> 00005 #include <omniORB4/IOP_C.h> 00006 #include <omniORB4/callDescriptor.h> 00007 #include <omniORB4/callHandle.h> 00008 #include <omniORB4/objTracker.h> 00009 00010 00011 OMNI_USING_NAMESPACE(omni) 00012 00013 static const char* _0RL_library_version = omniORB_4_1; 00014 00015 00016 00017 EchoImageServer_ptr EchoImageServer_Helper::_nil() { 00018 return ::EchoImageServer::_nil(); 00019 } 00020 00021 ::CORBA::Boolean EchoImageServer_Helper::is_nil(::EchoImageServer_ptr p) { 00022 return ::CORBA::is_nil(p); 00023 00024 } 00025 00026 void EchoImageServer_Helper::release(::EchoImageServer_ptr p) { 00027 ::CORBA::release(p); 00028 } 00029 00030 void EchoImageServer_Helper::marshalObjRef(::EchoImageServer_ptr obj, cdrStream& s) { 00031 ::EchoImageServer::_marshalObjRef(obj, s); 00032 } 00033 00034 EchoImageServer_ptr EchoImageServer_Helper::unmarshalObjRef(cdrStream& s) { 00035 return ::EchoImageServer::_unmarshalObjRef(s); 00036 } 00037 00038 void EchoImageServer_Helper::duplicate(::EchoImageServer_ptr obj) { 00039 if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); 00040 } 00041 00042 EchoImageServer_ptr 00043 EchoImageServer::_duplicate(::EchoImageServer_ptr obj) 00044 { 00045 if( obj && !obj->_NP_is_nil() ) omni::duplicateObjRef(obj); 00046 return obj; 00047 } 00048 00049 EchoImageServer_ptr 00050 EchoImageServer::_narrow(::CORBA::Object_ptr obj) 00051 { 00052 if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); 00053 _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId); 00054 return e ? e : _nil(); 00055 } 00056 00057 00058 EchoImageServer_ptr 00059 EchoImageServer::_unchecked_narrow(::CORBA::Object_ptr obj) 00060 { 00061 if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil(); 00062 _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId); 00063 return e ? e : _nil(); 00064 } 00065 00066 EchoImageServer_ptr 00067 EchoImageServer::_nil() 00068 { 00069 #ifdef OMNI_UNLOADABLE_STUBS 00070 static _objref_EchoImageServer _the_nil_obj; 00071 return &_the_nil_obj; 00072 #else 00073 static _objref_EchoImageServer* _the_nil_ptr = 0; 00074 if( !_the_nil_ptr ) { 00075 omni::nilRefLock().lock(); 00076 if( !_the_nil_ptr ) { 00077 _the_nil_ptr = new _objref_EchoImageServer; 00078 registerNilCorbaObject(_the_nil_ptr); 00079 } 00080 omni::nilRefLock().unlock(); 00081 } 00082 return _the_nil_ptr; 00083 #endif 00084 } 00085 00086 const char* EchoImageServer::_PD_repoId = "IDL:EchoImageServer:1.0"; 00087 00088 00089 _objref_EchoImageServer::~_objref_EchoImageServer() { 00090 00091 } 00092 00093 00094 _objref_EchoImageServer::_objref_EchoImageServer(omniIOR* ior, omniIdentity* id) : 00095 omniObjRef(::EchoImageServer::_PD_repoId, ior, id, 1) 00096 00097 00098 { 00099 _PR_setobj(this); 00100 } 00101 00102 void* 00103 _objref_EchoImageServer::_ptrToObjRef(const char* id) 00104 { 00105 if( id == ::EchoImageServer::_PD_repoId ) 00106 return (::EchoImageServer_ptr) this; 00107 00108 if( id == ::CORBA::Object::_PD_repoId ) 00109 return (::CORBA::Object_ptr) this; 00110 00111 if( omni::strMatch(id, ::EchoImageServer::_PD_repoId) ) 00112 return (::EchoImageServer_ptr) this; 00113 00114 if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) 00115 return (::CORBA::Object_ptr) this; 00116 00117 return 0; 00118 } 00119 00120 // Proxy call descriptor class. Mangled signature: 00121 // _cImageOrb_i_cImageOrb 00122 class _0RL_cd_97112014c61d6e2e_00000000 00123 : public omniCallDescriptor 00124 { 00125 public: 00126 inline _0RL_cd_97112014c61d6e2e_00000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): 00127 omniCallDescriptor(lcfn, op_, oplen, 0, 0, 0, upcall) 00128 { 00129 00130 } 00131 00132 void marshalArguments(cdrStream&); 00133 void unmarshalArguments(cdrStream&); 00134 00135 void unmarshalReturnedValues(cdrStream&); 00136 void marshalReturnedValues(cdrStream&); 00137 00138 00139 ImageOrb_var arg_0_; 00140 const ImageOrb* arg_0; 00141 ImageOrb_var result; 00142 }; 00143 00144 void _0RL_cd_97112014c61d6e2e_00000000::marshalArguments(cdrStream& _n) 00145 { 00146 (const ImageOrb&) *arg_0 >>= _n; 00147 00148 } 00149 00150 void _0RL_cd_97112014c61d6e2e_00000000::unmarshalArguments(cdrStream& _n) 00151 { 00152 arg_0_ = new ImageOrb; 00153 (ImageOrb&)arg_0_ <<= _n; 00154 arg_0 = &arg_0_.in(); 00155 00156 } 00157 00158 void _0RL_cd_97112014c61d6e2e_00000000::marshalReturnedValues(cdrStream& _n) 00159 { 00160 (const ImageOrb&) result >>= _n; 00161 00162 } 00163 00164 void _0RL_cd_97112014c61d6e2e_00000000::unmarshalReturnedValues(cdrStream& _n) 00165 { 00166 result = new ImageOrb; 00167 (ImageOrb&)result <<= _n; 00168 00169 } 00170 00171 // Local call call-back function. 00172 static void 00173 _0RL_lcfn_97112014c61d6e2e_10000000(omniCallDescriptor* cd, omniServant* svnt) 00174 { 00175 _0RL_cd_97112014c61d6e2e_00000000* tcd = (_0RL_cd_97112014c61d6e2e_00000000*)cd; 00176 _impl_EchoImageServer* impl = (_impl_EchoImageServer*) svnt->_ptrToInterface(EchoImageServer::_PD_repoId); 00177 tcd->result = impl->echo(*tcd->arg_0); 00178 00179 00180 } 00181 00182 ImageOrb* _objref_EchoImageServer::echo(const ImageOrb& img) 00183 { 00184 _0RL_cd_97112014c61d6e2e_00000000 _call_desc(_0RL_lcfn_97112014c61d6e2e_10000000, "echo", 5); 00185 _call_desc.arg_0 = &(ImageOrb&) img; 00186 00187 _invoke(_call_desc); 00188 return _call_desc.result._retn(); 00189 00190 00191 } 00192 // Proxy call descriptor class. Mangled signature: 00193 // void 00194 class _0RL_cd_97112014c61d6e2e_20000000 00195 : public omniCallDescriptor 00196 { 00197 public: 00198 inline _0RL_cd_97112014c61d6e2e_20000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0): 00199 omniCallDescriptor(lcfn, op_, oplen, 0, 0, 0, upcall) 00200 { 00201 00202 } 00203 00204 00205 00206 00207 00208 }; 00209 00210 // Local call call-back function. 00211 static void 00212 _0RL_lcfn_97112014c61d6e2e_30000000(omniCallDescriptor*, omniServant* svnt) 00213 { 00214 00215 _impl_EchoImageServer* impl = (_impl_EchoImageServer*) svnt->_ptrToInterface(EchoImageServer::_PD_repoId); 00216 impl->shutdown(); 00217 00218 00219 } 00220 00221 void _objref_EchoImageServer::shutdown() 00222 { 00223 _0RL_cd_97112014c61d6e2e_20000000 _call_desc(_0RL_lcfn_97112014c61d6e2e_30000000, "shutdown", 9); 00224 00225 00226 _invoke(_call_desc); 00227 00228 00229 00230 } 00231 _pof_EchoImageServer::~_pof_EchoImageServer() {} 00232 00233 00234 omniObjRef* 00235 _pof_EchoImageServer::newObjRef(omniIOR* ior, omniIdentity* id) 00236 { 00237 return new ::_objref_EchoImageServer(ior, id); 00238 } 00239 00240 00241 ::CORBA::Boolean 00242 _pof_EchoImageServer::is_a(const char* id) const 00243 { 00244 if( omni::ptrStrMatch(id, ::EchoImageServer::_PD_repoId) ) 00245 return 1; 00246 00247 return 0; 00248 } 00249 00250 const _pof_EchoImageServer _the_pof_EchoImageServer; 00251 00252 _impl_EchoImageServer::~_impl_EchoImageServer() {} 00253 00254 00255 ::CORBA::Boolean 00256 _impl_EchoImageServer::_dispatch(omniCallHandle& _handle) 00257 { 00258 const char* op = _handle.operation_name(); 00259 00260 if( omni::strMatch(op, "echo") ) { 00261 00262 _0RL_cd_97112014c61d6e2e_00000000 _call_desc(_0RL_lcfn_97112014c61d6e2e_10000000, "echo", 5, 1); 00263 00264 _handle.upcall(this,_call_desc); 00265 return 1; 00266 } 00267 00268 if( omni::strMatch(op, "shutdown") ) { 00269 00270 _0RL_cd_97112014c61d6e2e_20000000 _call_desc(_0RL_lcfn_97112014c61d6e2e_30000000, "shutdown", 9, 1); 00271 00272 _handle.upcall(this,_call_desc); 00273 return 1; 00274 } 00275 00276 00277 return 0; 00278 } 00279 00280 void* 00281 _impl_EchoImageServer::_ptrToInterface(const char* id) 00282 { 00283 if( id == ::EchoImageServer::_PD_repoId ) 00284 return (::_impl_EchoImageServer*) this; 00285 00286 if( id == ::CORBA::Object::_PD_repoId ) 00287 return (void*) 1; 00288 00289 if( omni::strMatch(id, ::EchoImageServer::_PD_repoId) ) 00290 return (::_impl_EchoImageServer*) this; 00291 00292 if( omni::strMatch(id, ::CORBA::Object::_PD_repoId) ) 00293 return (void*) 1; 00294 return 0; 00295 } 00296 00297 const char* 00298 _impl_EchoImageServer::_mostDerivedRepoId() 00299 { 00300 return ::EchoImageServer::_PD_repoId; 00301 } 00302 00303 POA_EchoImageServer::~POA_EchoImageServer() {} 00304