31#include "Fundamentals.h"
32#include "DocumentElement.h"
70 Cmper getPartId()
const =
delete;
73 using typename std::vector<MusxInstance<T>>::value_type;
74 using typename std::vector<MusxInstance<T>>::allocator_type;
75 using typename std::vector<MusxInstance<T>>::size_type;
76 using typename std::vector<MusxInstance<T>>::difference_type;
77 using typename std::vector<MusxInstance<T>>::reference;
78 using typename std::vector<MusxInstance<T>>::const_reference;
79 using typename std::vector<MusxInstance<T>>::pointer;
80 using typename std::vector<MusxInstance<T>>::const_pointer;
81 using typename std::vector<MusxInstance<T>>::iterator;
82 using typename std::vector<MusxInstance<T>>::const_iterator;
83 using typename std::vector<MusxInstance<T>>::reverse_iterator;
84 using typename std::vector<MusxInstance<T>>::const_reverse_iterator;
147 std::optional<size_t> getIndexForStaff(
StaffCmper staffId)
const;
164 bool iterateEntries(
size_t startIndex,
size_t endIndex,
const MusicRange& range, std::function<
bool(
const EntryInfoPtr&)> iterator)
const;
195 static_assert(!std::is_reference_v<T>,
"T must not be a reference");
196 using OwnedT = std::remove_const_t<T>;
219 const T&
bind(
const T& ref)
noexcept
222 m_ref = std::addressof(ref);
233 const T&
emplace(OwnedT&& value)
noexcept(std::is_nothrow_move_constructible_v<OwnedT>) {
234 m_owned.emplace(std::move(value));
235 m_ref = std::addressof(*m_owned);
240 explicit operator bool() const noexcept {
return m_ref !=
nullptr; }
244 const T&
get() const noexcept {
return *m_ref; }
253 std::optional<OwnedT> m_owned = std::nullopt;
254 const T* m_ref =
nullptr;
257#ifndef DOXYGEN_SHOULD_IGNORE_THIS
266template<
class T> DeferredReference(
const T&) -> DeferredReference<T>;
267template<
class T> DeferredReference(
const T*) -> DeferredReference<T>;
Wraps a reference to an existing object or owns a temporary value if needed.
Definition MusxInstance.h:194
DeferredReference(const T *ptr) noexcept
Constructs a non-owning DeferredReference bound to a pointer.
Definition MusxInstance.h:208
const T & bind(const T &ref) noexcept
Binds this DeferredReference to an existing object without taking ownership.
Definition MusxInstance.h:219
DeferredReference() noexcept=default
Constructs an empty DeferredReference with no bound reference.
const T & emplace(OwnedT &&value) noexcept(std::is_nothrow_move_constructible_v< OwnedT >)
Moves a value into owned storage and binds to it.
Definition MusxInstance.h:233
const T * operator->() const noexcept
Provides pointer-like access to the referenced or owned object.
Definition MusxInstance.h:247
const T & operator*() const noexcept
Dereferences to the referenced or owned object.
Definition MusxInstance.h:250
const T & get() const noexcept
Gets a const reference to the referenced or owned object.
Definition MusxInstance.h:244
Base for DOM classes that belong to a Document.
Definition DocumentElement.h:46
Cmper getPartId() const
Gets the part id associated with this instance.
Definition DocumentElement.h:70
Represents a document object that encapsulates the entire EnigmaXML structure.
Definition Document.h:88
Wraps a frame of shared_ptr<const EntryInfo> and an index for per entry access. This class manages ow...
Definition Entries.h:513
Utility class that represents of a range of musical time.
Definition CommonClasses.h:492
A container of pooled shared object instances from an ObjectPool.
Definition MusxInstance.h:69
MusxInstanceListBase(const std::weak_ptr< Document > &document, Cmper partId)
Default constructor.
Definition MusxInstance.h:87
Cmper getRequestedPartId() const
Gets the part id that was used to create this list.
Definition MusxInstance.h:91
Provides optional per-type extension methods for MusxInstanceList.
Definition MusxInstance.h:118
An array of StaffUsed defines a set of staves in a staff system or in Scroll View.
Definition Others.h:2816
int16_t MeasCmper
Enigma meas Cmper (may be negative when not applicable)
Definition Fundamentals.h:64
std::shared_ptr< const T > MusxInstance
Defines the type of a musx instance stored in a pool.
Definition MusxInstance.h:40
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:55
int32_t Edu
"Enigma Durational Units" value (1024 per quarter note)
Definition Fundamentals.h:61
int16_t StaffCmper
Enigma staff (staffId) Cmper (may be negative when not applicable)
Definition Fundamentals.h:65
std::weak_ptr< const T > MusxInstanceWeak
Defines a weak ptr to the type of a musx instance stored in a pool.
Definition MusxInstance.h:45
object model for musx file (enigmaxml)
Definition BaseClasses.h:38