|
OXY-SYNC-CONTAINER 1.0
OXY-SYNC-CONTAINER Library Documentation
|
This namespace contains synchronization-related functionality for the oxy library. More...
Namespaces | |
| namespace | api |
| This namespace contains API types and operations for the oxy sync container library. | |
| namespace | service |
| This namespace contains service-related functionality for the oxy sync container library. | |
| namespace | settings |
| This namespace contains configuration settings for the oxy sync container library. | |
Classes | |
| struct | merge_commit_fn |
| Function object for performing a merge commit operation. More... | |
Typedefs | |
| using | merge_callback |
| Callback to resolve potential conflict. | |
Functions | |
| template<typename K, typename V> | |
| std::map< K, V > | merge_maps (const std::map< K, V > &ancestor, const std::map< K, V > &left, const std::map< K, V > &right, std::function< V(const K &, const std::optional< V > &ancestor_val, const std::optional< V > &left_val, const std::optional< V > &right_val)> conflict_callback) |
| Performs a three-way merge of three maps using an ancestor (base) version to detect and resolve conflicts. | |
Variables | |
| constexpr merge_commit_fn | merge_commit |
| A constexpr instance of the merge_commit_fn function object for use in functional programming. | |
This namespace contains synchronization-related functionality for the oxy library.
Callback to resolve potential conflict.
| our | - Identifier of the current commit. |
| other | - Identifier of the other commit. |
| ancestor | - Identifier of the common ancestor commit. |
| std::map< K, V > oxy::sync::merge_maps | ( | const std::map< K, V > & | ancestor, |
| const std::map< K, V > & | left, | ||
| const std::map< K, V > & | right, | ||
| std::function< V(const K &, const std::optional< V > &ancestor_val, const std::optional< V > &left_val, const std::optional< V > &right_val)> | conflict_callback ) |
Performs a three-way merge of three maps using an ancestor (base) version to detect and resolve conflicts.
| K | The key type of the maps. |
| V | The value type of the maps. |
| ancestor | The common ancestor (base) map used to determine which changes were made in the left and right branches. |
| left | The left branch map containing potential modifications from the ancestor. |
| right | The right branch map containing potential modifications from the ancestor. |
| conflict_callback | A callback function invoked when both left and right branches modified the same key differently. It receives the key and optional values from all three maps, and must return the resolved value to use in the result. |