-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code to use abstract classes and PIMPL (#370)
* Refactor code to use abstract classes and PIMPL This paves the way towards having multiple implementations at runtime. It also centralized the defintions of the "base" or "implementation" classes (such as AdapterBase, PeripheralBase) so that by explicitly deriving from these ABCs the interfaces of each implemetations are correct. The public interface for "frontend" classes (the ones used by the library user) are unchanged. The main differences are: - They now include an "internal_" shared pointer (the PIMPL) - Some logic is implemented in the frontend (i.e. checking that a peripheral is connected before invoking read_inner, write_inner, etc). - The logic to detect if the instance is initialized is centralized into a private "operator->()" - The "safe" classes no longer inherit from the non safe ones. They are castable, though, so most code should continue working unmodified. An additional concept, with the associated classes is introduced, the "Backend". For the time being this is not exposed in the public API. The idea is that all static methods in the Adapter will be moved to the Backend as non-static methods and the Backend frontend class will have a static get_backends(). Note that in many cases having a "BackendIMPL.h" header is unncecessary and thus ommited. * fixup! address review comments. * fixup! actually add the changes to the commit doh! * fixup! fixup2
- Loading branch information
Showing
63 changed files
with
1,687 additions
and
1,129 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.