|
STL Memory Versioning
|
Wrapper to make any class Versioned. More...
#include <versioned.h>


Public Member Functions | |
| Versioned (const T &val) | |
| Construct a new Versioned object from your object. More... | |
| ~Versioned () | |
| Destroy the Versioned object. More... | |
| const T & | Get () const |
| Get the current value of the object in the current Revision. More... | |
| bool | Set (const T &v, const std::function< bool(T &)> &updater=nullptr) |
| Set new value of the object. More... | |
| void | Release (std::shared_ptr< Segment > release) override |
| Forget version that was changed in some Segment. More... | |
| void | Collapse (std::shared_ptr< Revision > main, std::shared_ptr< Segment > parent) override |
| Collapse all changes made in Revision into one. More... | |
| void | Merge (std::shared_ptr< Revision > main, std::shared_ptr< Revision > joinRev, std::shared_ptr< Segment > join) override |
| Merge changes from two Revisions. More... | |
Public Attributes | |
| std::map< int, T > | versions |
| Map of all versions of specified object. More... | |
Wrapper to make any class Versioned.
| T | Class that needs to be versioned |
Definition at line 53 of file versioned.h.
Construct a new Versioned object from your object.
| val | Your object |
Definition at line 163 of file versioned.h.
Destroy the Versioned object.
Removes all mentions of that versioned object in current Revision
Definition at line 168 of file versioned.h.
|
overridevirtual |
Collapse all changes made in Revision into one.
Implements VersionedI.
Definition at line 244 of file versioned.h.
| const T & Versioned< T, _Strategy >::Get |
Get the current value of the object in the current Revision.
Definition at line 186 of file versioned.h.
|
overridevirtual |
Merge changes from two Revisions.
Implements VersionedI.
Definition at line 252 of file versioned.h.
|
overridevirtual |
Forget version that was changed in some Segment.
| release | Segment to forget |
Implements VersionedI.
Definition at line 239 of file versioned.h.
| bool Versioned< T, _Strategy >::Set | ( | const T & | v, |
| const std::function< bool(T &)> & | updater = nullptr |
||
| ) |
Set new value of the object.
| v | New object value |
| updater | Function to update value |
If updater function is defined, object will be updated in-place instead of overwrite
Definition at line 205 of file versioned.h.
| std::map<int, T> Versioned< T, _Strategy >::versions |
Map of all versions of specified object.
Segment versions where that object was changed are used as a keys
Definition at line 61 of file versioned.h.