Closed
Conversation
You need to also add some static_casts to main.cpp in InfiniSim. It crashes when selecting the Twos app.
|
Build checks have not completed. Possible reasons for this are:
|
Collaborator
Contributor
Author
|
Yes, absolutely :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR stems from #1571 and is related to #1262.
It is a draft, because there is work left to do (see the open problems below).
This PR implements an
AppControllerclass as a single place in the code where all non-core apps are registered.Short-term this allows us to implement optional apps (see #1408).
Long-term this allows us to implement dynamically loadable apps.
Currently the app
Twosis handled by theAppControlleras an example, mostly because it has no dependencies and is therefore simple to handle.The implementation uses the
Appsenum (see also #1760), but removes all entries of apps that will be handled by theAppController. Instead, the entryDynamicis added to the enum.The ids of dynamic apps are then calculated by
Dynamic + <offset>where<offset>is the id of an app inside theAppController(e.g. an array index). This leads to a lot ofstatic_casteverywhere.All places, where the current apps where hardcoded before have to use the AppController now.
Apps that can be used with the
AppControllermust implement aGetmethod and its symbol like this:The
AppControllersaves those contructors internally and can reference them via theDynamic + <offset>ids described above.There are also already fragments of an
AppInterfacein the code that everyGetmethod must receive. TheAppInterfacebundles all the controllers that apps can require.The current version runs with InfiniSim if you use my branch.
Feedback and ideas would be very apprechiated 😊
Open Problems:
AppControllershould be a component and live in the respective directory.AppControlleras well or are we hardcoding them (for now)?AppInterface.std::vectorin the code. Is it better to swap them forstd::array? This is a tradeoff between dynamically allocating a collection when we know how many apps we have vs. hardcoding an array with reasonable bounds. Using only vectors seems to overflow the stack.