Skip to content

WIP: An intrusive boilerplate-free Focus/EEPROM storage class#712

Draft
noseglasses wants to merge 1 commit into
keyboardio:masterfrom
noseglasses:pr_focus_eeprom
Draft

WIP: An intrusive boilerplate-free Focus/EEPROM storage class#712
noseglasses wants to merge 1 commit into
keyboardio:masterfrom
noseglasses:pr_focus_eeprom

Conversation

@noseglasses

Copy link
Copy Markdown
Collaborator

This is an example of how Focus/EEPROM handling of individual
parameters could be implemented in a non-boilerplate fashion.

A new header focus_eeprom.h contains two template classes
that allow to add Focus/EEPROM handling both to members of
base classes (ReferenceFocusEEPROMWrapper)
and to define new members in derived classes
(ValueFocusEEPROMWrapper).

Using the wrapper classes is intrusive in a sense that
it requires classes (plugins) to be modified to add
Focus/EEPROM capability.

Warning: The code compiles but was not thoroughly tested.
It is just meant as an example how things could
be done and a basis for discussion.

Signed-off-by: Florian Fleissner florian.fleissner@inpartik.de

This is an example of how Focus/EEPROM handling of individual
parameters could be implemented in a non-boilerplate fashion.

A new header focus_eeprom.h contains two template classes
that allow to add Focus/EEPROM handling both to members of
base classes (ReferenceFocusEEPROMWrapper)
and to define new members in derived classes
(ValueFocusEEPROMWrapper).

Using the wrapper classes is intrusive in a sense that
it requires classes (plugins) to be modified to add
Focus/EEPROM capability.

Warning: The code compiles but was not thoroughly tested.
         It is just meant as an example how things could
         be done and a basis for discussion.

Signed-off-by: Florian Fleissner <florian.fleissner@inpartik.de>
@noseglasses noseglasses changed the title An intrusive boilerplate-free Focus/EEPROM storage class WIP: An intrusive boilerplate-free Focus/EEPROM storage class Nov 6, 2019
@noseglasses noseglasses added the wip label Nov 6, 2019
@algernon

algernon commented Nov 6, 2019

Copy link
Copy Markdown
Contributor

Somewhat related: #344. I intended to rework storage a bit, but as a followup for #695, because it needs some more fleshing out. Something like that should make this kind of class simpler too.

I'm liking the direction this is going on a first look, by the way.

@obra
obra marked this pull request as draft December 21, 2020 21:46
@algernon algernon removed the wip label Jun 10, 2022
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