DDS-Java 1.1 RTF Avatar
  1. OMG Issue

DDSJAVA11_ — DataReader.read should return an Iterable collection, not an Iterator

  • Key: DDSJAVA11_-1
  • Status: open  
  • Source: Real-Time Innovations ( Mr. Alejandro Campos)
  • Summary:

    The current signature of read() (and take) is:

    public Sample.Iterator<TYPE> read();
    

    This operation should return an Interable collection, to be aligned with the C++PSM:

    public LoanedSamples<T> read();
    

    An Iterable collection can be used in a foreach loop, and it can be managed by a try-with-resources block to return the loan automatically. An Iterator doesn't take advantage of these features.

  • Reported: DDS-Java 1.0b2 — Wed, 24 Apr 2019 21:36 GMT
  • Updated: Wed, 24 Apr 2019 21:38 GMT