IDL to C++11 revised submission presentation


Published on

This is the presentation which Remedy IT gave to the OMG MARS working group regarding its revised submission for the IDL to C++11 Language Mapping

Published in: Technology, Education
1 Comment
  • IDL to C++11 is now a formalized language mapping. See our other presentations for details of the mapping and how to use it!
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

IDL to C++11 revised submission presentation

  1. 1. IDL to C++11 Revised submission OMG document mars/2012-03-32Copyright © 2012 Page 1
  2. 2. Document numbers mars/12-03-05 (Updated IDL to C++11 Language Mapping revised submission with errata applied - changebar) mars/12-03-06 (Updated IDL to C++11 Language Mapping revised submission with errata applied - clean) mars/12-03-07 (Errata) mars/12-03-08 (Revised submission - inventory file) mars/12-01-02 (IDL to C++1 Language Mapping revised submission)Copyright © 2012 Page 2
  3. 3. RFP asks for The new mapping should be functionally equivalent to the existing IDL to C++ mapping. While the syntax may change, an application should be able to implement functionality identical to that which can be achieved with the current IDL to C++ mapping. Applications programmed using alternative language mappings should inter operate transparently. An application utilizing this new language mapping should have no awareness, other than informational, of what language mapping a peer application is using. The new language mapping should be designed to co-exist with other technologies. Specifically, it should not interfere with the namespaces used by other OMG specifications, or commonly used packages. Interoperability between the IDL to C++ and IDL to C++11 mapping in the same compilation unit is not required.Copyright © 2012 Page 3
  4. 4. C++11 C++11 was unanimously approved August 12 th 2011 Is now formally available as ISO/IEC 14882:2011Copyright © 2012 Page 4
  5. 5. Goal of IDL to C++11 Simplified mapping for C++11 Make use of the new C++11 features to – Gain performance – Reduce coding errors – Reduce amount of code – No need to create conversion between STL/C++ types and IDL based typesCopyright © 2012 Page 5
  6. 6. Enum mapping IDL enum is mapped to the new C++11 enum class // IDL enum Color { red, green, blue }; // C++ enum class Color : uint32_t { red, green, blue };Copyright © 2012 Page 6
  7. 7. C++11 type mapping Map basic types to their C++ counterparts IDL (w)string maps to std::(w)string IDL sequence maps to std::vector IDL array maps to std::array IDL fixed maps to CORBA::FixedCopyright © 2012 Page 7
  8. 8. Reference types Reference types are used for – Object reference – Valuetypes – Typecodes Strong references behave as std::shared_ptr Weak references behave as std::weak_ptr References can only be created using CORBA::make_reference<> No C++ pointers can be passed to the APICopyright © 2012 Page 8
  9. 9. Client interface mapping When defining interface Foo, than CORBA::object_traits<Foo>::ref_type (aka CORBA::object_reference<Foo>, aka Foo::_ref_type) is the object reference type C++ traits are used to determine types, no naming rules to be remembered by the user Narrowing using the narrow method (with CORBA could trigger a remote call)Copyright © 2012 Page 9
  10. 10. Servant interface mapping When defining interface Foo, than CORBA::servant_traits<Foo>::base_type is the base class for the user servant class Servant references are available as CORBA::servant_traits<Foo>::ref_type (aka CORBA::servant_reference<Foo>) C++ traits are used to determine types, no naming rules to be remembered by the userCopyright © 2012 Page 10
  11. 11. Nil references C++11 has a new type for a nil pointer: nullptr_t References can be checked for nil by comparing them with nullptr Explicit bool conversion operators for usage in for example if statementsCopyright © 2012 Page 11
  12. 12. Argument passing Argument passing for Argument passing for basic types, and complex types: reference types – in: T – in: const T& – inout: T& – inout: T& – out: T& – out: T& – return: T – return: TCopyright © 2012 Page 12
  13. 13. Struct/union Struct and union now both map to a C++ class Providing constructor(s), copy and move operators Set of accessors for each member: void A (T); void A (const T&); T A (void) const; void A (T&&); T& A (void); const T& A (void) const; T& A (void);Copyright © 2012 Page 13
  14. 14. Proof of concept New language binding for TAO: IDL2C++11 Delivers new IDL compiler Adds support libraries to use TAO with C++11 More details on and http://www.orbzone.orgCopyright © 2012 Page 14
  15. 15. Next steps Vote 2 Vote AB FTF phaseCopyright © 2012 Page 15