You simply can't obtain the notational convenience you want from attributes in this scenario with the C++ mapping (perhaps you could in the Python mapping).
To do this without a leak you would have to do something like this: BrakePedal_var brakePedal(server->brakePedal()) If you immediately call press() on it, you are going to leak the object reference. CORBA is the world’s leading middleware solution enabling the exchange of information, independent of hardware platforms, programming languages, and operating systems. server->brakePedal()->press() // major resource leak hereīrakePedal() is the attribute accessor function that returns a CORBA object reference. Note that you can't really do the syntax you want in the C++ mapping anyway e.g. And for something like this, I would just declare my own function that returned an interface. Most CORBA experts recommend that if you are going to use attributes you only use readonly attributes. So I think it is allowed.īut, I'm really not sure you would want to do this in practice. I tried feeding such IDL to omniORB's IDL to C++ translator, and it didn't reject it. that you could put an interface name as an attribute name. Declaring an attribute is logically equivalent to declaring a pair of accessor functions, one to read the value of the attribute, and one to write it (you can also have readonly attributes, in which case you would only get the read function).