Skip to content

chaining for all commands, callbacks and setters#247

Merged
lathoub merged 5 commits intomasterfrom
chaining
Oct 10, 2021
Merged

chaining for all commands, callbacks and setters#247
lathoub merged 5 commits intomasterfrom
chaining

Conversation

@lathoub
Copy link
Copy Markdown
Collaborator

@lathoub lathoub commented Oct 10, 2021

modified all commands, callbacks and setters with no return value (void) to return a reference to this.

example:

template<class Transport, class Settings, class Platform>
void MidiInterface<Transport, Settings, Platform>::begin(Channel inChannel)
{
...
}

becomes

template<class Transport, class Settings, class Platform>
MidiInterface<Transport, Settings, Platform>& MidiInterface<Transport, Settings, Platform>::begin(Channel inChannel)
{
...
    return *this;
}

this modif has no impact on existing code, and code size

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 10, 2021

Coverage Status

Coverage decreased (-0.008%) to 99.624% when pulling 417beca on chaining into b4daa69 on master.

@lathoub
Copy link
Copy Markdown
Collaborator Author

lathoub commented Oct 10, 2021

Not sure how to fix the platformIO errors

@franky47
Copy link
Copy Markdown
Member

It's under discussion here, I'll have a look, it's nothing related to this PR.

Copy link
Copy Markdown
Member

@franky47 franky47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the internal method, LGTM.

Comment thread src/MIDI.h Outdated
@lathoub
Copy link
Copy Markdown
Collaborator Author

lathoub commented Oct 10, 2021

added example on how to use command chaining with lambda functions

added Chaining example
@lathoub lathoub merged commit 50e33c8 into master Oct 10, 2021
@lathoub lathoub deleted the chaining branch October 10, 2021 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants