TSDuck v3.40-4034
MPEG Transport Stream Toolkit
|
Template map of subclasses of EntryBase. More...
#include <tsAbstractTable.h>
Public Types | |
using | SuperClass = std::map< KEY, ENTRY > |
Explicit reference to the super class. | |
Public Member Functions | |
EntryWithDescriptorsMap (const AbstractTable *table, bool auto_ordering=false) | |
Basic constructor. | |
EntryWithDescriptorsMap (const AbstractTable *table, const EntryWithDescriptorsMap &other) | |
Basic copy-like constructor. | |
EntryWithDescriptorsMap (const AbstractTable *table, EntryWithDescriptorsMap &&other) | |
Basic move-like constructor. | |
void | getOrder (std::vector< KEY > &order) const |
Get the insertion order of entries in the table. | |
size_t | nextOrder () const |
Get the next ordering hint to be used in an entry to make sure it is considered the last one. | |
EntryWithDescriptorsMap & | operator= (const EntryWithDescriptorsMap &other) |
Assignment operator. | |
EntryWithDescriptorsMap & | operator= (EntryWithDescriptorsMap &&other) |
Move assignment operator. | |
ENTRY & | operator[] (const KEY &key) |
Access or create an entry. | |
const ENTRY & | operator[] (const KEY &key) const |
Access an existing entry in a read-only map. | |
void | setOrder (const std::vector< KEY > &order) |
Define the insertion order of entries in the table. | |
void | swap (EntryWithDescriptorsMap &other) |
Swap two instances (override of std::list). | |
Template map of subclasses of EntryBase.
KEY | A type which is used as key of the map. |
ENTRY | A subclass of EntryBase (enforced at compile-time). |
Implementation note: Because of a bug in MSVC, the full path of EntryBase must be specified in the "requires" directive.
|
explicit |
Basic constructor.
[in] | table | Parent table. A descriptor list is always attached to a table. |
[in] | auto_ordering | If true, each time an entry is added, its order_hint, if previously unset (meaning set to NPOS) is set to one higher than the highest order_hint in all entries. This ensures that the order of insertion is preserved, at the expense of a small performance penalty each time an entry is added. |
ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::EntryWithDescriptorsMap | ( | const AbstractTable * | table, |
const EntryWithDescriptorsMap< KEY, ENTRY > & | other | ||
) |
Basic copy-like constructor.
[in] | table | Parent table. A descriptor list is always attached to a table. |
[in] | other | Another instance to copy. |
ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::EntryWithDescriptorsMap | ( | const AbstractTable * | table, |
EntryWithDescriptorsMap< KEY, ENTRY > && | other | ||
) |
Basic move-like constructor.
[in] | table | Parent table. A descriptor list is always attached to a table. |
[in,out] | other | Another instance to move. |
ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY > & ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::operator= | ( | const EntryWithDescriptorsMap< KEY, ENTRY > & | other | ) |
Assignment operator.
The parent table remains unchanged.
[in] | other | Another instance to copy. |
ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY > & ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::operator= | ( | EntryWithDescriptorsMap< KEY, ENTRY > && | other | ) |
Move assignment operator.
The parent table remains unchanged.
[in,out] | other | Another instance to move. |
void ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::swap | ( | EntryWithDescriptorsMap< KEY, ENTRY > & | other | ) |
Swap two instances (override of std::list).
[in,out] | other | Another instance to swap with the current object. |
ENTRY & ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::operator[] | ( | const KEY & | key | ) |
Access or create an entry.
[in] | key | The key of the entry to access. |
const ENTRY & ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::operator[] | ( | const KEY & | key | ) | const |
Access an existing entry in a read-only map.
[in] | key | The key of the entry to access. |
std::out_of_range | When the entry does not exist. |
void ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::getOrder | ( | std::vector< KEY > & | order | ) | const |
Get the insertion order of entries in the table.
The result is based on the order_hint fields in the EntryBase structures.
[out] | order | Order of entries by key in the table. |
void ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::setOrder | ( | const std::vector< KEY > & | order | ) |
Define the insertion order of entries in the table.
This can be precisely set using the order_hint fields in the EntryBase structures. This method is a helper which sets these fields.
[in] | order | Order of entries by key in the table. |
size_t ts::AbstractTable::EntryWithDescriptorsMap< KEY, ENTRY >::nextOrder | ( | ) | const |
Get the next ordering hint to be used in an entry to make sure it is considered the last one.