|
Boost : |
Subject: Re: [boost] Any interest in creating new CORBA IDL to C++ mapping?
From: Kevin Heifner (heifnerk_at_[hidden])
Date: 2010-07-14 17:58:15
On 7/14/2010 2:22 PM, Johnny Willemsen wrote:
> Please share ideas of how things could look like, for example, what do
> we do for the _var/_ptr/_narrow, how would this look like with a new
> mapping. We can easily use std::string, std::vector, but especially
> _var/_ptr replacement is very important.
Ideas:
- Use shared_ptr for both _var and _ptr.
std::shared_ptr<FooFactory> factory = // get a Foo factory
std::shared_ptr<Foo> foo = factory->make_a_foo("my foo");
foo->do_something();
Or even the now evil:
factory->make_a_foo("my foo")->do_something(); // currently leaks
_narrow will still be needed since you need the server's help.
- IDL string is std::string
- IDL sequence and array are std::vector
- Java maps them to the same thing
std::vector<octet> object_id();
std::shared_ptr<Object> id_to_reference(const std::vector<octet>&);
C++0x allows std::vector to be returned via std::move without cost.
- No exception specs
- Forget backward compatibility. Consider it a new language. It
doesn't replace the current C++ mapping it is a new language mapping for
Modern_C++. So vendors can support either one or both. Just like
vendors can now support C++ and Java and Python or just Java, etc.
KevinH
-- Kevin Heifner
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk