MUSX Document Model
Loading...
Searching...
No Matches
musx::dom::EnigmaBase Class Reference

Base for DOM classes that are represented in EnigmaData. More...

#include <BaseClasses.h>

+ Inheritance diagram for musx::dom::EnigmaBase:

Public Types

enum class  ShareMode { All , Partial , None }
 Describes how this instance is shared between part and score. More...
 
using SharedNodes = std::set< std::string >
 The container type for shared nodes.
 

Public Member Functions

Cmper getSourcePartId () const
 Gets the source partId for this instance. If an instance is fully shared with the score, the source is SCORE_PARTID. If an instance is partially shared or non shared, the source is the ID of the part that sourced it.
 
ShareMode getShareMode () const
 Gets the sharing mode for this instance.
 
const SharedNodesgetUnlinkedNodes () const
 Gets the unlinked nodes for this instance. (Only populated for ShareMode::Partial)
 
void addUnlinkedNode (const std::string &nodeName)
 Adds a shared node for this instance.
 
virtual void integrityCheck (const std::shared_ptr< EnigmaBase > &ptrToThis)
 Performs a final consistency check after population.
 
virtual bool requireAllFields () const
 Returns true if all fields are required for valid input.
 
- Public Member Functions inherited from musx::dom::DocumentElement
virtual ~DocumentElement () noexcept(false)=default
 Virtual destructor for polymorphic behavior.
 
DocumentPtr getDocument () const
 Gets a reference to the Document.
 
Cmper getPartId () const
 Gets the part id associated with this instance.
 

Protected Member Functions

 EnigmaBase (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode)
 Constructs the base class.
 
 EnigmaBase (const EnigmaBase &)=default
 explicit default copy constructor
 
 EnigmaBase (EnigmaBase &&) noexcept=default
 explicit default move constructor
 
EnigmaBaseoperator= (const EnigmaBase &)
 no-op copy assignment operator allows subclasses to copy their values.
 
EnigmaBaseoperator= (EnigmaBase &&) noexcept
 no-op move assignment operator allows subclasses to move their values.
 
- Protected Member Functions inherited from musx::dom::DocumentElement
 DocumentElement (const DocumentWeakPtr &document, Cmper partId)
 Constructs the document element.
 
 DocumentElement (const DocumentElement &)=default
 explicit default copy constructor
 
 DocumentElement (DocumentElement &&) noexcept=default
 explicit default move constructor
 
DocumentElementoperator= (const DocumentElement &)
 no-op copy assignment operator allows subclasses to copy their values.
 
DocumentElementoperator= (DocumentElement &&) noexcept
 no-op move assignment operator allows subclasses to move their values.
 

Detailed Description

Base for DOM classes that are represented in EnigmaData.

This base provides shared Enigma-specific context: source part id and share mode.

Member Enumeration Documentation

◆ ShareMode

Describes how this instance is shared between part and score.

Enumerator
All 

All parts and score always share (no "share" attribute). Default.

Partial 

Part and score share some attributes and have their own unlinked versions of others. (attribute "share"="true")

None 

Each part and score has its own version of the DOM class. (attribute "share"="false")

Constructor & Destructor Documentation

◆ EnigmaBase()

musx::dom::EnigmaBase::EnigmaBase ( const DocumentWeakPtr document,
Cmper  partId,
ShareMode  shareMode 
)
inlineprotected

Constructs the base class.

Parameters
documentA weak pointer to the parent document.
partIdThe source part id for this instance.
shareModeThe ShareMode for this instance.

Member Function Documentation

◆ getSourcePartId()

Cmper musx::dom::EnigmaBase::getSourcePartId ( ) const
inline

Gets the source partId for this instance. If an instance is fully shared with the score, the source is SCORE_PARTID. If an instance is partially shared or non shared, the source is the ID of the part that sourced it.

Warning
This value is often different than the value used to retrieve the instance. Normally you should not use it to retrieve another instance.

◆ integrityCheck()

virtual void musx::dom::EnigmaBase::integrityCheck ( const std::shared_ptr< EnigmaBase > &  ptrToThis)
inlinevirtual

Performs a final consistency check after population.

Reimplemented in musx::dom::OthersArray< ElementType, REQUIRED_SIZE >, musx::dom::OthersArray< Evpu >, musx::dom::OthersArray< int >, musx::dom::OthersArray< int, 7 >, musx::dom::OthersArray< int16_t >, musx::dom::OthersArray< StaffCmper >, musx::dom::OthersArray< unsigned, 7 >, musx::dom::OthersArray< unsigned, 8 >, musx::dom::DetailsArray< ElementType, REQUIRED_SIZE >, musx::dom::DetailsArray< int, 7 >, musx::dom::KeySignature, musx::dom::details::FretboardDiagram, musx::dom::details::GFrameHold, musx::dom::details::IndependentStaffDetails, musx::dom::details::KeySymbolListElement, musx::dom::details::SecondaryBeamBreak, musx::dom::details::ShapeNoteBase, musx::dom::details::StaffGroup, musx::dom::Entry, musx::dom::others::FileAlias, musx::dom::others::FileUrlBookmark, musx::dom::others::PageGraphicAssign, musx::dom::options::LyricOptions, musx::dom::options::NoteRestOptions, musx::dom::options::TextOptions::InsertSymbolInfo, musx::dom::others::OssiaHeader, musx::dom::others::BeatChartElement, musx::dom::others::Frame, musx::dom::others::FretboardStyle, musx::dom::others::FretInstrument, musx::dom::others::MarkingCategory, musx::dom::others::Measure, musx::dom::others::MeasureExprAssign, musx::dom::others::MeasureNumberRegion::ScorePartData, musx::dom::others::MeasureNumberRegion, musx::dom::others::MultimeasureRest, musx::dom::others::MultiStaffInstrumentGroup, musx::dom::others::PageTextAssign, musx::dom::others::RepeatEndingStart, musx::dom::others::StaffSystem, musx::dom::others::SmartShape::TerminationSeg, musx::dom::others::SmartShape, musx::dom::others::SmartShapeCustomLine, musx::dom::details::CenterShape, musx::dom::others::Staff::Transposition, musx::dom::others::Staff, musx::dom::others::StaffStyle, and musx::dom::others::StaffStyleAssign.