-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow forward declaration of values held by reader
This commit enables the forward declaration of a type held by a reader without any new memory allocation or virtual methods. This is achieved by creating a new class -- observable_reader_node -- in the reader_node hierarchy which acts as a view for the type held by reader_node. Performance Impact Ad-hoc benchmarks (i.e. not in commit) were performed with nanobench. (https://nanobench.ankerl.com/index.html) Compared to baseline, the impact on a reader get method was non-existent. The same was true for map. The impact on watch seemingly ranged from indiscernible to rather small, i.e. in the order of 0.5-1.5%, although why there even is an impact isn't clear. Downsides and Limitations 1. If it matters, the protected keyword has now been introduced within the reader node class hierarchy. This is because the link method and the observers access method had to be moved in observable_reader_node to avoid virtual method declaration. 2. While the values held by a reader are now fwd declarable, those held by a cursor are not. This arguably introduces an inconsistency in the API.
- Loading branch information
1 parent
503ea6a
commit 7dbde7f
Showing
3 changed files
with
86 additions
and
33 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