Skip to content

chaining for all commands, callbacks and setters #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 10, 2021
Merged

chaining for all commands, callbacks and setters #247

merged 5 commits into from
Oct 10, 2021

Conversation

lathoub
Copy link
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

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
Collaborator Author

lathoub commented Oct 10, 2021

Not sure how to fix the platformIO errors

@franky47
Copy link
Member

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

Copy link
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.

@lathoub
Copy link
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