Calculates diffs between arrays of QueryResultItem elements. More...
Public Member Functions | |
| Differ () | |
| Constructor. | |
| Differ (const Differ &)=delete | |
| Differ & | operator= (const Differ &)=delete |
| Differ (Differ &&)=default | |
| Differ & | operator= (Differ &&)=default |
| Diff | diff (const std::vector< QueryResultItem > &items) |
| Calculate the diff of the provided items against the last set of items that were passed to this differ. | |
Calculates diffs between arrays of QueryResultItem elements.
Use a Differ with a StoreObserver to get the diff between subsequent query results delivered by the store observer.
| ditto::Diff ditto::Differ::diff | ( | const std::vector< QueryResultItem > & | items | ) |
Calculate the diff of the provided items against the last set of items that were passed to this differ.
The returned Diff identifies changes from the old array of items to the new array of items using indices into both arrays.
Initially, the differ has no items, so the first call to this method will always return a diff showing all items as insertions.
The identity of items is determined by their _id field.
| items | The query result items to compare against the last array of items. |