58 void Advance(
const std::array<int64_t, kNumElements>& checkpoints);
69 return element_diff(e).checkpoint();
76 return element_diff(e).deleted();
84 mutable_element_diff(e).
Delete(
id);
93 template <
typename AttrType>
95 const AttrType a)
const {
96 return attr_diffs_[a].modified_keys();
100 template <
typename AttrType>
102 if (IsBeforeCheckpoint(a, attr_key)) {
103 attr_diffs_[a].SetModified(attr_key);
112 template <
typename AttrType>
115 if (!attr_diffs_[a].has_modified_keys()) {
118 for (
const auto& attr_key : keys) {
119 if (IsBeforeCheckpoint(a, attr_key)) {
120 attr_diffs_[a].Erase(attr_key);
126 const ElementDiff& element_diff(
const ElementType e)
const {
128 return element_diffs_[
static_cast<int>(e)];
131 ElementDiff& mutable_element_diff(
const ElementType e) {
132 return element_diffs_[
static_cast<int>(e)];
137 template <
typename AttrType>
139 for (
int i = 0; i < GetAttrKeySize<AttrType>(); ++
i) {
147 std::array<ElementDiff, kNumElements> element_diffs_;
150 using DiffForAttr = AttrDiff<AllAttrs::TypeDescriptor<i>::kNumKeyElements,
151 typename AllAttrs::TypeDescriptor<i>::Symmetry>;
152 AttrMap<DiffForAttr> attr_diffs_;