crazy_rider | J'ai fait une application client serveur en utilisant ICE. Je l'ai ecrite en Java.
Jusque la pas de problemes.
Maintenant, il faut que je fasse la meme chose en C++. Le probleme est que je n'ai pas tres bonnes connaissances dans ce langage.
J'ai ecrit le serveur, mais il y a des erreurs de compilation. Je n'arrive pas a les corriger. J'utilise VC++6.
Je met les sources en java , puis celles en c++
Pour le java, tout va bien. Pouvez me dire ce qui ne va pas dans mon prog en c++
Java
Code :
- //Hello.ice
- module Demo {
- sequence<double> array; //new type : array is an array of double
- class Transmit {
- int a;
- array arr ;//array of double
- };
- interface Hello {
- nonmutating void sayHello(string s);
- Transmit setClass(int a, double d1, double d2, double d3);
- void sendClass(Transmit trans);
- };
- };
|
Code :
- import Demo.*;
- import java.io.*;
- class HelloI extends Demo._HelloDisp {
- public void sayHello(String s, Ice.Current current) {
- System.out.println(s);
- }
- public Transmit setClass(int a, double d1, double d2, double d3, Ice.Current current) {
- double arr[] = new double[3];
- arr[0] = d1;
- arr[1] = d2;
- arr[2] = d3;
- Transmit trans = new Transmit(a, arr);
- return trans;
- }
- public void sendClass(Transmit trans,Ice.Current current) {
- double arr[] = {0, 0, 0};
- Transmit trans_serv = new Transmit(0, arr);
- trans_serv.a = trans.a;
- for (int i = 0; i < trans.arr.length; i++) trans_serv.arr[i] = trans.arr[i];
- }
- }
- public class Server {
- public static void main (String []args) {
- int status = 0;
- Ice.Communicator ic = null;
- try {
- ic = Ice.Util.initialize(args);
- Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints("SimpleHelloAdapter", "default -p 11111" );
- Ice.Object object = new HelloI();
- adapter.add(object, Ice.Util.stringToIdentity("SimpleHello" ));
- adapter.activate();
- ic.waitForShutdown();
- } catch (Ice.LocalException e) {
- e.printStackTrace();
- status = 1;
- } catch (Exception e) {
- System.err.println(e.getMessage());
- status = 1;
- }
- if(ic != null) {
- try {
- ic.destroy();
- } catch (Exception e) {
- System.out.println(e.getMessage());
- status = 1;
- }
- }
- System.exit(status);
- } //main
- } // Server
|
C++
Code :
- // **********************************************************************
- //
- // Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
- //
- // This copy of Ice is licensed to you under the terms described in the
- // ICE_LICENSE file included in this distribution.
- //
- // **********************************************************************
- #ifndef HELLO_I_H
- #define HELLO_I_H
- #include <Hello.h>
- using namespace Demo;
- using namespace std;
- class HelloI : public Demo::Hello
- {
- public:
- void sayHello(const string& s, const Ice::Current& );
- Transmit setClass(const int a, double d1, double d2, double d3, const Ice::Current& );
- void sendClass(Transmit trans, const Ice::Current& );
- };
- #endif
|
Code :
- // **********************************************************************
- //
- // Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
- //
- // This copy of Ice is licensed to you under the terms described in the
- // ICE_LICENSE file included in this distribution.
- //
- // **********************************************************************
- #include <HelloI.h>
- #include <Ice/Ice.h>
- using namespace std;
- void
- HelloI::sayHello(const string& s, const Ice::Current& )
- {
- cout << s << endl;
- }
- Transmit
- HelloI::setClass(const int a, double d1, double d2, double d3, const Ice::Current & )
- {
- Transmit trans ;
- trans.a = a;
- trans.arr[0] = d1;
- trans.arr[1] = d2;
- trans.arr[2] = d3;
- cout << "dans setClass" << endl;
- //Transmit trans = new trans (a, arr);
- cout << trans.a << endl;
- return (trans);
- }
- void
- HelloI::sendClass(Transmit trans, const Ice::Current& )
- {
- Transmit new_trans ;
- new_trans.a = trans.a;
- for (int i = 0; i < 3; i++) new_trans.arr[i] = trans.arr[i];
- }
|
Code :
- // **********************************************************************
- //
- // Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
- //
- // This copy of Ice is licensed to you under the terms described in the
- // ICE_LICENSE file included in this distribution.
- //
- // **********************************************************************
- #include <HelloI.h>
- #include <Ice/Ice.h>
- using namespace std;
- using namespace Demo;
- int
- main(int argc, char* argv[])
- {
- int status = EXIT_SUCCESS;
- Ice::CommunicatorPtr communicator;
- try
- {
- communicator = Ice::initialize(argc, argv);
- Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("SimpleHelloAdapter", "tcp -p 10000" );
- Ice::ObjectPtr object = new HelloI;
- adapter->add(object, Ice::stringToIdentity("SimpleHello" ));
- adapter->activate();
- communicator->waitForShutdown();
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
- if(communicator)
- {
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
- }
- return status;
- }
|
les fichiers hello.h et hello.cpp sont generes automatiquement
Code :
- // **********************************************************************
- //
- // Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
- //
- // This copy of Ice is licensed to you under the terms described in the
- // ICE_LICENSE file included in this distribution.
- //
- // **********************************************************************
- // Ice version 3.0.1
- // Generated from file `Hello.ice'
- #ifndef __Hello_h__
- #define __Hello_h__
- #include <Ice/LocalObjectF.h>
- #include <Ice/ProxyF.h>
- #include <Ice/ObjectF.h>
- #include <Ice/Exception.h>
- #include <Ice/LocalObject.h>
- #include <Ice/Proxy.h>
- #include <Ice/Object.h>
- #include <Ice/Outgoing.h>
- #include <Ice/Incoming.h>
- #include <Ice/Direct.h>
- #include <Ice/FactoryTable.h>
- #include <Ice/StreamF.h>
- #include <Ice/UndefSysMacros.h>
- #ifndef ICE_IGNORE_VERSION
- # if ICE_INT_VERSION / 100 != 300
- # error Ice version mismatch!
- # endif
- # if ICE_INT_VERSION % 100 < 1
- # error Ice patch level mismatch!
- # endif
- #endif
- namespace IceProxy
- {
- namespace Demo
- {
- class Transmit;
- bool operator==(const Transmit&, const Transmit& );
- bool operator!=(const Transmit&, const Transmit& );
- bool operator<(const Transmit&, const Transmit& );
- class Hello;
- bool operator==(const Hello&, const Hello& );
- bool operator!=(const Hello&, const Hello& );
- bool operator<(const Hello&, const Hello& );
- }
- }
- namespace Demo
- {
- class Transmit;
- bool operator==(const Transmit&, const Transmit& );
- bool operator!=(const Transmit&, const Transmit& );
- bool operator<(const Transmit&, const Transmit& );
- class Hello;
- bool operator==(const Hello&, const Hello& );
- bool operator!=(const Hello&, const Hello& );
- bool operator<(const Hello&, const Hello& );
- }
- namespace IceInternal
- {
- void incRef(::Demo::Transmit*);
- void decRef(::Demo::Transmit*);
- void incRef(::IceProxy::Demo::Transmit*);
- void decRef(::IceProxy::Demo::Transmit*);
- void incRef(::Demo::Hello*);
- void decRef(::Demo::Hello*);
- void incRef(::IceProxy::Demo::Hello*);
- void decRef(::IceProxy::Demo::Hello*);
- }
- namespace Demo
- {
- typedef ::IceInternal::Handle< ::Demo::Transmit> TransmitPtr;
- typedef ::IceInternal::ProxyHandle< ::IceProxy::Demo::Transmit> TransmitPrx;
- void __write(::IceInternal::BasicStream*, const TransmitPrx& );
- void __read(::IceInternal::BasicStream*, TransmitPrx& );
- void __write(::IceInternal::BasicStream*, const TransmitPtr& );
- void __patch__TransmitPtr(void*, ::Ice::ObjectPtr& );
- typedef ::IceInternal::Handle< ::Demo::Hello> HelloPtr;
- typedef ::IceInternal::ProxyHandle< ::IceProxy::Demo::Hello> HelloPrx;
- void __write(::IceInternal::BasicStream*, const HelloPrx& );
- void __read(::IceInternal::BasicStream*, HelloPrx& );
- void __write(::IceInternal::BasicStream*, const HelloPtr& );
- void __patch__HelloPtr(void*, ::Ice::ObjectPtr& );
- }
- namespace Demo
- {
- typedef ::std::vector< ::Ice::Double> array;
- }
- namespace IceProxy
- {
- namespace Demo
- {
- class Transmit : virtual public ::IceProxy::Ice::Object
- {
- public:
-
- static const ::std::string& ice_staticId();
- private:
- virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM();
- virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD();
- };
- class Hello : virtual public ::IceProxy::Ice::Object
- {
- public:
- void sayHello(const ::std::string& );
- void sayHello(const ::std::string&, const ::Ice::Context& );
- ::Demo::TransmitPtr setClass(::Ice::Int, ::Ice::Double, ::Ice::Double, ::Ice::Double);
- ::Demo::TransmitPtr setClass(::Ice::Int, ::Ice::Double, ::Ice::Double, ::Ice::Double, const ::Ice::Context& );
- void sendClass(const ::Demo::TransmitPtr& );
- void sendClass(const ::Demo::TransmitPtr&, const ::Ice::Context& );
-
- static const ::std::string& ice_staticId();
- private:
- virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM();
- virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD();
- };
- }
- }
- namespace IceDelegate
- {
- namespace Demo
- {
- class Transmit : virtual public ::IceDelegate::Ice::Object
- {
- public:
- };
- class Hello : virtual public ::IceDelegate::Ice::Object
- {
- public:
- virtual void sayHello(const ::std::string&, const ::Ice::Context& ) = 0;
- virtual ::Demo::TransmitPtr setClass(::Ice::Int, ::Ice::Double, ::Ice::Double, ::Ice::Double, const ::Ice::Context& ) = 0;
- virtual void sendClass(const ::Demo::TransmitPtr&, const ::Ice::Context& ) = 0;
- };
- }
- }
- namespace IceDelegateM
- {
- namespace Demo
- {
- class Transmit : virtual public ::IceDelegate::Demo::Transmit,
- virtual public ::IceDelegateM::Ice::Object
- {
- public:
- };
- class Hello : virtual public ::IceDelegate::Demo::Hello,
- virtual public ::IceDelegateM::Ice::Object
- {
- public:
- virtual void sayHello(const ::std::string&, const ::Ice::Context& );
- virtual ::Demo::TransmitPtr setClass(::Ice::Int, ::Ice::Double, ::Ice::Double, ::Ice::Double, const ::Ice::Context& );
- virtual void sendClass(const ::Demo::TransmitPtr&, const ::Ice::Context& );
- };
- }
- }
- namespace IceDelegateD
- {
- namespace Demo
- {
- class Transmit : virtual public ::IceDelegate::Demo::Transmit,
- virtual public ::IceDelegateD::Ice::Object
- {
- public:
- };
- class Hello : virtual public ::IceDelegate::Demo::Hello,
- virtual public ::IceDelegateD::Ice::Object
- {
- public:
- virtual void sayHello(const ::std::string&, const ::Ice::Context& );
- virtual ::Demo::TransmitPtr setClass(::Ice::Int, ::Ice::Double, ::Ice::Double, ::Ice::Double, const ::Ice::Context& );
- virtual void sendClass(const ::Demo::TransmitPtr&, const ::Ice::Context& );
- };
- }
- }
- namespace Demo
- {
- class Transmit : virtual public ::Ice::Object
- {
- public:
- Transmit() {};
- Transmit(::Ice::Int, const ::Demo::array& );
- virtual ::Ice::ObjectPtr ice_clone() const;
- virtual bool ice_isA(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) const;
- virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::Current()) const;
- virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::Current()) const;
- static const ::std::string& ice_staticId();
- ::Ice::Int a;
- ::Demo::array arr;
- virtual void __write(::IceInternal::BasicStream*) const;
- virtual void __read(::IceInternal::BasicStream*, bool);
- virtual void __write(const ::Ice::OutputStreamPtr& ) const;
- virtual void __read(const ::Ice::InputStreamPtr&, bool);
- static const ::Ice::ObjectFactoryPtr& ice_factory();
- };
- static ::Demo::Transmit __Transmit_init;
- void __patch__TransmitPtr(void*, ::Ice::ObjectPtr& );
- class Hello : virtual public ::Ice::Object
- {
- public:
- virtual ::Ice::ObjectPtr ice_clone() const;
- virtual bool ice_isA(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) const;
- virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::Current()) const;
- virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::Current()) const;
- static const ::std::string& ice_staticId();
- virtual void sayHello(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) const = 0;
- ::IceInternal::DispatchStatus ___sayHello(::IceInternal::Incoming&, const ::Ice::Current& ) const;
- virtual ::Demo::TransmitPtr setClass(::Ice::Int, ::Ice::Double, ::Ice::Double, ::Ice::Double, const ::Ice::Current& = ::Ice::Current()) = 0;
- ::IceInternal::DispatchStatus ___setClass(::IceInternal::Incoming&, const ::Ice::Current& );
- virtual void sendClass(const ::Demo::TransmitPtr&, const ::Ice::Current& = ::Ice::Current()) = 0;
- ::IceInternal::DispatchStatus ___sendClass(::IceInternal::Incoming&, const ::Ice::Current& );
- virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current& );
- virtual void __write(::IceInternal::BasicStream*) const;
- virtual void __read(::IceInternal::BasicStream*, bool);
- virtual void __write(const ::Ice::OutputStreamPtr& ) const;
- virtual void __read(const ::Ice::InputStreamPtr&, bool);
- };
- void __patch__HelloPtr(void*, ::Ice::ObjectPtr& );
- }
- #endif
|
Code :
- // **********************************************************************
- //
- // Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
- //
- // This copy of Ice is licensed to you under the terms described in the
- // ICE_LICENSE file included in this distribution.
- //
- // **********************************************************************
- // Ice version 3.0.1
- // Generated from file `Hello.ice'
- #include <Hello.h>
- #include <Ice/LocalException.h>
- #include <Ice/ObjectFactory.h>
- #include <Ice/BasicStream.h>
- #include <Ice/Object.h>
- #ifndef ICE_IGNORE_VERSION
- # if ICE_INT_VERSION / 100 != 300
- # error Ice version mismatch!
- # endif
- # if ICE_INT_VERSION % 100 < 1
- # error Ice patch level mismatch!
- # endif
- #endif
- void
- IceInternal::incRef(::Demo::Transmit* p)
- {
- p->__incRef();
- }
- void
- IceInternal::decRef(::Demo::Transmit* p)
- {
- p->__decRef();
- }
- void
- IceInternal::incRef(::IceProxy::Demo::Transmit* p)
- {
- p->__incRef();
- }
- void
- IceInternal::decRef(::IceProxy::Demo::Transmit* p)
- {
- p->__decRef();
- }
- void
- IceInternal::incRef(::Demo::Hello* p)
- {
- p->__incRef();
- }
- void
- IceInternal::decRef(::Demo::Hello* p)
- {
- p->__decRef();
- }
- void
- IceInternal::incRef(::IceProxy::Demo::Hello* p)
- {
- p->__incRef();
- }
- void
- IceInternal::decRef(::IceProxy::Demo::Hello* p)
- {
- p->__decRef();
- }
- void
- Demo::__write(::IceInternal::BasicStream* __os, const ::Demo::TransmitPrx& v)
- {
- __os->write(::Ice::ObjectPrx(v));
- }
- void
- Demo::__read(::IceInternal::BasicStream* __is, ::Demo::TransmitPrx& v)
- {
- ::Ice::ObjectPrx proxy;
- __is->read(proxy);
- if(!proxy)
- {
- v = 0;
- }
- else
- {
- v = new ::IceProxy::Demo::Transmit;
- v->__copyFrom(proxy);
- }
- }
- void
- Demo::__write(::IceInternal::BasicStream* __os, const ::Demo::TransmitPtr& v)
- {
- __os->write(::Ice::ObjectPtr(v));
- }
- void
- Demo::__write(::IceInternal::BasicStream* __os, const ::Demo::HelloPrx& v)
- {
- __os->write(::Ice::ObjectPrx(v));
- }
- void
- Demo::__read(::IceInternal::BasicStream* __is, ::Demo::HelloPrx& v)
- {
- ::Ice::ObjectPrx proxy;
- __is->read(proxy);
- if(!proxy)
- {
- v = 0;
- }
- else
- {
- v = new ::IceProxy::Demo::Hello;
- v->__copyFrom(proxy);
- }
- }
- void
- Demo::__write(::IceInternal::BasicStream* __os, const ::Demo::HelloPtr& v)
- {
- __os->write(::Ice::ObjectPtr(v));
- }
- const ::std::string&
- IceProxy::Demo::Transmit::ice_staticId()
- {
- return ::Demo::Transmit::ice_staticId();
- }
- ::IceInternal::Handle< ::IceDelegateM::Ice::Object>
- IceProxy::Demo::Transmit::__createDelegateM()
- {
- return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>(new ::IceDelegateM::Demo::Transmit);
- }
- ::IceInternal::Handle< ::IceDelegateD::Ice::Object>
- IceProxy::Demo::Transmit::__createDelegateD()
- {
- return ::IceInternal::Handle< ::IceDelegateD::Ice::Object>(new ::IceDelegateD::Demo::Transmit);
- }
- bool
- IceProxy::Demo::operator==(const ::IceProxy::Demo::Transmit& l, const ::IceProxy::Demo::Transmit& r)
- {
- return static_cast<const ::IceProxy::Ice::Object&>(l) == static_cast<const ::IceProxy::Ice::Object&>(r);
- }
- bool
- IceProxy::Demo::operator!=(const ::IceProxy::Demo::Transmit& l, const ::IceProxy::Demo::Transmit& r)
- {
- return static_cast<const ::IceProxy::Ice::Object&>(l) != static_cast<const ::IceProxy::Ice::Object&>(r);
- }
- bool
- IceProxy::Demo::operator<(const ::IceProxy::Demo::Transmit& l, const ::IceProxy::Demo::Transmit& r)
- {
- return static_cast<const ::IceProxy::Ice::Object&>(l) < static_cast<const ::IceProxy::Ice::Object&>(r);
- }
- void
- IceProxy::Demo::Hello::sayHello(const ::std::string& s)
- {
- sayHello(s, __defaultContext());
- }
- void
- IceProxy::Demo::Hello::sayHello(const ::std::string& s, const ::Ice::Context& __ctx)
- {
- int __cnt = 0;
- while(true)
- {
- try
- {
- ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
- ::IceDelegate::Demo::Hello* __del = dynamic_cast< ::IceDelegate::Demo::Hello*>(__delBase.get());
- __del->sayHello(s, __ctx);
- return;
- }
- catch(const ::IceInternal::NonRepeatable& __ex)
- {
- __handleException(*__ex.get(), __cnt);
- }
- catch(const ::Ice::LocalException& __ex)
- {
- __handleException(__ex, __cnt);
- }
- }
- }
- ::Demo::TransmitPtr
- IceProxy::Demo::Hello::setClass(::Ice::Int a, ::Ice::Double d1, ::Ice::Double d2, ::Ice::Double d3)
- {
- return setClass(a, d1, d2, d3, __defaultContext());
- }
- ::Demo::TransmitPtr
- IceProxy::Demo::Hello::setClass(::Ice::Int a, ::Ice::Double d1, ::Ice::Double d2, ::Ice::Double d3, const ::Ice::Context& __ctx)
- {
- int __cnt = 0;
- while(true)
- {
- try
- {
- __checkTwowayOnly("setClass" );
- ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
- ::IceDelegate::Demo::Hello* __del = dynamic_cast< ::IceDelegate::Demo::Hello*>(__delBase.get());
- return __del->setClass(a, d1, d2, d3, __ctx);
- }
- catch(const ::IceInternal::NonRepeatable& __ex)
- {
- __handleException(*__ex.get(), __cnt);
- }
- catch(const ::Ice::LocalException& __ex)
- {
- __handleException(__ex, __cnt);
- }
- }
- }
- void
- IceProxy::Demo::Hello::sendClass(const ::Demo::TransmitPtr& trans)
- {
- sendClass(trans, __defaultContext());
- }
- void
- IceProxy::Demo::Hello::sendClass(const ::Demo::TransmitPtr& trans, const ::Ice::Context& __ctx)
- {
- int __cnt = 0;
- while(true)
- {
- try
- {
- ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
- ::IceDelegate::Demo::Hello* __del = dynamic_cast< ::IceDelegate::Demo::Hello*>(__delBase.get());
- __del->sendClass(trans, __ctx);
- return;
- }
- catch(const ::IceInternal::NonRepeatable& __ex)
- {
- __handleException(*__ex.get(), __cnt);
- }
- catch(const ::Ice::LocalException& __ex)
- {
- __handleException(__ex, __cnt);
- }
- }
- }
- const ::std::string&
- IceProxy::Demo::Hello::ice_staticId()
- {
- return ::Demo::Hello::ice_staticId();
- }
- ::IceInternal::Handle< ::IceDelegateM::Ice::Object>
- IceProxy::Demo::Hello::__createDelegateM()
- {
- return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>(new ::IceDelegateM::Demo::Hello);
- }
- ::IceInternal::Handle< ::IceDelegateD::Ice::Object>
- IceProxy::Demo::Hello::__createDelegateD()
- {
- return ::IceInternal::Handle< ::IceDelegateD::Ice::Object>(new ::IceDelegateD::Demo::Hello);
- }
- bool
- IceProxy::Demo::operator==(const ::IceProxy::Demo::Hello& l, const ::IceProxy::Demo::Hello& r)
- {
- return static_cast<const ::IceProxy::Ice::Object&>(l) == static_cast<const ::IceProxy::Ice::Object&>(r);
- }
- bool
- IceProxy::Demo::operator!=(const ::IceProxy::Demo::Hello& l, const ::IceProxy::Demo::Hello& r)
- {
- return static_cast<const ::IceProxy::Ice::Object&>(l) != static_cast<const ::IceProxy::Ice::Object&>(r);
- }
- bool
- IceProxy::Demo::operator<(const ::IceProxy::Demo::Hello& l, const ::IceProxy::Demo::Hello& r)
- {
- return static_cast<const ::IceProxy::Ice::Object&>(l) < static_cast<const ::IceProxy::Ice::Object&>(r);
- }
- static const ::std::string __Demo__Hello__sayHello_name = "sayHello";
- void
- IceDelegateM::Demo::Hello::sayHello(const ::std::string& s, const ::Ice::Context& __context)
- {
- ::IceInternal::Outgoing __og(__connection.get(), __reference.get(), __Demo__Hello__sayHello_name, ::Ice::Nonmutating, __context, __compress);
- try
- {
- ::IceInternal::BasicStream* __os = __og.os();
- __os->write(s);
- }
- catch(const ::Ice::LocalException& __ex)
- {
- __og.abort(__ex);
- }
- bool __ok = __og.invoke();
- try
- {
- ::IceInternal::BasicStream* __is = __og.is();
- if(!__ok)
- {
- try
- {
- __is->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
- }
- }
- catch(const ::Ice::LocalException& __ex)
- {
- throw ::IceInternal::NonRepeatable(__ex);
- }
- }
- static const ::std::string __Demo__Hello__setClass_name = "setClass";
- ::Demo::TransmitPtr
- IceDelegateM::Demo::Hello::setClass(::Ice::Int a, ::Ice::Double d1, ::Ice::Double d2, ::Ice::Double d3, const ::Ice::Context& __context)
- {
- ::IceInternal::Outgoing __og(__connection.get(), __reference.get(), __Demo__Hello__setClass_name, ::Ice::Idempotent, __context, __compress);
- try
- {
- ::IceInternal::BasicStream* __os = __og.os();
- __os->write(a);
- __os->write(d1);
- __os->write(d2);
- __os->write(d3);
- }
- catch(const ::Ice::LocalException& __ex)
- {
- __og.abort(__ex);
- }
- bool __ok = __og.invoke();
- try
- {
- ::IceInternal::BasicStream* __is = __og.is();
- if(!__ok)
- {
- try
- {
- __is->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
- }
- ::Demo::TransmitPtr __ret;
- __is->read(::Demo::__patch__TransmitPtr, &__ret);
- __is->readPendingObjects();
- return __ret;
- }
- catch(const ::Ice::LocalException& __ex)
- {
- throw ::IceInternal::NonRepeatable(__ex);
- }
- }
- static const ::std::string __Demo__Hello__sendClass_name = "sendClass";
- void
- IceDelegateM::Demo::Hello::sendClass(const ::Demo::TransmitPtr& trans, const ::Ice::Context& __context)
- {
- ::IceInternal::Outgoing __og(__connection.get(), __reference.get(), __Demo__Hello__sendClass_name, ::Ice::Idempotent, __context, __compress);
- try
- {
- ::IceInternal::BasicStream* __os = __og.os();
- ::Demo::__write(__os, trans);
- __os->writePendingObjects();
- }
- catch(const ::Ice::LocalException& __ex)
- {
- __og.abort(__ex);
- }
- bool __ok = __og.invoke();
- try
- {
- ::IceInternal::BasicStream* __is = __og.is();
- if(!__ok)
- {
- try
- {
- __is->throwException();
- }
- catch(const ::Ice::UserException& __ex)
- {
- throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
- }
- }
- }
- catch(const ::Ice::LocalException& __ex)
- {
- throw ::IceInternal::NonRepeatable(__ex);
- }
- }
- void
- IceDelegateD::Demo::Hello::sayHello(const ::std::string& s, const ::Ice::Context& __context)
- {
- ::Ice::Current __current;
- __initCurrent(__current, "sayHello", ::Ice::Nonmutating, __context);
- while(true)
- {
- ::IceInternal::Direct __direct(__current);
- ::Demo::Hello* __servant = dynamic_cast< ::Demo::Hello*>(__direct.servant().get());
- if(!__servant)
- {
- ::Ice::OperationNotExistException __opEx(__FILE__, __LINE__);
- __opEx.id = __current.id;
- __opEx.facet = __current.facet;
- __opEx.operation = __current.operation;
- throw __opEx;
- }
- try
- {
- __servant->sayHello(s, __current);
- return;
- }
- catch(const ::Ice::LocalException& __ex)
- {
- throw ::IceInternal::NonRepeatable(__ex);
- }
- }
- }
- ::Demo::TransmitPtr
- IceDelegateD::Demo::Hello::setClass(::Ice::Int a, ::Ice::Double d1, ::Ice::Double d2, ::Ice::Double d3, const ::Ice::Context& __context)
- {
- ::Ice::Current __current;
- __initCurrent(__current, "setClass", ::Ice::Idempotent, __context);
- while(true)
- {
- ::IceInternal::Direct __direct(__current);
- ::Demo::Hello* __servant = dynamic_cast< ::Demo::Hello*>(__direct.servant().get());
- if(!__servant)
- {
- ::Ice::OperationNotExistException __opEx(__FILE__, __LINE__);
- __opEx.id = __current.id;
- __opEx.facet = __current.facet;
- __opEx.operation = __current.operation;
- throw __opEx;
- }
- try
- {
- return __servant->setClass(a, d1, d2, d3, __current);
- }
- catch(const ::Ice::LocalException& __ex)
- {
- throw ::IceInternal::NonRepeatable(__ex);
- }
- }
- }
- void
- IceDelegateD::Demo::Hello::sendClass(const ::Demo::TransmitPtr& trans, const ::Ice::Context& __context)
- {
- ::Ice::Current __current;
- __initCurrent(__current, "sendClass", ::Ice::Idempotent, __context);
- while(true)
- {
- ::IceInternal::Direct __direct(__current);
- ::Demo::Hello* __servant = dynamic_cast< ::Demo::Hello*>(__direct.servant().get());
- if(!__servant)
- {
- ::Ice::OperationNotExistException __opEx(__FILE__, __LINE__);
- __opEx.id = __current.id;
- __opEx.facet = __current.facet;
- __opEx.operation = __current.operation;
- throw __opEx;
- }
- try
- {
- __servant->sendClass(trans, __current);
- return;
- }
- catch(const ::Ice::LocalException& __ex)
- {
- throw ::IceInternal::NonRepeatable(__ex);
- }
- }
- }
- Demo::Transmit::Transmit(::Ice::Int __ice_a, const ::Demo::array& __ice_arr) :
- a(__ice_a),
- arr(__ice_arr)
- {
- }
- ::Ice::ObjectPtr
- Demo::Transmit::ice_clone() const
- {
- ::Demo::TransmitPtr __p = new ::Demo::Transmit(*this);
- return __p;
- }
- static const ::std::string __Demo__Transmit_ids[2] =
- {
- "::Demo::Transmit",
- "::Ice::Object"
- };
- bool
- Demo::Transmit::ice_isA(const ::std::string& _s, const ::Ice::Current& ) const
- {
- return ::std::binary_search(__Demo__Transmit_ids, __Demo__Transmit_ids + 2, _s);
- }
- ::std::vector< ::std::string>
- Demo::Transmit::ice_ids(const ::Ice::Current& ) const
- {
- return ::std::vector< ::std::string>(&__Demo__Transmit_ids[0], &__Demo__Transmit_ids[2]);
- }
- const ::std::string&
- Demo::Transmit::ice_id(const ::Ice::Current& ) const
- {
- return __Demo__Transmit_ids[0];
- }
- const ::std::string&
- Demo::Transmit::ice_staticId()
- {
- return __Demo__Transmit_ids[0];
- }
- void
- Demo::Transmit::__write(::IceInternal::BasicStream* __os) const
- {
- __os->writeTypeId(ice_staticId());
- __os->startWriteSlice();
- __os->write(a);
- __os->write(arr);
- __os->endWriteSlice();
- #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
- Object::__write(__os);
- #else
- ::Ice::Object::__write(__os);
- #endif
- }
- void
- Demo::Transmit::__read(::IceInternal::BasicStream* __is, bool __rid)
- {
- if(__rid)
- {
- ::std::string myId;
- __is->readTypeId(myId);
- }
- __is->startReadSlice();
- __is->read(a);
- __is->read(arr);
- __is->endReadSlice();
- #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
- Object::__read(__is, true);
- #else
- ::Ice::Object::__read(__is, true);
- #endif
- }
- void
- Demo::Transmit::__write(const ::Ice::OutputStreamPtr& ) const
- {
- Ice::MarshalException ex(__FILE__, __LINE__);
- ex.reason = "type Demo::Transmit was not generated with stream support";
- throw ex;
- }
- void
- Demo::Transmit::__read(const ::Ice::InputStreamPtr&, bool)
- {
- Ice::MarshalException ex(__FILE__, __LINE__);
- ex.reason = "type Demo::Transmit was not generated with stream support";
- throw ex;
- }
- class __F__Demo__Transmit : public ::Ice::ObjectFactory
- {
- public:
- virtual ::Ice::ObjectPtr
- create(const ::std::string& type)
- {
- assert(type == ::Demo::Transmit::ice_staticId());
- return new ::Demo::Transmit;
- }
- virtual void
- destroy()
- {
- }
- };
- static ::Ice::ObjectFactoryPtr __F__Demo__Transmit_Ptr = new __F__Demo__Transmit;
- const ::Ice::ObjectFactoryPtr&
- Demo::Transmit::ice_factory()
- {
- return __F__Demo__Transmit_Ptr;
- }
- class __F__Demo__Transmit__Init
- {
- public:
- __F__Demo__Transmit__Init()
- {
- ::IceInternal::factoryTable->addObjectFactory(::Demo::Transmit::ice_staticId(), ::Demo::Transmit::ice_factory());
- }
- ~__F__Demo__Transmit__Init()
- {
- ::IceInternal::factoryTable->removeObjectFactory(::Demo::Transmit::ice_staticId());
- }
- };
- static __F__Demo__Transmit__Init __F__Demo__Transmit__i;
- #ifdef __APPLE__
- extern "C" { void __F__Demo__Transmit__initializer() {} }
- #endif
- void
- Demo::__patch__TransmitPtr(void* __addr, ::Ice::ObjectPtr& v)
- {
- ::Demo::TransmitPtr* p = static_cast< ::Demo::TransmitPtr*>(__addr);
- assert(p);
- *p = ::Demo::TransmitPtr::dynamicCast(v);
- if(v && !*p)
- {
- ::Ice::NoObjectFactoryException e(__FILE__, __LINE__);
- e.type = ::Demo::Transmit::ice_staticId();
- throw e;
- }
- }
- bool
- Demo::operator==(const ::Demo::Transmit& l, const ::Demo::Transmit& r)
- {
- return static_cast<const ::Ice::Object&>(l) == static_cast<const ::Ice::Object&>(r);
- }
- bool
- Demo::operator!=(const ::Demo::Transmit& l, const ::Demo::Transmit& r)
- {
- return static_cast<const ::Ice::Object&>(l) != static_cast<const ::Ice::Object&>(r);
- }
- bool
- Demo::operator<(const ::Demo::Transmit& l, const ::Demo::Transmit& r)
- {
- return static_cast<const ::Ice::Object&>(l) < static_cast<const ::Ice::Object&>(r);
- }
- ::Ice::ObjectPtr
- Demo::Hello::ice_clone() const
- {
- throw ::Ice::CloneNotImplementedException(__FILE__, __LINE__);
- }
- static const ::std::string __Demo__Hello_ids[2] =
- {
- "::Demo::Hello",
- "::Ice::Object"
- };
- bool
- Demo::Hello::ice_isA(const ::std::string& _s, const ::Ice::Current& ) const
- {
- return ::std::binary_search(__Demo__Hello_ids, __Demo__Hello_ids + 2, _s);
- }
- ::std::vector< ::std::string>
- Demo::Hello::ice_ids(const ::Ice::Current& ) const
- {
- return ::std::vector< ::std::string>(&__Demo__Hello_ids[0], &__Demo__Hello_ids[2]);
- }
- const ::std::string&
- Demo::Hello::ice_id(const ::Ice::Current& ) const
- {
- return __Demo__Hello_ids[0];
- }
- const ::std::string&
- Demo::Hello::ice_staticId()
- {
- return __Demo__Hello_ids[0];
- }
- ::IceInternal::DispatchStatus
- Demo::Hello::___sayHello(::IceInternal::Incoming& __inS, const ::Ice::Current& __current) const
- {
- __checkMode(::Ice::Nonmutating, __current.mode);
- ::IceInternal::BasicStream* __is = __inS.is();
- ::std::string s;
- __is->read(s);
- sayHello(s, __current);
- return ::IceInternal::DispatchOK;
- }
- ::IceInternal::DispatchStatus
- Demo::Hello::___setClass(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
- {
- __checkMode(::Ice::Idempotent, __current.mode);
- ::IceInternal::BasicStream* __is = __inS.is();
- ::IceInternal::BasicStream* __os = __inS.os();
- ::Ice::Int a;
- ::Ice::Double d1;
- ::Ice::Double d2;
- ::Ice::Double d3;
- __is->read(a);
- __is->read(d1);
- __is->read(d2);
- __is->read(d3);
- ::Demo::TransmitPtr __ret = setClass(a, d1, d2, d3, __current);
- ::Demo::__write(__os, __ret);
- __os->writePendingObjects();
- return ::IceInternal::DispatchOK;
- }
- ::IceInternal::DispatchStatus
- Demo::Hello::___sendClass(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
- {
- __checkMode(::Ice::Idempotent, __current.mode);
- ::IceInternal::BasicStream* __is = __inS.is();
- ::Demo::TransmitPtr trans;
- __is->read(::Demo::__patch__TransmitPtr, &trans);
- __is->readPendingObjects();
- sendClass(trans, __current);
- return ::IceInternal::DispatchOK;
- }
- static ::std::string __Demo__Hello_all[] =
- {
- "ice_id",
- "ice_ids",
- "ice_isA",
- "ice_ping",
- "sayHello",
- "sendClass",
- "setClass"
- };
- ::IceInternal::DispatchStatus
- Demo::Hello::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
- {
- ::std::pair< ::std::string*, ::std::string*> r = ::std::equal_range(__Demo__Hello_all, __Demo__Hello_all + 7, current.operation);
- if(r.first == r.second)
- {
- return ::IceInternal::DispatchOperationNotExist;
- }
- switch(r.first - __Demo__Hello_all)
- {
- case 0:
- {
- return ___ice_id(in, current);
- }
- case 1:
- {
- return ___ice_ids(in, current);
- }
- case 2:
- {
- return ___ice_isA(in, current);
- }
- case 3:
- {
- return ___ice_ping(in, current);
- }
- case 4:
- {
- return ___sayHello(in, current);
- }
- case 5:
- {
- return ___sendClass(in, current);
- }
- case 6:
- {
- return ___setClass(in, current);
- }
- }
- assert(false);
- return ::IceInternal::DispatchOperationNotExist;
- }
- void
- Demo::Hello::__write(::IceInternal::BasicStream* __os) const
- {
- __os->writeTypeId(ice_staticId());
- __os->startWriteSlice();
- __os->endWriteSlice();
- #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
- Object::__write(__os);
- #else
- ::Ice::Object::__write(__os);
- #endif
- }
- void
- Demo::Hello::__read(::IceInternal::BasicStream* __is, bool __rid)
- {
- if(__rid)
- {
- ::std::string myId;
- __is->readTypeId(myId);
- }
- __is->startReadSlice();
- __is->endReadSlice();
- #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
- Object::__read(__is, true);
- #else
- ::Ice::Object::__read(__is, true);
- #endif
- }
- void
- Demo::Hello::__write(const ::Ice::OutputStreamPtr& ) const
- {
- Ice::MarshalException ex(__FILE__, __LINE__);
- ex.reason = "type Demo::Hello was not generated with stream support";
- throw ex;
- }
- void
- Demo::Hello::__read(const ::Ice::InputStreamPtr&, bool)
- {
- Ice::MarshalException ex(__FILE__, __LINE__);
- ex.reason = "type Demo::Hello was not generated with stream support";
- throw ex;
- }
- void
- Demo::__patch__HelloPtr(void* __addr, ::Ice::ObjectPtr& v)
- {
- ::Demo::HelloPtr* p = static_cast< ::Demo::HelloPtr*>(__addr);
- assert(p);
- *p = ::Demo::HelloPtr::dynamicCast(v);
- if(v && !*p)
- {
- ::Ice::NoObjectFactoryException e(__FILE__, __LINE__);
- e.type = ::Demo::Hello::ice_staticId();
- throw e;
- }
- }
- bool
- Demo::operator==(const ::Demo::Hello& l, const ::Demo::Hello& r)
- {
- return static_cast<const ::Ice::Object&>(l) == static_cast<const ::Ice::Object&>(r);
- }
- bool
- Demo::operator!=(const ::Demo::Hello& l, const ::Demo::Hello& r)
- {
- return static_cast<const ::Ice::Object&>(l) != static_cast<const ::Ice::Object&>(r);
- }
- bool
- Demo::operator<(const ::Demo::Hello& l, const ::Demo::Hello& r)
- {
- return static_cast<const ::Ice::Object&>(l) < static_cast<const ::Ice::Object&>(r);
- }
|
voici mes erreurs :
Code :
- Performing Custom Build Step on .\Hello.ice
- Compiling...
- Hello.cpp
- HelloI.cpp
- Server.cpp
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : error C2259: 'HelloI' : cannot instantiate abstract class due to following members:
- .\HelloI.h(18) : see declaration of 'HelloI'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : warning C4259: 'void __thiscall Demo::Hello::sayHello(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > &,const struct Ice::Current & ) const' :
- pure virtual function was not defined
- .\Hello.h(286) : see declaration of 'sayHello'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : warning C4259: 'class IceInternal::Handle<class Demo::Transmit> __thiscall Demo::Hello::setClass(int,double,double,double,const struct Ice::Current & )' : pure virtual function was not defin
- ed
- .\Hello.h(289) : see declaration of 'setClass'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : warning C4259: 'void __thiscall Demo::Hello::sendClass(const class IceInternal::Handle<class Demo::Transmit> &,const struct Ice::Current & )' : pure virtual function was not defined
- .\Hello.h(292) : see declaration of 'sendClass'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : error C2259: 'HelloI' : cannot instantiate abstract class due to following members:
- .\HelloI.h(18) : see declaration of 'HelloI'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : warning C4259: 'void __thiscall Demo::Hello::sayHello(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > &,const struct Ice::Current & ) const' :
- pure virtual function was not defined
- .\Hello.h(286) : see declaration of 'sayHello'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : warning C4259: 'class IceInternal::Handle<class Demo::Transmit> __thiscall Demo::Hello::setClass(int,double,double,double,const struct Ice::Current & )' : pure virtual function was not defin
- ed
- .\Hello.h(289) : see declaration of 'setClass'
- C:\Ice-3.0.1-VC60\demo\Ice\Copy of minimal\Server.cpp(26) : warning C4259: 'void __thiscall Demo::Hello::sendClass(const class IceInternal::Handle<class Demo::Transmit> &,const struct Ice::Current & )' : pure virtual function was not defined
- .\Hello.h(292) : see declaration of 'sendClass'
- Generating Code...
- Error executing cl.exe.
- server.exe - 2 error(s), 6 warning(s)
|
J'espere avoir ete assez clair !!
Je vous remerciepour votre aide |