Skip to content
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

WIP: Generic memory persistence class #2171

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minacode
Copy link
Contributor

This PR aims to implement a simple interface to store and load program state to the memory.

Why is this a good idea?

Because it provides a simple interface for developers and reduces the amount of IO-code people have to write. Writing persistent apps would only be a matter of defining the persistent data struct, inheriting from Persistent and loading/saving the data in the constructor/desconstructor (and maybe we can automate this away, not sure though).

What is already there?

In utility/Persistent.h is a new template class Persistent<T>.
It holds a versioned struct of data which it can save to and load from the memory. The code is taken from the settings implementation.
For testing/reference I changed the score of the Paddle game to be persistent.

What is missing?

Currently, I have a linker error I cannot get rid of. It's probably easy for someone who knows more about C++ than me.
Therefore it's not tested either.

this aims at providing a simple interface to store and load program state to the memory.
Copy link

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed

@mark9064
Copy link
Member

Love this concept! I'll see if I can look at the linker error sometime soon, this week is looking busy for me though :(

@mark9064 mark9064 added the maintenance Background work label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Background work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants