Re: Wrapping a C++ object with an ORBit CORBA interface.



Hi Craig,

On Thu, 2003-01-02 at 22:44, Craig Wright wrote:
> I've been running into some problems trying to wrap a particular server 
> object with a CORBA object.

	:-)

> I have a C++ class called Result. Occasionally I have to pass results to 

	Ok - this may not be helpful, but you should almost never use an
'interface' where you see 'object' - since every method is a round-trip.
I think you'd do better to have:

exception BadResult {
	string message;
	any    expansion;
};

	And simple fire an exception on the methods when they don't complete
successfully. This will mean that in most cases there is no performance
impact at all, vs. instantiating / marshalling / lifecycle controlling /
destroying / round-trip-querying a new 'interface'.

> So I tried something else. I created another function 
> impl_ORB_Result__create_2 which takes a void* (actually a Result*), as 
> its third argument and uses this to fill in my field in the 
> POA_ORB_Result struct.

	I'd recommend using libbonobo if you can to implement CORBA objects;
it's somewhat simpler. Alternatively checkout 'orbitcpp' from CVS - and
see how they tie the C++ binding into ORBit2 - they have to deal with
the same problems there. [ and/or ask the question on their list ].

	HTH,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]