Discussion:
[omniORB] (no subject)
DiabloPlayerMerlin at gmx.de ()
2009-05-22 19:47:20 UTC
Permalink
Dear Friends,

i want to write a wrapper in CORBA, so that i have some Corba Objects with a specific IDL Interface like:

interface bkVirtualObjectAdapter{
void op(in string msg);
};

and this :

interface bkSceneManagerAdapter{
void op(in bkVirtualObjectAdapter voa);
};

In the Header Files i add some unsupported classtypes which are only available on Server side. See:

#include "echo.hh"

class bkVirtualObjectAdapter_i : public POA_bkVirtualObjectAdapter
{
public:
inline bkVirtualObjectAdapter_i() {}
virtual ~bkVirtualObjectAdapter_i() {}
basho::VirtualObject* vo; <--- not definied in IDL
CORBA::ORB_var orb; <--- not definied in IDL
virtual void op(const char* msg);

basho::VirtualObject* getThis(); <--- not definied in IDL
};

When i get in the bkSceneManagerAdapter an objref from the type bkVirtualObjectAdapter i cannot convert the object_ptr to a C++ Class like this:

void bkSceneManagerAdapter_i::op(bkVirtualObjectAdapter_ptr voa){

try{
bkVirtualObjectAdapter_i *myVoa = voa;
...
}


Does anybody know, how to convert an _ptr to a real c++ class?

It would be very helpful.

Thank you

guys
--
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss f?r nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
Duncan Grisby
2009-05-28 16:19:48 UTC
Permalink
On Friday 22 May, ***@gmx.de wrote:

[...]
When i get in the bkSceneManagerAdapter an objref from the type
bkVirtualObjectAdapter i cannot convert the object_ptr to a C++ Class
void bkSceneManagerAdapter_i::op(bkVirtualObjectAdapter_ptr voa){
try{
bkVirtualObjectAdapter_i *myVoa = voa;
...
}
Does anybody know, how to convert an _ptr to a real c++ class?
You need to ask the POA to convert the reference to a servant with
reference_to_servant, then use dynamic_cast to convert the ServantBase
to a pointer to your bkVirtualObjectAdapter_i class.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...