Issue 16886: Getter/Setter for member arrays (dds-psm-cxx-ftf) Source: Real-Time Innovations (Dr. Sumant Tambe, sumant(at)rti.com) Nature: Enhancement Severity: Critical Summary: The specification maps IDL array to C++ native array. There are two possible alternatives as far as getter/setter functions are concerned. class Foo { char data[10]; public: char * begin_data() { return data; } char * end_data() { return data + 10; } void data(char * begin, char *end) {} template <class Iter> void data(Iter begin, Iter end) {} }; AND class Foo { char data[10]; public: char * data() { return data; } size_t data_size() { return 10; } void data(char *ptr, size_t size) {} }; The first version is more consistent with modern C++ usage of iterators. In either case a convention must be defined for portability. This may also be applicable to idl sequences. Resolution: Revised Text: Actions taken: December 9, 2011: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 09 Dec 2011 22:18:13 -0500 To: Subject: Issue/Bug Report ******************************************************************************* Name: Sumant Tambe Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: DDS-PSM-CXX Section: 7 FormalNumber: ptc/2011-01-02 Version: FTF Beta 1 Doc_Year: 2010 Doc_Month: January Doc_Day: 01 Page: 40 Title: Getter/Setter for member arrays Nature: Enhancement Severity: Critical CODE: 3TMw8 B1: Report Issue Description: The specification maps IDL array to C++ native array. There are two possible alternatives as far as getter/setter functions are concerned. class Foo { char data[10]; public: char * begin_data() { return data; } char * end_data() { return data + 10; } void data(char * begin, char *end) {} template void data(Iter begin, Iter end) {} }; AND class Foo { char data[10]; public: char * data() { return data; } size_t data_size() { return 10; } void data(char *ptr, size_t size) {} }; The first version is more consistent with modern C++ usage of iterators. In either case a convention must be defined for portability. This may also be applicable to idl sequences.