OpenDDS / OpenDDS

OpenDDS is an open source C++ implementation of the Object Management Group (OMG) Data Distribution Service (DDS). OpenDDS also supports Java bindings through JNI.
http://www.opendds.org
Other
1.29k stars 465 forks source link

Generate "key only" versions of vread and vwrite #4543

Closed jrw972 closed 2 months ago

sonndinh commented 2 months ago

My thought is to generate the following additional functions:

bool vwrite(ValueWriter& value_writer, const KeyOnly<T>& sample);
boo vwriter(ValueWriter& value_writer, const NestedKeyOnly<T>& sample);
bool vread(ValueReader& value_reader, KeyOnly<T>& sample);
bool vread(ValueReader& value_reader, NestedKeyOnly<T>& sample);

The ones that work with KeyOnly<T> are only needed for topic types. Their behaviors are similar to the counterparts for the insertion and extraction operations. That is vwrite will write only the key fields from the sample; vread will assume the input stream has only key fields and skip any extra fields that are not key.

ValueDispatcher will need to be inspected for any changes needed.

jrw972 commented 2 months ago

This seems reasonable.