Re: Private variable ?



Franck Martin wrote:

> I would like to create an object which has some private variables. ie I can use
> these variables in my implementation (server), but I don't want them to be
> exposed to the client. These variables are associated with an object off course.
> How do I do that?
>
> Should they be declared in the IDL or somewhere else?

In the file whatever-skelimpl.h (generated by orbit-idl --skeleton-impl
whatever.idl)
a servant structure is created that has members for every attribute defined by an
interface.   You're free to add any extra variables to this, and as these are not
defined in the IDL file, the client has no access to them  (but methods in the
class
do, and can return the value of those variables to the client.)

IDL files can only be used for public declarations.

Remember that each time you use the --skeleton-impl option to orbit-idl, that
file is recreated, and any changes you made would be overwritten.




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