lomse
lomse copied to clipboard
Make the internal model clonable
This PR makes the internal model clonable and prepares the Document class to use a cloned model. This is part of the new strategy for undo/redo to avoid excessive processing time and memory requirements when using the current strategy for undo/redo in edition commands.
Backwards incompatible changes
- Global logger
loggerrenamed asgloggerto differentiate it from other variables also namedloggerand to avoid mistakes. I also avoids many compilation warnings about shadowed variables.
Changes
- Defined new class
DocModelfor wrapping all internal model structures: the internal model tree and theIdAssignerobject, as well as theColStaffObjstable and the measures table associated to each score. - Defined copy and assignment constructors for all
ImoObjobjects. - Some changes in the internal model tree objects to simplify cloning, mainly replacing some pointers to
ImoObjobjects by their Id. - The tree has been reviewed to ensure that all tree nodes can be traversed using
Visitorobjects. - Class
IdAssignernow usesstd::unordered_mapwhen appropriate instead ofstd::map. This improves performance when using Id to locate an object.