Skip to content

Draft: Aron/feature/defaults ranges docs

Fabian Tërnava requested to merge aron/feature/defaults-ranges-docs into aron/dev

TODOs:

  • allow defaults, ranges and docs in ARON XML file definition
  • docs are generated in seperate struct
    • doc available for all
  • ranges are generated in seperate struct
    • e.g. int member temperature can have a min and max value
    • generated struct docs_ with string member temperature
    • generated struct ranges_ with members temerature.min and temperature.max. TODO: What if only min is set?
    • range available for: long, float, double, time(?)
    • range can be final (resulting in static const member) or variable
  • defaults set the initial value of the members (TODO: reset hard or reset soft?)
    • only possible to define defaults in XML for int, long, float, double, bool, string, time, enums

I would suggest the following syntax:

<ObjectChild key="temperature" doc="foo" author="xyz@foo.bar">
  <float>
    <default value="0" />
    <min value="0" final/>
    <max value="1" final/>
  </float>
</ObjectChild>

Questions:

  • In my eyes the doc belongs to the member definition (<ObjectChild>) and not the the value definition (the <float>). What do you think?
    • Another option would be: keep the existing doc and author attribute in ObjectChild (which is only used to generate the doxygen/javadoc/whatever string) and have a <doc value="foo" />-tag inside the float-tag in addition which is used to create the docs_-struct?
    • If we all agree on this syntax, I will update the optional/raw_ptr/unique_ptr/shared_ptr definition as well (<float><optional /></float>). PS: I am aware that this is different to C++ where you have optional but it was easier that way.

@pohl @dreher @kartmann

Merge request reports