27#include <unordered_map>
38#include "MusxInstance.h"
40#include "BaseClasses.h"
44#include "ShapeDesigner.h"
45#include "SmartShape.h"
48#ifndef DOXYGEN_SHOULD_IGNORE_THIS
52template<
class>
class PoolAccessor;
62template <
typename Pool,
typename T>
83template <
typename Pool,
typename T>
95template <
typename ObjectBaseType>
115 std::optional<Cmper> c1 = std::nullopt,
116 std::optional<Cmper> c2 = std::nullopt,
142 std::string result = std::string(
nodeId) +
" part " + std::to_string(
partId);
145 result +=
" cmpers [" + std::to_string(
cmper1.value()) +
", " + std::to_string(
cmper2.value()) +
"]";
147 result +=
" cmper " + std::to_string(
cmper1.value());
151 result +=
" inci " + std::to_string(
inci.value());
157 using PoolMap = std::map<ObjectKey, ObjectPtr>;
160 template <
typename T>
161 std::shared_ptr<const T> bindWithPartId(std::shared_ptr<const T> obj,
Cmper requestedPartId)
const
163 if constexpr (std::is_base_of_v<OthersBase, T> || std::is_base_of_v<DetailsBase, T>) {
164 if (obj && obj->getRequestedPartId() != requestedPartId) {
165 return PartContextCloner::copyWithPartId(obj, requestedPartId);
171 inline static ObjectKey makeEndKey(
const ObjectKey& key)
177 key.cmper1.value_or((std::numeric_limits<Cmper>::max)()),
178 key.cmper2.value_or((std::numeric_limits<Cmper>::max)()),
179 key.inci.value_or((std::numeric_limits<Inci>::max)())
183 template <
typename T>
184 inline static MusxInstance<T> checkedStaticCast([[maybe_unused]]
const ObjectKey& key,
const ObjectPtr& p)
186 static_assert(std::is_base_of_v<ObjectBaseType, T>,
"T must derive from ObjectBaseType");
187 if constexpr (!std::is_same_v<T, ObjectBaseType>) {
188 assert(T::XmlNodeName == key.nodeId &&
"nodeId/type mismatch: pool invariant violated");
194 return std::static_pointer_cast<T>(p);
197 inline static bool logicalLess(
const ObjectKey& a,
const ObjectKey& b)
199 return std::tie(a.cmper1, a.cmper2, a.inci) < std::tie(b.cmper1, b.cmper2, b.inci);
202 inline static bool logicalEq(
const ObjectKey& a,
const ObjectKey& b)
204 return a.cmper1 == b.cmper1 && a.cmper2 == b.cmper2 && a.inci == b.inci;
215 for (
const auto& [key,
object] : m_pool) {
217 object->integrityCheck(
object);
229 if (key.
inci.has_value()) {
231 noInciKey.
inci = std::nullopt;
232 auto currentIncis = getArray<ObjectBaseType>(noInciKey, key.
partId);
233 if (key.
inci.value() !=
int(currentIncis.size())) {
234 MUSX_INTEGRITY_ERROR(
"Node " + std::string(key.
nodeId) +
" has inci " + std::to_string(key.
inci.value()) +
" that is out of sequence.");
237 auto shareModeIt = m_shareMode.find(key.
nodeId);
238 const auto objectShareMode =
object->getShareMode();
239 const auto priorSize = m_pool.size();
240 typename PoolMap::iterator poolIt;
242 && (*m_insertionHint)->first.typeId == key.
typeId
243 && (*m_insertionHint)->first < key) {
244 poolIt = m_pool.emplace_hint(
245 std::next(*m_insertionHint), std::move(key), std::move(
object));
247 poolIt = m_pool.emplace(std::move(key), std::move(
object)).first;
249 const bool emplaced = m_pool.size() != priorSize;
250 m_insertionHint = poolIt;
252 MUSX_INTEGRITY_ERROR(
"Attempted to add same key more than once: " + poolIt->first.description());
254 if (shareModeIt == m_shareMode.end()) {
255 m_shareMode.emplace(poolIt->first.nodeId, objectShareMode);
258 m_shareMode[poolIt->first.nodeId] = objectShareMode;
260 MUSX_INTEGRITY_ERROR(
"Share mode for added " + std::string(poolIt->first.nodeId) +
" object [" + std::to_string(
int(objectShareMode))
261 +
"] does not match previous [" + std::to_string(
int(shareModeIt->second)) +
"]");
279 template <
typename T>
284 auto rangeStart = m_pool.lower_bound(key);
285 auto rangeEnd = m_pool.upper_bound(makeEndKey(key));
287 for (
auto it = rangeStart; it != rangeEnd; ++it) {
288 auto typedPtr = bindWithPartId<T>(checkedStaticCast<T>(key, it->second), requestedPartId);
289 result.push_back(typedPtr);
306 template <
typename T>
311 auto it = m_shareMode.find(key.
nodeId);
314 if (it != m_shareMode.end()) {
315 forShareMode = it->second;
320 return getArray<T>(key, key.
partId);
325 return getArray<T>(scoreKey, key.
partId);
328 const auto partStart = m_pool.lower_bound(key);
329 const auto partEnd = m_pool.upper_bound(makeEndKey(key));
331 const auto scoreStart = m_pool.lower_bound(scoreKey);
332 const auto scoreEnd = m_pool.upper_bound(makeEndKey(scoreKey));
334 auto partIt = partStart;
335 auto scoreIt = scoreStart;
338 auto pushInstance = [&](
const auto& it) {
339 auto typed = bindWithPartId<T>(checkedStaticCast<T>(key, it->second), key.
partId);
340 result.push_back(typed);
342 while (partIt != partEnd || scoreIt != scoreEnd) {
343 if (scoreIt == scoreEnd) {
344 pushInstance(partIt++);
347 if (partIt == partEnd) {
348 pushInstance(scoreIt++);
353 if (logicalEq(pk, sk)) {
354 pushInstance(partIt++);
356 }
else if (logicalLess(pk, sk)) {
357 pushInstance(partIt++);
359 pushInstance(scoreIt++);
376 template <
typename T>
379 auto it = m_pool.find(key);
380 if (it == m_pool.end()) {
383 return checkedStaticCast<T>(key, it->second);
393 template <
typename T>
395 std::optional<Cmper> cmper1 = std::nullopt,
396 std::optional<Cmper> cmper2 = std::nullopt,
397 std::optional<Inci> inci = std::nullopt)
const
399 const ObjectKey lowerKey{std::type_index(
typeid(T)), T::XmlNodeName,
SCORE_PARTID, cmper1, cmper2, inci};
400 const auto upperKey = [&]() ->
ObjectKey {
401 auto result = makeEndKey(lowerKey);
402 result.partId = (std::numeric_limits<Cmper>::max)();
405 std::vector<MusxInstance<T>> result;
406 for (
auto it = m_pool.lower_bound(lowerKey); it != m_pool.upper_bound(upperKey); ++it) {
407 const auto& key = it->first;
408 if (cmper1 && key.cmper1 != cmper1)
continue;
409 if (cmper2 && key.cmper2 != cmper2)
continue;
410 if (inci && key.inci != inci)
continue;
411 result.push_back(checkedStaticCast<T>(key, it->second));
429 template <
typename T>
432 if (
auto partVersion = getSource<T>(key)) {
440 auto it = m_shareMode.find(key.
nodeId);
447 return getSource<T>(scoreKey);
463 template <
typename T>
466 return bindWithPartId<T>(getEffectiveSourceForPart<T>(key), key.
partId);
475 template <
typename T,
typename IdGetter>
480 for (
const auto& item : items) {
481 highest = (std::max)(highest, std::invoke(getId, *item));
483 if (highest == (std::numeric_limits<Cmper>::max)()) {
486 return Cmper(highest + 1);
493 ObjectPool(
const DocumentWeakPtr& document,
const std::unordered_map<std::string_view, dom::EnigmaBase::ShareMode>& knownShareModes = {})
494 : m_document(document), m_shareMode(knownShareModes) {}
498 : m_document(other.m_document), m_shareMode(other.m_shareMode), m_pool(other.m_pool) {}
503 if (
this != &other) {
504 m_document = other.m_document;
505 m_shareMode = other.m_shareMode;
506 m_pool = other.m_pool;
507 m_insertionHint.reset();
517 std::unordered_map<std::string_view, dom::EnigmaBase::ShareMode> m_shareMode;
520 std::optional<typename PoolMap::iterator> m_insertionHint;
537 void add(std::string_view nodeName, std::shared_ptr<OptionsBase> instance)
541 MUSX_INTEGRITY_ERROR(
"Options node " + std::string(nodeName) +
" hase non-score part id [" + std::to_string(basePtr->
getSourcePartId()) +
"]");
544 std::type_index(
typeid(*basePtr)), nodeName, basePtr->
getSourcePartId()};
545 m_pool.
add(key, std::move(instance));
552 template <
typename T>
555 static_assert(is_pool_type_v<OptionsPool, T>,
"Type T is not registered in OptionsPool");
556 return m_pool.
getArray<T>({ std::type_index(
typeid(T)), T::XmlNodeName,
561 template <
typename T>
564 static_assert(is_pool_type_v<OptionsPool, T>,
"Type T is not registered in OptionsPool");
565 return m_pool.
getSource<T>({ std::type_index(
typeid(T)), T::XmlNodeName,
586 partId, staffId, std::nullopt, std::nullopt });
606 void add(std::string_view nodeName, std::shared_ptr<OthersBase> instance)
608 const OthersBase* instancePtr = instance.get();
610 std::type_index(
typeid(*instancePtr)), nodeName,
611 instance->getSourcePartId(), instance->getCmper(),
612 std::nullopt, instance->getInci()};
613 m_pool.
add(key, std::move(instance));
620 template <
typename T>
623 static_assert(is_pool_type_v<OthersPool, T>,
"Type T is not registered in OthersPool");
625 T::XmlNodeName, partId, cmper });
629 template <
typename T>
632 static_assert(is_pool_type_v<OthersPool, T>,
"Type T is not registered in OthersPool");
634 T::XmlNodeName, partId, cmper, std::nullopt, inci });
638 template <
typename T>
641 static_assert(is_pool_type_v<OthersPool, T>,
"Type T is not registered in OthersPool");
642 return m_pool.template getAllSources<T>();
651 template <
typename T>
653 Cmper cmper, std::optional<Inci> inci = std::nullopt)
const
655 static_assert(is_pool_type_v<OthersPool, T>,
"Type T is not registered in OthersPool");
656 return m_pool.template getAllSources<T>(cmper, std::nullopt, inci);
666 template <
typename T>
669 static_assert(is_pool_type_v<OthersPool, T>,
"Type T is not registered in OthersPool");
696 void add(std::string_view nodeName, std::shared_ptr<DetailsBase> instance)
700 std::type_index(
typeid(*instancePtr)), nodeName,
701 instance->getSourcePartId(), instance->getCmper1(),
702 instance->getCmper2(), instance->getInci()};
703 m_pool.
add(key, std::move(instance));
710 template <
typename T,
typename = std::enable_if_t<is_pool_type_v<DetailsPool, T>>>
712 {
return m_pool.template getArrayForPart<T>({ std::type_index(
typeid(T)), T::XmlNodeName, partId }); }
715 template <
typename T,
typename std::enable_if_t<!std::is_base_of_v<EntryDetailsBase, T>,
int> = 0>
718 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
719 return m_pool.template getArrayForPart<T>({ std::type_index(
typeid(T)),
720 T::XmlNodeName, partId, cmper1, cmper2 });
724 template <
typename T,
typename std::enable_if_t<std::is_base_of_v<EntryDetailsBase, T>,
int> = 0>
727 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
728 return m_pool.template getArrayForPart<T>({ std::type_index(
typeid(T)),
729 T::XmlNodeName, partId,
Cmper(entnum >> 16),
Cmper(entnum & 0xffff) });
733 template <
typename T,
typename std::enable_if_t<!std::is_base_of_v<EntryDetailsBase, T>,
int> = 0>
736 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
738 T::XmlNodeName, partId, cmper1, cmper2, inci });
742 template <
typename T>
745 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
746 return m_pool.template getAllSources<T>();
756 template <
typename T>
758 Cmper cmper1,
Cmper cmper2, std::optional<Inci> inci = std::nullopt)
const
760 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
761 return m_pool.template getAllSources<T>(cmper1, cmper2, inci);
765 template <
typename T,
typename std::enable_if_t<std::is_base_of_v<EntryDetailsBase, T>,
int> = 0>
768 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
770 T::XmlNodeName, partId,
Cmper(entnum >> 16),
Cmper(entnum & 0xffff), inci });
779 template <
typename T,
typename std::enable_if_t<std::is_base_of_v<NoteDetailsBase, T>,
int> = 0>
782 static_assert(is_pool_type_v<DetailsPool, T>,
"Type T is not registered in DetailsPool");
783 auto details = getArray<T>(
787 for (
const auto& detail : details) {
788 if (detail->getNoteId() == noteInfo->getNoteId()) {
807 bool empty()
const {
return m_pool.empty(); }
812 auto [it, emplaced] = m_pool.emplace(entryNumber, std::move(instance));
814 MUSX_INTEGRITY_ERROR(
"Entry number " + std::to_string(entryNumber) +
" added twice.");
821 std::vector<EntryNumber> entryNumbers;
822 entryNumbers.reserve(m_pool.size());
823 for (
const auto& [entryNumber, entry] : m_pool) {
825 entryNumbers.push_back(entryNumber);
827 std::sort(entryNumbers.begin(), entryNumbers.end());
828 for (
const auto entryNumber : entryNumbers) {
829 const auto& entry = m_pool.at(entryNumber);
830 entry->integrityCheck(entry);
837 const auto it = m_pool.find(entryNumber);
838 if (it == m_pool.end()) {
846 std::unordered_map<EntryNumber, std::shared_ptr<Entry>> m_pool;
848 friend class bench::PoolAccessor<
EntryPool>;
857 friend class bench::PoolAccessor<
TextsPool>;
864 void add(std::string_view nodeName, std::shared_ptr<TextsBase> instance)
868 MUSX_INTEGRITY_ERROR(
"Texts node " + std::string(nodeName) +
" hase non-score part id [" + std::to_string(basePtr->
getSourcePartId()) +
"]");
870 const TextsBase* instancePtr = instance.get();
872 std::type_index(
typeid(*instancePtr)), nodeName,
874 m_pool.
add(key, std::move(instance));
881 template <
typename T>
884 static_assert(is_pool_type_v<TextsPool, T>,
"Type T is not registered in TextsPool");
885 return m_pool.
getArray<T>({ std::type_index(
typeid(T)), T::XmlNodeName,
890 template <
typename T>
893 static_assert(is_pool_type_v<TextsPool, T>,
"Type T is not registered in TextsPool");
894 return m_pool.
getSource<T>({ std::type_index(
typeid(T)), T::XmlNodeName,
906 template <
typename T>
909 static_assert(is_pool_type_v<TextsPool, T>,
"Type T is not registered in TextsPool");
EnigmaBase class for all "details" types.
Definition BaseClasses.h:393
A pool that manages collections of DetailsBase objects, organized by XML node names and Cmper values.
Definition ObjectPool.h:683
MusxInstanceList< T > getArray(Cmper partId) const
version of ObjectPool::getArray for getting all of them
Definition ObjectPool.h:711
std::vector< MusxInstance< T > > getAllSources(Cmper cmper1, Cmper cmper2, std::optional< Inci > inci=std::nullopt) const
Returns physically stored source objects for one comparator pair and optional incidence.
Definition ObjectPool.h:757
MusxInstance< T > getForNote(const NoteInfoPtr ¬eInfo, const std::optional< Cmper > &forPartId=std::nullopt)
Returns the detail for a particular note.
Definition ObjectPool.h:780
void add(std::string_view nodeName, std::shared_ptr< DetailsBase > instance)
DetailsPool version of ObjectPool::add.
Definition ObjectPool.h:696
DetailsPool(const DocumentWeakPtr &document)
Constructor.
Definition ObjectPool.h:689
MusxInstance< T > get(Cmper partId, EntryNumber entnum, std::optional< Inci > inci=std::nullopt) const
Get a single EntryDetailsBase item out of the pool.
Definition ObjectPool.h:766
std::vector< MusxInstance< T > > getAllSources() const
Returns every physically stored source object of type T.
Definition ObjectPool.h:743
MusxInstanceList< T > getArray(Cmper partId, EntryNumber entnum) const
EntryDetailsPool version of ObjectPool::getArray.
Definition ObjectPool.h:725
MusxInstance< T > get(Cmper partId, Cmper cmper1, Cmper cmper2, std::optional< Inci > inci=std::nullopt) const
Get a single DetailsBase item out of the pool (not EntryDetailsBase)
Definition ObjectPool.h:734
void integrityCheckAll() const
Validates every details object. Called by document construction finalization.
Definition ObjectPool.h:707
MusxInstanceList< T > getArray(Cmper partId, Cmper cmper1, std::optional< Cmper > cmper2=std::nullopt) const
DetailsPool version of ObjectPool::getArray.
Definition ObjectPool.h:716
Base for DOM classes that are represented in EnigmaData.
Definition BaseClasses.h:88
ShareMode
Describes how this instance is shared between part and score.
Definition BaseClasses.h:95
Cmper getSourcePartId() const
Gets the source partId for this instance. If an instance is fully shared with the score,...
Definition BaseClasses.h:108
std::shared_ptr< const EntryFrame > getFrame() const
Returns the frame.
Definition Entries.h:656
Entry pool.
Definition ObjectPool.h:801
EntryPool(const DocumentWeakPtr &document)
Constructor function.
Definition ObjectPool.h:804
void integrityCheckAll() const
Validates every entry in entry-number order.
Definition ObjectPool.h:819
void add(EntryNumber entryNumber, std::shared_ptr< Entry > instance)
Add an entry to the EntryPool. (Used by the factory.)
Definition ObjectPool.h:810
bool empty() const
Returns whether the pool contains no entries.
Definition ObjectPool.h:807
MusxInstance< Entry > get(EntryNumber entryNumber) const
Get an entry from the EntryPool.
Definition ObjectPool.h:835
Provides optional per-type extension methods for MusxInstanceList.
Definition MusxInstance.h:118
Wraps an EntryInfo instance and a note index.
Definition Entries.h:1619
EntryInfoPtr getEntryInfo() const
Gets the entry info for this note.
Definition Entries.h:1659
A pool that manages collections of OthersBase objects, organized by XML node names and Cmper values.
Definition ObjectPool.h:97
ObjectPool(const DocumentWeakPtr &document, const std::unordered_map< std::string_view, dom::EnigmaBase::ShareMode > &knownShareModes={})
Constructs the object pool.
Definition ObjectPool.h:493
virtual ~ObjectPool()=default
virtual destructor
static std::optional< Cmper > nextFreeCmper(const MusxInstanceList< T > &items, IdGetter getId)
Returns the identifier one past the highest currently used in items.
Definition ObjectPool.h:476
ObjectPool(const ObjectPool &other)
Copies the stored objects without retaining an iterator into the source pool.
Definition ObjectPool.h:497
MusxInstance< T > getSource(const ObjectKey &key) const
Retrieves the first (and usually only) object of a specific type from the pool.
Definition ObjectPool.h:377
MusxInstanceList< T > getArrayForPart(const ObjectKey &key) const
Retrieves a vector of objects of a specific type from the pool.
Definition ObjectPool.h:307
MusxInstanceList< T > getArray(const ObjectKey &key, Cmper requestedPartId) const
Retrieves a vector of objects of a specific type from the pool.
Definition ObjectPool.h:280
std::vector< MusxInstance< T > > getAllSources(std::optional< Cmper > cmper1=std::nullopt, std::optional< Cmper > cmper2=std::nullopt, std::optional< Inci > inci=std::nullopt) const
Returns physically stored objects of one type across every source part.
Definition ObjectPool.h:394
ObjectPool & operator=(const ObjectPool &other)
Copies the stored objects without retaining an iterator into the source pool.
Definition ObjectPool.h:501
MusxInstance< T > getEffectiveSourceForPart(const ObjectKey &key) const
Retrieves the first (and usually only) object of a specific type from the pool for a part.
Definition ObjectPool.h:430
void add(ObjectKey key, ObjectPtr object)
Adds an ObjectBaseType object to the pool.
Definition ObjectPool.h:227
MusxInstance< T > getEffectiveForPart(const ObjectKey &key) const
Retrieves the first (and usually only) object of a specific type from the pool for a part.
Definition ObjectPool.h:464
std::shared_ptr< ObjectBaseType > ObjectPtr
shared pointer to ObjectBaseType
Definition ObjectPool.h:100
void integrityCheckAll() const
Runs object-local integrity validation for every stored source object.
Definition ObjectPool.h:213
A pool that manages collections of OptionsBase objects that have no Cmper value.
Definition ObjectPool.h:528
void integrityCheckAll() const
Validates every option object. Called by document construction finalization.
Definition ObjectPool.h:549
MusxInstance< T > get() const
Get a single item out of the pool.
Definition ObjectPool.h:562
MusxInstanceList< T > getArray() const
Scalar version of ObjectPool::getArray.
Definition ObjectPool.h:553
void add(std::string_view nodeName, std::shared_ptr< OptionsBase > instance)
Scalar version of ObjectPool::add.
Definition ObjectPool.h:537
OptionsPool(const DocumentWeakPtr &document)
Constructor function.
Definition ObjectPool.h:534
EnigmaBase class for all "others" types.
Definition BaseClasses.h:261
Cmper getCmper() const
Gets the cmper key value.
Definition BaseClasses.h:306
A pool that manages collections of OthersBase objects.
Definition ObjectPool.h:577
std::vector< MusxInstance< T > > getAllSources() const
Returns every physically stored source object of type T.
Definition ObjectPool.h:639
void add(std::string_view nodeName, std::shared_ptr< OthersBase > instance)
OthersPool version of ObjectPool::add.
Definition ObjectPool.h:606
void integrityCheckAll() const
Validates every others object. Called by document construction finalization.
Definition ObjectPool.h:617
MusxInstance< T > get(Cmper partId, Cmper cmper, std::optional< Inci > inci=std::nullopt) const
Get a single item out of the pool.
Definition ObjectPool.h:630
std::optional< Cmper > nextFreeCmper(Cmper partId) const
The cmper one past the highest currently used for T.
Definition ObjectPool.h:667
OthersPool(const DocumentWeakPtr &document)
Constructor.
Definition ObjectPool.h:591
std::vector< MusxInstance< T > > getAllSources(Cmper cmper, std::optional< Inci > inci=std::nullopt) const
Returns physically stored source objects for one comparator and optional incidence.
Definition ObjectPool.h:652
MusxInstanceList< T > getArray(Cmper partId, std::optional< Cmper > cmper=std::nullopt) const
OthersPool version of ObjectPool::getArray.
Definition ObjectPool.h:621
EnigmaBase class for all text blocks.
Definition BaseClasses.h:564
Cmper getTextNumber() const
Returns the raw text number.
Definition BaseClasses.h:584
Text pool.
Definition ObjectPool.h:855
MusxInstanceList< T > getArray(std::optional< Cmper > cmper=std::nullopt) const
Texts version of ObjectPool::getArray.
Definition ObjectPool.h:882
TextsPool(const DocumentWeakPtr &document)
Constructor fundtion.
Definition ObjectPool.h:861
MusxInstance< T > get(Cmper cmper) const
Get a single item out of the pool.
Definition ObjectPool.h:891
void add(std::string_view nodeName, std::shared_ptr< TextsBase > instance)
Texts version of ObjectPool::add.
Definition ObjectPool.h:864
void integrityCheckAll() const
Validates every text object. Called by document construction finalization.
Definition ObjectPool.h:878
std::optional< Cmper > nextFreeCmper() const
The text number one past the highest currently used for T.
Definition ObjectPool.h:907
static constexpr std::string_view XmlNodeName
XML node name for this type.
Definition Details.h:1941
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Details.h:2021
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:415
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:1736
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:1718
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:1892
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:2136
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:2202
static MusxInstance< StaffComposite > createCurrent(const DocumentPtr &document, Cmper partId, StaffCmper staffId, MeasCmper measId, Edu eduPosition)
Calculates the current staff at the specified metric position by applying all relevant staff styles,...
Definition Staff.cpp:1223
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Staff.h:742
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:2897
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:2930
Represents the definition of a Finale staff.
Definition Staff.h:54
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Staff.h:559
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Others.h:2955
std::shared_ptr< OthersPool > OthersPoolPtr
Shared OthersPool pointer.
Definition ObjectPool.h:674
int16_t MeasCmper
Enigma meas Cmper (may be negative when not applicable)
Definition Fundamentals.h:66
std::shared_ptr< const T > MusxInstance
Defines the type of a musx instance stored in a pool.
Definition MusxInstance.h:40
constexpr Cmper SCORE_PARTID
The part id of the score.
Definition Fundamentals.h:81
constexpr bool is_pool_type_v
Value shortcut for is_pool_type.
Definition ObjectPool.h:84
std::shared_ptr< DetailsPool > DetailsPoolPtr
Shared DetailsPool pointer.
Definition ObjectPool.h:797
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:57
std::shared_ptr< TextsPool > TextsPoolPtr
Shared OthersPool pointer.
Definition ObjectPool.h:914
int32_t Edu
"Enigma Durational Units" value (1024 per quarter note)
Definition Fundamentals.h:63
std::shared_ptr< OptionsPool > OptionsPoolPtr
Shared OptionsPool pointer.
Definition ObjectPool.h:570
std::weak_ptr< Document > DocumentWeakPtr
Shared weak Document pointer.
Definition DocumentElement.h:37
int32_t EntryNumber
Entry identifier.
Definition Fundamentals.h:71
std::shared_ptr< Document > DocumentPtr
Shared Document pointer.
Definition DocumentElement.h:35
int16_t StaffCmper
Enigma staff (staffId) Cmper (may be negative when not applicable)
Definition Fundamentals.h:67
std::shared_ptr< EntryPool > EntryPoolPtr
Shared EntryPool pointer.
Definition ObjectPool.h:851
object model for musx file (enigmaxml)
Definition BaseClasses.h:38
key type for storing in pool
Definition ObjectPool.h:102
std::optional< Cmper > cmper2
optional cmper2 for Details.
Definition ObjectPool.h:107
std::optional< Cmper > cmper1
optional cmper1 for Others, Texts, Details.
Definition ObjectPool.h:106
Cmper partId
the part this item is associated with (or 0 for score).
Definition ObjectPool.h:105
std::type_index typeId
runtime identity of the object's concrete class.
Definition ObjectPool.h:103
ObjectKey(std::type_index t, std::string_view n, Cmper p, std::optional< Cmper > c1=std::nullopt, std::optional< Cmper > c2=std::nullopt, std::optional< int > i=std::nullopt)
explicit constructor for optional parameters
Definition ObjectPool.h:112
bool operator<(const ObjectKey &other) const
comparison operator for std::map
Definition ObjectPool.h:122
std::string_view nodeId
the identifier for this node. usually the XML node name.
Definition ObjectPool.h:104
std::optional< int > inci
optional inci for multi-inci classes
Definition ObjectPool.h:109
std::string description() const
provides a description of the key for diagnostic purposes
Definition ObjectPool.h:140
Type trait to determine if a class in a given pool.
Definition ObjectPool.h:63