-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove reference-counted pointer from
DataTree
This commit reverts 945368c. That commit intended to simplify lifetime management by changing `DataTree` to contain a reference-counting pointer instead of a regular reference to the associated YANG context. In practice, however, that change caused more problems than it solved. The major issue was the inconsistency where all other structs were using regular references instead of reference-counting pointers. This inconsistency was problematic for expanding the API surface to cover features like YANG extensions, where data trees can be created from schema structs. Having explicit control over the data trees lifetimes is also desired in many cases. With this change, `DataNodeRef` now has two lifetime parameters: one for the associated data tree and another for the associated YANG context. These two lifetimes are necessary to express the logic of the `DataNodeRef::duplicate` method, in which a new data tree is created with a new lifetime while maintaining the same lifetime for the YANG context. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
- Loading branch information
Showing
9 changed files
with
122 additions
and
141 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
Oops, something went wrong.