A pool that manages collections of OthersBase objects.
More...
#include <ObjectPool.h>
|
|
| 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< Cmper > | nextFreeCmper (Cmper partId) const |
| | The cmper one past the highest currently used for T.
|
| |
A pool that manages collections of OthersBase objects.
◆ 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
-
| cmper | The comparator to select. |
| inci | If 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
-
| T | The type whose cmpers are being counted. |
- Parameters
-
| partId | The part to search. |
- Returns
- The next free cmper, or std::nullopt when the cmper space for
T is exhausted.