-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a331d76
commit 560f09b
Showing
3 changed files
with
107 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import Foundation | ||
|
||
/// A Contextual implementer maintains context data and can create child instances | ||
/// A Contextual implementer maintains local context data and can create child instances | ||
/// that can still access their parent's data | ||
/// Each ConfidenceContextProvider returns local data reconciled with parents' data. Local data has precedence | ||
public protocol Contextual: ConfidenceContextProvider { | ||
/// Adds entry to local data | ||
func updateContextEntry(key: String, value: ConfidenceValue) | ||
/// Removes entry from local data | ||
/// It hides entries with this key from parents' data (without modifying parents' data) | ||
func removeContextEntry(key: String) | ||
/// Clear local data. Parents' data is still reconciled. Previously removed parent entries are not hidden anymore | ||
func clearContext() | ||
/// Creates a child Contextual instance that still has access | ||
/// to its parent context | ||
/// Creates a child Contextual instance that maintains access to its parent's data | ||
func withContext(_ context: ConfidenceStruct) -> Self | ||
} |
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