main
1namespace jive
2{
3 public class ScopedContext : Context
4 {
5 ScopedStorage storage;
6
7 public ScopedContext(ScopedStorage storage)
8 {
9 this.storage = storage;
10 }
11
12 public bool contains<T>(Key<T> key)
13 {
14 return key.is_found_in(storage.provide_storage());
15 }
16
17 public void add<T>(Key<T> key, T value)
18 {
19 key.add_value_to(storage.provide_storage(), value);
20 }
21
22 public T value_for<T>(Key<T> key)
23 {
24 return key.parse_from(storage.provide_storage());
25 }
26
27 public void remove<T>(Key<T> key)
28 {
29 key.remove_from(storage.provide_storage());
30 }
31 }
32}