Skip to content

Enhance GPIO to allow use in non-templated classes and variables #14

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lintondf
Copy link

Defines a pure virtual base class IGPIO from which the hardware-specific GPIO classes are derived. This allows references to IGPIO objects to be passed to non-templated class constructors and methods and allows class and other variables to be IGPIO methods without the use of templates.

Since none of the methods of the GPIO classes modify any class attributes I added const declarations throughout.

Neither the size or speed of the native hardware-specific GPIO classes are affected.

I added new benchmark methods to demonstrate the performance of the wrapped objects.

@mikaelpatel
Copy link
Owner

Please add benchmark when passing as parameter. This will give some insight to the current design pattern.

@mikaelpatel
Copy link
Owner

Please explain changes ”const party”. What is the improvement? The class does not have state.

@lintondf
Copy link
Author

lintondf commented Jan 26, 2020 via email

@lintondf
Copy link
Author

lintondf commented Jan 26, 2020 via email

@mikaelpatel
Copy link
Owner

There is a need for a benchmark that uses the VPIO by-reference. This will force the compiler to generate the virtual table and the virtual function call over-head will be more obvious.

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.

2 participants