[omniORB] simple problem: ClassA getClassA();

Theo Aukerman taukerman@logici.com
Fri, 22 Sep 2000 06:35:12 -0700


> From: Andr=E9 Dammeyer [mailto:adam@tzi.de]
> >	ClassA getClassA();
...
>=20
> And now my question is, how do i have to implement the method
> "ClassA getClassA();" ? It should return a pointer to a new=20
> ClassA object.

We have a similar routine which returns a Object.
The prototype virtual function created by the IDL compiler returned a
CORBA::Object which is typedeffed as Object*.

Chances are your getClassA() method will require you to return a ClassA
object, but you should be able to look at the skeleton code created by =
the
IDL compiler to make sure.

One additional note: (someone please correct me if I'm wrong) I believe =
that
you will have to duplicate the pointer before returning it.

Our method looks something like this.
CORBA::Object_ptr  GetObject()
{
	CORBA::Object_ptr  obPtr =3D NULL;

	obPtr =3D DoWhatItTakesToGetTheObject();

	return obPtr->_duplicate(obPtr);
}