TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::AbstractTable::AttachedEntryMap< KEY, ENTRY > Class Template Reference

#include <tsAbstractTable.h>

Inheritance diagram for ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >:
Collaboration diagram for ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >:

Public Types

using SuperClass = std::map<KEY, ENTRY>

Public Member Functions

 AttachedEntryMap (const AbstractTable *table, AttachedEntryMap &&other)
 AttachedEntryMap (const AbstractTable *table, bool auto_ordering=false)
 AttachedEntryMap (const AbstractTable *table, const AttachedEntryMap &other)
void getOrder (std::vector< KEY > &order) const
bool hasTable () const
size_t nextOrder () const
AttachedEntryMap & operator= (AttachedEntryMap &&other)
AttachedEntryMap & operator= (const AttachedEntryMap &other)
ENTRY & operator[] (const KEY &key)
const ENTRY & operator[] (const KEY &key) const
void setOrder (const std::vector< KEY > &order)
void swap (AttachedEntryMap &other)
const AbstractTable * table () const
TID tableId () const
Standards tableStandards () const

Detailed Description

template<typename KEY, class ENTRY>
requires std::derived_from<ENTRY, ts::AbstractTable::AttachedEntry>
class ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >

Template map of subclasses of AttachedEntry.

Template Parameters
KEYA type which is used as key of the map.
ENTRYA subclass of AttachedEntry (enforced at compile-time).

Implementation note: Because of a bug in MSVC, the full path of AttachedEntry must be specified in the "requires" directive.

Member Typedef Documentation

◆ SuperClass

template<typename KEY, class ENTRY>
using ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::SuperClass = std::map<KEY, ENTRY>

Explicit reference to the super class.

Constructor & Destructor Documentation

◆ AttachedEntryMap() [1/3]

template<typename KEY, class ENTRY>
ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::AttachedEntryMap ( const AbstractTable * table,
bool auto_ordering = false )
explicit

Basic constructor.

Parameters
[in]tableParent table. A descriptor list is always attached to a table.
[in]auto_orderingIf 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.

◆ AttachedEntryMap() [2/3]

template<typename KEY, class ENTRY>
ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::AttachedEntryMap ( const AbstractTable * table,
const AttachedEntryMap< KEY, ENTRY > & other )

Basic copy-like constructor.

Parameters
[in]tableParent table. A descriptor list is always attached to a table.
[in]otherAnother instance to copy.

◆ AttachedEntryMap() [3/3]

template<typename KEY, class ENTRY>
ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::AttachedEntryMap ( const AbstractTable * table,
AttachedEntryMap< KEY, ENTRY > && other )

Basic move-like constructor.

Parameters
[in]tableParent table. A descriptor list is always attached to a table.
[in,out]otherAnother instance to move.

Member Function Documentation

◆ operator=() [1/2]

template<typename KEY, class ENTRY>
ts::AbstractTable::AttachedEntryMap< KEY, ENTRY > & ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::operator= ( const AttachedEntryMap< KEY, ENTRY > & other)

Assignment operator. The parent table remains unchanged.

Parameters
[in]otherAnother instance to copy.
Returns
A reference to this object.

◆ operator=() [2/2]

template<typename KEY, class ENTRY>
ts::AbstractTable::AttachedEntryMap< KEY, ENTRY > & ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::operator= ( AttachedEntryMap< KEY, ENTRY > && other)

Move assignment operator. The parent table remains unchanged.

Parameters
[in,out]otherAnother instance to move.
Returns
A reference to this object.

◆ swap()

template<typename KEY, class ENTRY>
void ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::swap ( AttachedEntryMap< KEY, ENTRY > & other)

Swap two instances (override of std::list).

Parameters
[in,out]otherAnother instance to swap with the current object.

◆ operator[]() [1/2]

template<typename KEY, class ENTRY>
ENTRY & ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::operator[] ( const KEY & key)

Access or create an entry.

Parameters
[in]keyThe key of the entry to access.
Returns
A reference to the retrieved or created entry.

◆ operator[]() [2/2]

template<typename KEY, class ENTRY>
const ENTRY & ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::operator[] ( const KEY & key) const

Access an existing entry in a read-only map.

Parameters
[in]keyThe key of the entry to access.
Returns
A constant reference to the retrieved entry.
Exceptions
std::out_of_rangeWhen the entry does not exist.

◆ getOrder()

template<typename KEY, class ENTRY>
void ts::AbstractTable::AttachedEntryMap< 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 AttachedEntry structures.

Parameters
[out]orderOrder of entries by key in the table.

◆ setOrder()

template<typename KEY, class ENTRY>
void ts::AbstractTable::AttachedEntryMap< 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 AttachedEntry structures. This method is a helper which sets these fields.

Parameters
[in]orderOrder of entries by key in the table.

◆ nextOrder()

template<typename KEY, class ENTRY>
size_t ts::AbstractTable::AttachedEntryMap< KEY, ENTRY >::nextOrder ( ) const

Get the next ordering hint to be used in an entry to make sure it is considered the last one.

Returns
The next ordering hint to be used.

◆ tableId()

TID ts::AbstractTableAttachment::tableId ( ) const
inherited

Get the table id of the parent table.

Returns
The table id of the parent table or TID_NULL if there is none.

◆ tableStandards()

Standards ts::AbstractTableAttachment::tableStandards ( ) const
inherited

Get the standards of the parent table.

Returns
The standards of the parent table or NONE if there is none.

◆ table()

const AbstractTable * ts::AbstractTableAttachment::table ( ) const
inlineinherited

Get the parent table.

Returns
The parent table or zero if there is none.

◆ hasTable()

bool ts::AbstractTableAttachment::hasTable ( ) const
inlineinherited

Check if this instance has a parent table.

Returns
True if there is one parent table.

The documentation for this class was generated from the following file: