PSS 1.0 NO IDEA Avatar
  1. OMG Issue

PSS — C++ mapping for PSDL storage object references

  • Key: PSS-11
  • Legacy Issue Number: 3162
  • Status: closed  
  • Source: ZeroC ( Bernard Normier)
  • Summary:

    There is a number of problems with the C++ mapping for storage object
    references:

    • abstract storage type references are mapped to abstract C++ classes;
      this implies that references are dynamically allocated and freed,
      and typically handled through pointers.

    The dynamic allocation is expensive and error prone (risk of memory
    leaks), and handling 'smart pointers' through pointers to these smart
    pointers is very unusual.

    • The mapped C++ classes inherit from each other, to mimic the implicit
      widening of regular pointers.
      Using inheritance for this purpose is a mistake, since it does not
      correspond to the behavior of real pointers – if class B derives
      from class A, a B instance is a A, but a B* is not a A*, it is only
      implictly converted into an A*.
      The correct way to provide this implicit widening is through
      conversion operators.

    I propose to change the mapping and adopt concrete 'smart-pointer'
    ref classes, that applications allocate on the stack. The proposed
    mapping is implemented in Orbix2000 beta 2 (available from IONA
    web site).

  • Reported: PSS 1.0b1 — Thu, 23 Dec 1999 05:00 GMT
  • Disposition: Resolved — PSS 1.0
  • Disposition Summary:

    accepted

  • Updated: Fri, 6 Mar 2015 20:58 GMT