TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::AbstractTable::EntryWithDescriptorsList< ENTRY > Class Template Reference

Template map of subclasses of EntryBase, indexed by size_t. More...

#include <tsAbstractTable.h>

Inheritance diagram for ts::AbstractTable::EntryWithDescriptorsList< ENTRY >:
Collaboration diagram for ts::AbstractTable::EntryWithDescriptorsList< ENTRY >:

Public Types

using SuperClass = EntryWithDescriptorsMap< size_t, ENTRY >
 Explicit reference to the super class.
 

Public Member Functions

 EntryWithDescriptorsList (const AbstractTable *table)
 Basic constructor.
 
 EntryWithDescriptorsList (const AbstractTable *table, const SuperClass &other)
 Basic copy-like constructor.
 
void getOrder (std::vector< size_t > &order) const
 Get the insertion order of entries in the table.
 
ENTRY & newEntry ()
 Create a new entry in the map.
 
size_t nextIndex () const
 Get a new unused index, greater than the greatest entry.
 
size_t nextOrder () const
 Get the next ordering hint to be used in an entry to make sure it is considered the last one.
 
ENTRY & operator[] (const size_t &key)
 Access or create an entry.
 
const ENTRY & operator[] (const size_t &key) const
 Access an existing entry in a read-only map.
 
void setOrder (const std::vector< size_t > &order)
 Define the insertion order of entries in the table.
 
void swap (EntryWithDescriptorsMap &other)
 Swap two instances (override of std::list).
 

Detailed Description

template<class ENTRY>
requires std::derived_from<ENTRY, EntryBase>
class ts::AbstractTable::EntryWithDescriptorsList< ENTRY >

Template map of subclasses of EntryBase, indexed by size_t.

This is replacement for vectors and lists, which cannot be used by entries containing a descriptor list since it is not CopyAssignable or CopyConstructible.

Template Parameters
ENTRYA subclass of EntryBase (enforced at compile-time).

Constructor & Destructor Documentation

◆ EntryWithDescriptorsList() [1/2]

template<class ENTRY >
ts::AbstractTable::EntryWithDescriptorsList< ENTRY >::EntryWithDescriptorsList ( const AbstractTable table)
inlineexplicit

Basic constructor.

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

◆ EntryWithDescriptorsList() [2/2]

template<class ENTRY >
ts::AbstractTable::EntryWithDescriptorsList< ENTRY >::EntryWithDescriptorsList ( const AbstractTable table,
const SuperClass other 
)
inline

Basic copy-like constructor.

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

Member Function Documentation

◆ nextIndex()

template<class ENTRY >
size_t ts::AbstractTable::EntryWithDescriptorsList< ENTRY >::nextIndex ( ) const
inline

Get a new unused index, greater than the greatest entry.

Returns
A new unused index.

◆ newEntry()

template<class ENTRY >
ENTRY & ts::AbstractTable::EntryWithDescriptorsList< ENTRY >::newEntry ( )
inline

Create a new entry in the map.

Returns
A constant reference to the new entry.

◆ swap()

void ts::AbstractTable::EntryWithDescriptorsMap< size_t , ENTRY >::swap ( EntryWithDescriptorsMap< size_t, ENTRY > &  other)
inherited

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

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

◆ operator[]() [1/2]

ENTRY & ts::AbstractTable::EntryWithDescriptorsMap< size_t , ENTRY >::operator[] ( const size_t &  key)
inherited

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]

const ENTRY & ts::AbstractTable::EntryWithDescriptorsMap< size_t , ENTRY >::operator[] ( const size_t &  key) const
inherited

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()

void ts::AbstractTable::EntryWithDescriptorsMap< size_t , ENTRY >::getOrder ( std::vector< size_t > &  order) const
inherited

Get the insertion order of entries in the table.

The result is based on the order_hint fields in the EntryBase structures.

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

◆ setOrder()

void ts::AbstractTable::EntryWithDescriptorsMap< size_t , ENTRY >::setOrder ( const std::vector< size_t > &  order)
inherited

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.

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

◆ nextOrder()

size_t ts::AbstractTable::EntryWithDescriptorsMap< size_t , ENTRY >::nextOrder ( ) const
inherited

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.

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