RE: const-correct smartpointers



> From: Bowie Owens [mailto:bowie owens csiro au] 
>         operator O_ptr &() {
>                 return m_objectref;
>         }
>                                                               
>                  
>         operator O_ptr const &() const {
>                 return m_objectref;
>         }

[snip]

> Also TAO has both operators in its 
> implementation. 
> I thought it might have something to do with the standard (I 
> don't have 
> a good reference). But if omni doesn't have the non-const 
> operator maybe 
> it should be dropped from orbitcpp.

I think this is fundamentally broken, based on everything I've ever known
about smartpointers and constness in general. If you can show us some real
code from another ORB, or the spec then maybe I'll see the point.

In order to do this properly, it seems that far bigger changes are required.
We should not have to specify the _ptr type as a template parameter. But we
have to do that because the _ptr types are actually pointers to the strange
::orbitcpp::stub::Something base class of Something. So we pretend that the
stub is called Something, but it's not really. It's very confusing.

I am currently trying to simplify all of that, so that we have a simple
typedef Something* Something_ptr;

We will still have the base class, inherited by both the stubs and skels,
but I will put it in an _orbitcpp_common namespace. I'm not convinced that
it is actually use by the skels, but I can worry about that later. At first
glance, you would guess that the common interface from the IDL is in the
base class, but it's not - I think it just contains utility stuff,
particularly for sequences.

It's complicated to explain the current system, but once I get it working it
should be very simple and obvious and we can forget about this bizarre
_orbitcpp::stub:: thing and the awkward typedefs.

This might take another week to get working. It don't think it will clash
with other things you are working on. If you need to revert my recent quick
fix to get something working for you, then OK, but we can't release a
tarball that doesn't work with Bonobo.idl.

Murray Cumming
murrayc usa net
www.murrayc.com 




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