AM_MIDI2.0Lib icon indicating copy to clipboard operation
AM_MIDI2.0Lib copied to clipboard

Factor out the common fields in the UMP processor types.

Open paulhuggett opened this issue 1 year ago • 2 comments

Following the suggestion by @dhjdhj in https://github.com/midi2-dev/AM_MIDI2.0Lib/discussions/3, I thought I'd have a stab at the change!

Created a umpCommon struct which contains the fields that are common to umpCVM, umpGeneric, and umpData. There was a suggestion that inheritance could be used in this situation, but I've gone with the "prefer aggregation to inheritance" maxim and added a "common" field instead!

I replaced the default ctors of these types with direct member initialization. This should be a no-op from the POV of the generated code with the exception that I've initialized the umpData data and dataLength fields to nullptr and 0 respectively for safety.

paulhuggett avatar Jun 12 '24 07:06 paulhuggett