accessing members of object implmentation

Bernd Daum daum@dik.maschinenbau.tu-darmstadt.de
Wed, 19 Nov 1997 13:09:30 +0100 (MET)


Hi everybody,

i had the same question a few days before,
but i couldn't get any information. I can't
believe, that i am the first who has this kind
of problem:

So i try it again and i would be very happy, if
somebody can tell me a solution:

My problem:

I am trying to build a wrapper-class for an object
storing in an object oriented database.

I added (comparing with the IDL-interface) data members
to the object implementation (wrapper-class), which are
not visible for the Corba-Client.

My problem now is, that the server should access
and manipulate the data members (in my case a reference
to a persistent database object) of the object
implementation.

The server get a reference (from type _ptr) to the actual
object but this has the type of the parent class, which
doesn't know about the added data members.

Is there anybody, who know a (CORBA-like) solution.

Thank you in advance.

Bernd Daum


Example:

**** IDL  ***

interface A;

interface A_Factory {
	A newA();
	manipulate(in A aref);
}


**** C++ ***

class A_i: public virtual _sk_A {
public:
	Flout added_data;        //added member

}


class B_Factory: public virtual _sk_B_Factory {
           .
           .
manipulate(A_ptr aref) {
  aref->added_data++;     // making  something with added_data:
    			  // this doesn't work, because 'added_data'
                          // is no visible member of A.

---------------------------------------------------------------------------

Dipl.-Ing. Bernd Daum                            DDDD          K   K
Department of Computer Integrated Design         D   D   ***   K  K
Darmstadt University of Technology               D    D  ***   K K
Petersenstr.30                                   D     D       KK
D-64287 Darmstadt                                D     D  I    KK
Phone: +49 6151 16 5441                          D    D   I    K K
Fax:   +49 6151 16 6854                          D   D    I    K  K
Email: daum@dik.maschinenbau.tu-darmstadt.de     DDDD   IIIII  K   K
---------------------------------------------------------------------------