You should look at the _var
C++ mapping in the CORBA specs.
For a sequence type var, I think the best approach might be to use the inout()
member, i.e.:
ByteArray_var idToEncrypt = connection->get_id();
encryptId(&idToEncrypt.inout());
inout
returns a non-const reference and you're just taking the address of the underlying object with &
.
Do note: inout
does dereference the internal pointer, so it would be illegal to call inout()
on a _var
that doesn't hold a pointer. However, the call to get_id() must always return a valid pointer, so the code is OK without checking.
If you need a generic approach where you don't know if the _var
is initialized, you could use:
ByteArray* p = idToEncrypt.operator->();
as operator->
seems to be the only way to directly get at the pointer.