SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Container of SF2 entities. More...
#include <ChunkItems.hpp>
Inherits SF2::IO::ChunkItemsSupport.
Public Types | |
using | ItemType = T |
using | ItemCollection = std::vector< ItemType > |
using | const_iterator = typename std::vector< ItemType >::const_iterator |
using | ItemRefCollection = std::vector< std::reference_wrapper< ItemType const > > |
Public Member Functions | |
ChunkItems () | |
Constructor for an empty collection. More... | |
ChunkItems (const ChunkList &source) | |
Constructor that loads items from the file. More... | |
size_t | size () const |
Get the number of items in this collection. More... | |
bool | empty () const |
Determine if collection is empty. More... | |
const ItemType & | operator[] (size_t index) const |
Obtain a (read-only) reference to an entity in the collection. More... | |
ItemRefCollection | slice (size_t first, size_t count) const |
Obtain a read-only slice of the original collection. More... | |
const_iterator | begin () const |
Obtain iterator to the start of the collection. More... | |
const_iterator | end () const |
Obtain iterator at the end of the collection. More... | |
void | dump (const std::string &indent) const |
Utility to dump out the contents of the collection. More... | |
Static Public Attributes | |
static constexpr size_t | itemSize = T::size |
Definition of the size in bytes of each item in the collection. More... | |
Friends | |
class | File |
Container of SF2 entities.
All SF2 containers are homogenous (all entities in the container have the same type). Compared to the ChunkType
type, this class holds actual values from an SF2 file while the former just knows where in the file to find the values.
Like most of the IO namespace, instances of this class are essentially immutable.
using SF2::IO::ChunkItems< T >::const_iterator = typename std::vector<ItemType>::const_iterator |
using SF2::IO::ChunkItems< T >::ItemCollection = std::vector<ItemType> |
using SF2::IO::ChunkItems< T >::ItemRefCollection = std::vector<std::reference_wrapper<ItemType const> > |
using SF2::IO::ChunkItems< T >::ItemType = T |
|
inline |
Constructor for an empty collection.
|
inlineexplicit |
Constructor that loads items from the file.
source | defines where to load and how many items to load |
|
inline |
Obtain iterator to the start of the collection.
Referenced by SF2::IO::ChunkItems< T >::dump().
|
inline |
Utility to dump out the contents of the collection.
indent | the prefix to use for all output |
References SF2::IO::ChunkItems< T >::begin(), SF2::IO::ChunkItemsSupport::beginDump(), SF2::IO::ChunkItems< T >::end(), and SF2::IO::ChunkItems< T >::size().
Referenced by SF2::IO::File::dump().
|
inline |
Determine if collection is empty.
|
inline |
Obtain iterator at the end of the collection.
Referenced by SF2::IO::ChunkItems< T >::dump().
|
inline |
Obtain a (read-only) reference to an entity in the collection.
index | the entity to fetch |
|
inline |
Get the number of items in this collection.
Referenced by SF2::IO::ChunkItems< T >::dump(), and SF2::IO::ChunkItems< T >::slice().
|
inline |
Obtain a read-only slice of the original collection.
first | the index of the first item to include in the collection |
count | the number of items to have in the slice |
References SF2::IO::ChunkItems< T >::size().
|
friend |
|
staticconstexpr |
Definition of the size in bytes of each item in the collection.