Discussion:
[omniORB] IDL modules
Hamilton Temple
2008-08-14 19:28:41 UTC
Permalink
Hello there,

I have been working with the following idl definition:

interface Add{
double add(in string a, in string b, in string c);
};

In the server I use the following instruction to activate the object id:

AddImpl * addImpl=new AddImpl();
PortableServer::ObjectId_var myObjID = myPOA->activate_object(addImpl);

I modified the idl as follows:

module Operations{
interface Add{
double add(in string a, in string b, in string c);
};
};

I defined the corresponding namespace Operations in the implementation, and
added the line "using namespace Operations;" at the beginning of the server
code.

Now compilation fails with the following errors:

server.cpp: In function 'int main(int, char**)':
server.cpp:64: error: no matching function for call to
'PortableServer::POA::activate_object(Operations::AddImpl*&)'
/usr/include/omniORB4/poa.h:552: note: candidates are: virtual
PortableServer::ObjectId*
PortableServer::POA::activate_object(PortableServer::ServantBase*)
server.cpp:67: error: no matching function for call to
'PortableServer::POA::servant_to_reference(Operations::AddImpl*&)'
/usr/include/omniORB4/poa.h:566: note: candidates are: virtual
CORBA::Object*
PortableServer::POA::servant_to_reference(PortableServer::ServantBase*)

Any hints would be much appreciated. Thank you,

Hamilton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080814/ec0a6044/attachment.htm
Stefan Naewe
2008-08-14 19:49:20 UTC
Permalink
Post by Hamilton Temple
Hello there,
interface Add{
double add(in string a, in string b, in string c);
};
AddImpl * addImpl=new AddImpl();
PortableServer::ObjectId_var myObjID = myPOA->activate_object(addImpl);
module Operations{
interface Add{
double add(in string a, in string b, in string c);
};
};
I defined the corresponding namespace Operations in the implementation, and
added the line "using namespace Operations;" at the beginning of the server
code.
server.cpp:64: error: no matching function for call to
'PortableServer::POA::activate_object(Operations::AddImpl*&)'
/usr/include/omniORB4/poa.h:552: note: candidates are: virtual
PortableServer::ObjectId*
PortableServer::POA::activate_object(PortableServer::ServantBase*)
server.cpp:67: error: no matching function for call to
'PortableServer::POA::servant_to_reference(Operations::AddImpl*&)'
/usr/include/omniORB4/poa.h:566: note: candidates are: virtual
CORBA::Object*
PortableServer::POA::servant_to_reference(PortableServer::ServantBase*)
Any hints would be much appreciated. Thank you,
Hamilton
How is your class AddImpl defined ?


S.
--
----------------------------------------------------------------
Dipl.-Inform. Stefan Naewe ATLAS Elektronik GmbH
Dept.: PTA5 3
phone: +49-(0)421-457-1378 Sebaldsbruecker Heerstr. 235
fax: +49-(0)421-457-1702 28305 Bremen
----------------------------------------------------------------
/dev/random says: Why do cats have canine teeth?
Hamilton Temple
2008-08-14 20:33:36 UTC
Permalink
Stefan, thank you for your answer.

AddImpl is defined as follows:

#include <Add.hh>

namespace Operations{
class AddImpl: public POA_Add, public PortableServer::RefCountServantBase{
CORBA::ORB_var orb_;
PortableServer::POA_var poa_;

public:
AddImpl();
virtual PortableServer::POA_ptr _default_POA();
virtual double add(const char * a,const char * b,const char * c)
throw(CORBA::SystemException);
};
};

Without the namespacing this code compiled without any problems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080814/57e10345/attachment.htm
Hamilton Temple
2008-08-14 20:56:29 UTC
Permalink
Hi,

I just realized of my mistake. The correct definition is:

#include <Add.hh>

namespace Operations{
class AddImpl: public POA_Operations::Add, public
PortableServer::RefCountServantBase{
CORBA::ORB_var orb_;
PortableServer::POA_var poa_;

public:
AddImpl();
virtual PortableServer::POA_ptr _default_POA();
virtual double add(const char * a,const char * b,const char * c)
throw(CORBA::SystemException);
};
};

I hope that this helps to other CORBA rookies :D

Regards,

Hamilton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080814/464dcec1/attachment.htm
Loading...