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, const 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::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

◆ 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.