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 logger renamed as glogger to differentiate it from other variables also named logger and to avoid mistakes. I also avoids many compilation warnings about shadowed variables.
Changes
Defined new class DocModel for wrapping all internal model structures: the internal model tree and the IdAssigner object, as well as the ColStaffObjs table and the measures table associated to each score.
Defined copy and assignment constructors for all ImoObj objects.
Some changes in the internal model tree objects to simplify cloning, mainly replacing some pointers to ImoObj objects by their Id.
The tree has been reviewed to ensure that all tree nodes can be traversed using Visitor objects.
Class IdAssigner now uses std::unordered_map when appropriate instead of std::map. This improves performance when using Id to locate an object.
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
logger
renamed asglogger
to differentiate it from other variables also namedlogger
and to avoid mistakes. I also avoids many compilation warnings about shadowed variables.Changes
DocModel
for wrapping all internal model structures: the internal model tree and theIdAssigner
object, as well as theColStaffObjs
table and the measures table associated to each score.ImoObj
objects.ImoObj
objects by their Id.Visitor
objects.IdAssigner
now usesstd::unordered_map
when appropriate instead ofstd::map
. This improves performance when using Id to locate an object.