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

A pool that manages collections of OthersBase objects. More...

#include <ObjectPool.h>

Public Member Functions

 OthersPool (const DocumentWeakPtr &document)
 Constructor.
 
void add (std::string_view nodeName, std::shared_ptr< OthersBase > instance)
 OthersPool version of ObjectPool::add.
 
void integrityCheckAll () const
 Validates every others object. Called by document construction finalization.
 
template<typename T >
MusxInstanceList< T > getArray (Cmper partId, std::optional< Cmper > cmper=std::nullopt) const
 OthersPool version of ObjectPool::getArray.
 
template<typename T >
MusxInstance< T > get (Cmper partId, Cmper cmper, std::optional< Inci > inci=std::nullopt) const
 Get a single item out of the pool.
 
template<typename T >
std::vector< MusxInstance< T > > getAllSources () const
 Returns every physically stored source object of type T.
 
template<typename T >
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.
 
template<typename T >
std::optional< CmpernextFreeCmper (Cmper partId) const
 The cmper one past the highest currently used for T.
 

Friends

class bench::PoolAccessor< OthersPool >
 
MusxInstance< others::StaffCompositeothers::StaffComposite::createCurrent (const DocumentPtr &document, Cmper partId, StaffCmper staffId, MeasCmper measId, Edu eduPosition)
 

Detailed Description

A pool that manages collections of OthersBase objects.

Member Function Documentation

◆ getAllSources()

template<typename T >
std::vector< MusxInstance< T > > musx::dom::OthersPool::getAllSources ( Cmper  cmper,
std::optional< Inci inci = std::nullopt 
) const
inline

Returns physically stored source objects for one comparator and optional incidence.

Parameters
cmperThe comparator to select.
inciIf present, restricts the result to this incidence.
Returns
Source objects in part and incidence order, without sharing fallbacks or copies.

◆ nextFreeCmper()

template<typename T >
std::optional< Cmper > musx::dom::OthersPool::nextFreeCmper ( Cmper  partId) const
inline

The cmper one past the highest currently used for T.

Each type numbers independently, so a cmper free for one type says nothing about another.

Template Parameters
TThe type whose cmpers are being counted.
Parameters
partIdThe part to search.
Returns
The next free cmper, or std::nullopt when the cmper space for T is exhausted.