MUSX Document Model
Loading...
Searching...
No Matches
Document.h
1/*
2 * Copyright (C) 2024, Robert Patterson
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22#pragma once
23
24#include <memory>
25
26#include "Header.h"
27#include "ObjectPool.h"
28
33namespace musx {
34
35namespace factory {
36class DocumentFactory;
37} // namespace factory
38
43namespace dom {
44
45using namespace header;
46
51{
52public:
54 HeaderPtr& getHeader() { return m_header; }
56 const HeaderPtr& getHeader() const { return m_header; }
57
59 OptionsPoolPtr& getOptions() { return m_options; }
61 const OptionsPoolPtr& getOptions() const { return m_options; }
62
64 OthersPoolPtr& getOthers() { return m_others; }
66 const OthersPoolPtr& getOthers() const { return m_others; }
67
69 DetailsPoolPtr& getDetails() { return m_details; }
71 const DetailsPoolPtr& getDetails() const { return m_details; }
72
74 EntryPoolPtr& getEntries() { return m_entries; }
76 const EntryPoolPtr& getEntries() const { return m_entries; }
77
79 TextsPoolPtr& getTexts() { return m_texts; }
81 const TextsPoolPtr& getTexts() const { return m_texts; }
82
83private:
87 explicit Document() = default;
88
89 HeaderPtr m_header;
90 OptionsPoolPtr m_options;
91 OthersPoolPtr m_others;
92 DetailsPoolPtr m_details;
93 EntryPoolPtr m_entries;
94 TextsPoolPtr m_texts;
95
96 // Grant the factory class access to the private constructor
98};
99
100} // namespace dom
101} // namespace musx
Represents a document object that encapsulates the entire EnigmaXML structure.
Definition Document.h:51
const TextsPoolPtr & getTexts() const
Retrieves the const texts pool.
Definition Document.h:81
OthersPoolPtr & getOthers()
Retrieves the others pool.
Definition Document.h:64
const HeaderPtr & getHeader() const
Retrieves the const header.
Definition Document.h:56
const DetailsPoolPtr & getDetails() const
Retrieves the const others pool.
Definition Document.h:71
HeaderPtr & getHeader()
Retrieves the header.
Definition Document.h:54
const OptionsPoolPtr & getOptions() const
Retrieves the const options pool.
Definition Document.h:61
TextsPoolPtr & getTexts()
Retrieves the texts pool.
Definition Document.h:79
const OthersPoolPtr & getOthers() const
Retrieves the const others pool.
Definition Document.h:66
const EntryPoolPtr & getEntries() const
Retrieves the entry others pool.
Definition Document.h:76
DetailsPoolPtr & getDetails()
Retrieves the details pool.
Definition Document.h:69
OptionsPoolPtr & getOptions()
Retrieves the options pool.
Definition Document.h:59
EntryPoolPtr & getEntries()
Retrieves the entry pool.
Definition Document.h:74
Factory class for creating Document objects from XML.
Definition DocumentFactory.h:38
std::shared_ptr< Header > HeaderPtr
Shared Header pointer.
Definition Header.h:106
std::shared_ptr< OthersPool > OthersPoolPtr
Shared OthersPool pointer.
Definition ObjectPool.h:327
std::shared_ptr< DetailsPool > DetailsPoolPtr
Shared DetailsPool pointer.
Definition ObjectPool.h:378
std::shared_ptr< TextsPool > TextsPoolPtr
Shared OthersPool pointer.
Definition ObjectPool.h:420
std::shared_ptr< OptionsPool > OptionsPoolPtr
Shared OptionsPool pointer.
Definition ObjectPool.h:303
std::shared_ptr< EntryPool > EntryPoolPtr
Shared EntryPool pointer.
Definition ObjectPool.h:394
object model for musx file (enigmaxml)
Definition BaseClasses.h:32