[omniORB] Boost shared_ptr

Brian Neal bgneal at gmail.com
Tue Nov 18 16:16:17 GMT 2008


As previously stated, there isn't really a compelling reason to use
shared_ptr when dealing with CORBA types. Recall that the default
action of shared_ptr is to perform a delete on the pointer. You don't
want that. You can pass a custom deleter to shared_ptr, and here you
could instruct it to do a release() operation instead, or something
else. Since object references have their own reference count,
intrusive_ptr would seem a better choice than shared_ptr. But, this
also assumes that the ORB implements _ptr types as C++ pointers. ORBs
don't have to do that and you would be making your code less portable
by assuming that is the case.

So, on the client side, my advice is to continue to use the _var types
to manage object references.

On the server side you can use Servant_var. Servant_var was added to
the C++ mapping in version 1.1. Recent versions of omniORB support
Servant_var.



More information about the omniORB-list mailing list