Closed mdavidsaver closed 2 years ago
This is not a protocol change as defaults are applied prior to serialization of instances.
This isn't ideal. It can work semi-transparently because most existing servers are lazy about changed tracking. Preferring to set bit zero (entire structure changed).
It would be better if either:
However, both are more work than I have time for at present. So it's either this, or encode defaults in multiple downstream modules (which can be done anyway). Also with 2) it isn't clear to me how to do this in a backward compatible way (a firm requirement now).
Abandoned.
So far all fields are initialized to a fixed default value based on the field type (0, "', [], or NULL). This change allows customized default values of scalar and scalar array field. Adds overloads to
FieldCreate
andFieldBuilder
which accept variant containersAnyScalar
orshared_vector<const void>
which convey both type and initial value.In support of https://github.com/epics-base/pvDataCPP/pull/62 to provide a non-empty default for "display.form.choices".