38 #include "Coherent/UI/Binding/Binder.h"
45 template <
typename Key,
typename Value,
typename Comparator,
typename Allocator>
46 void CoherentBindInternal(Binder* binder,
const TMap<Key, Value, Comparator, Allocator>& value)
48 binder->MapBegin(value.Num());
49 typedef typename TMap<Key, Value>::TConstIterator Iterator;
51 for (Iterator i = value.CreateConstIterator(); i; ++i)
53 CoherentBindInternal(binder, i.Key());
54 CoherentBindInternal(binder, i.Value());
60 template <
typename Key,
typename Value,
typename Comparator,
typename Allocator>
61 void CoherentBindInternal(Binder* binder, TMap<Key, Value, Comparator, Allocator>& value)
63 binder->MapBegin(value.Num());
64 typedef typename TMap<Key, Value>::TConstIterator Iterator;
66 for (Iterator i = value.CreateConstIterator(); i; ++i)
68 CoherentBindInternal(binder, i.Key());
69 CoherentBindInternal(binder, i.Value());
75 template <
typename Key,
typename Value,
typename Comparator,
typename Allocator>
76 void CoherentReadInternal(Binder* binder, TMap<Key, Value, Comparator, Allocator>& value)
78 size_t size = binder->ReadMapBegin();
80 for (
size_t i = 0; i < size; ++i)
84 binder->ReadKeyValuePair();
85 CoherentReadInternal(binder, key);
86 CoherentReadInternal(binder, mapValue);
88 value.Add(key, mapValue);