Closed ddemidov closed 7 years ago
Sorry I haven't been involved in that thread so far.
Although this looks good code-wise, I am wondering why we need it. Is there an advantage to doing this over just always using the G&A
mode for that sensor? I haven't gotten the chance to do a speed comparison.
Give me some time to look through this more closely (I want to understand the C++ template you have); right now I don't think I properly understand the use case.
Sure. Compare the result of the template here: https://github.com/ddemidov/ev3dev-lang-cpp/blob/858c0cb77b43f4e265fc571783986f5da51db556/ev3dev.h#L481-L491
The first method is generated from a type/indices list with single entry, and the second is generated from two entries. The template just checks if the type
list has single entry and does different things depending on that.
By the way, I haven't forgotten about this; I just haven't had a time to read through and understand the changes and their implications. If you want to merge this before I can take a look, go ahead; I trust your judgment.
OK, I understand this now. LGTM.
This allows to correctly work with modes that have several values. The immediate example is
GYRO-G&A
mode that is added togyroSensor
with this PR.:exclamation: Requires rewriting templates for special sensor types.
See ddemidov/ev3dev-lang-cpp#10