MUSX Document Model
Loading...
Searching...
No Matches
ConstructionContext.h
1#pragma once
2
3#include <set>
4
5#include "musx/dom/DocumentElement.h"
6
7namespace musx {
8namespace factory {
9
12{
13public:
15 [[nodiscard]] dom::Cmper assignFontId(dom::Cmper fontId)
16 {
17 registerFontId(fontId);
18 return fontId;
19 }
20
23 {
24 if (fontId != 0) {
25 m_referencedFontIds.insert(fontId);
26 }
27 }
28
29private:
30 friend void resolveFontDefinitions(const dom::DocumentPtr&, const ConstructionContext&);
31
33 [[nodiscard]] const std::set<dom::Cmper>& referencedFontIds() const { return m_referencedFontIds; }
34
35 std::set<dom::Cmper> m_referencedFontIds;
36};
37
38} // namespace factory
39} // namespace musx
State shared by all factories during one document construction.
Definition ConstructionContext.h:12
void registerFontId(dom::Cmper fontId)
Records a non-default font definition ID referenced during construction.
Definition ConstructionContext.h:22
dom::Cmper assignFontId(dom::Cmper fontId)
Records fontId if it is non-default, then returns it unchanged.
Definition ConstructionContext.h:15
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:57
std::shared_ptr< Document > DocumentPtr
Shared Document pointer.
Definition DocumentElement.h:35
object model for musx file (enigmaxml)
Definition BaseClasses.h:38