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

Text pool. More...

#include <ObjectPool.h>

Public Member Functions

 TextsPool (const DocumentWeakPtr &document)
 Constructor fundtion.
 
void add (std::string_view nodeName, std::shared_ptr< TextsBase > instance)
 Texts version of ObjectPool::add.
 
void integrityCheckAll () const
 Validates every text object. Called by document construction finalization.
 
template<typename T >
MusxInstanceList< T > getArray (std::optional< Cmper > cmper=std::nullopt) const
 Texts version of ObjectPool::getArray.
 
template<typename T >
MusxInstance< T > get (Cmper cmper) const
 Get a single item out of the pool.
 
template<typename T >
std::optional< CmpernextFreeCmper () const
 The text number one past the highest currently used for T.
 

Friends

class bench::PoolAccessor< TextsPool >
 

Detailed Description

Text pool.

Member Function Documentation

◆ nextFreeCmper()

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

The text number one past the highest currently used for T.

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

Template Parameters
TThe text type whose numbers are being counted.
Returns
The next free text number, or std::nullopt when the number space for T is exhausted.