OpFlex Framework 1.7.0
|
A mutator represents a set of changes to apply to the data store. More...
#include <opflex/modb/Mutator.h>
Public Member Functions | |
Mutator (const std::string &owner) | |
Create a mutator that will work with the default framework instance and owner. | |
Mutator (ofcore::OFFramework &framework, const std::string &owner) | |
Create a mutator that will work with the provided framework instance and owner. | |
~Mutator () | |
Destroy the Mutator. | |
void | commit () |
Commit the changes stored in the mutator to the object store. | |
OF_SHARED_PTR< mointernal::ObjectInstance > & | modify (class_id_t class_id, const URI &uri) |
Create a new mutable object with the given URI which is a copy of any existing object with the specified URI. | |
void | remove (class_id_t class_id, const URI &uri) |
Delete the child object specified along with its link to its parents. | |
OF_SHARED_PTR< mointernal ::ObjectInstance > & | addChild (class_id_t parent_class, const URI &parent_uri, prop_id_t parent_prop, class_id_t child_class, const URI &child_uri) |
Create a new child object with the specified class and URI, and make it a child of the given parent. | |
Friends | |
class | MutatorImpl |
A mutator represents a set of changes to apply to the data store.
When modifying data through the managed object accessor classes, changes are not actually written into the store, but rather are written into the Mutator registered using the framework in a thread-local variable. These changes will not become visible until the mutator is committed by calling commit()
The changes are applied to the data store all at once but not necessarily guaranteed to be atomic. That is, a read in another thread could see some objects updated but not others. Each individual object update is applied atomically, however, so the fields within that object will either all be modified or none.
This is most similar to a database transaction with an isolation level set to read uncommitted.