TSDuck v3.40-4034
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::PSIRepository Class Reference

A repository for known PSI/SI tables and descriptors. More...

#include <tsPSIRepository.h>

Inheritance diagram for ts::PSIRepository:
Collaboration diagram for ts::PSIRepository:

Classes

class  DescriptorClass
 Description of a descriptor class. More...
 
class  RegisterDescriptor
 A class to register fully implemented descriptors. More...
 
class  RegisterTable
 A class to register fully implemented tables. More...
 
class  RegisterXML
 A class to register additional XML model files to merge with the main model for tables and descriptors. More...
 
class  SignalizationClass
 Base description of a signalization class, common to tables and descriptors. More...
 
class  TableClass
 Description of a table class. More...
 

Public Types

using DescriptorFactory = AbstractDescriptorPtr(*)()
 Profile of a function which creates a descriptor.
 
using TableFactory = AbstractTablePtr(*)()
 Profile of a function which creates a table.
 

Public Member Functions

UString descriptorTables (const DuckContext &duck, const UString &nodeName) const
 Get the list of tables where a descriptor is allowed, as a descriptive string.
 
void dumpInternalState (std::ostream &out) const
 Dump the internal state of the PSI repository (for debug only).
 
DisplayCADescriptorFunction getCADescriptorDisplay (CASID cas) const
 Get the display function of the CA_descriptor for a given CA_system_id.
 
const DescriptorClassgetDescriptor (const UString &xml_name) const
 Get the description of a descriptor class for a given XML node name.
 
const DescriptorClassgetDescriptor (EDID edid) const
 Get the description of a descriptor class for a given EDID.
 
const DescriptorClassgetDescriptor (std::type_index index, TID tid=TID_NULL, Standards standards=Standards::NONE) const
 Get the description of a descriptor class for a given descriptor closs RTTI index.
 
const DescriptorClassgetDescriptor (XDID xdid, DescriptorContext &context) const
 Get the description of a descriptor class for a given descriptor tag and its context.
 
void getRegisteredDescriptorIds (std::vector< EDID > &ids) const
 Get the list of all registered descriptor tags.
 
void getRegisteredDescriptorNames (UStringList &names) const
 Get the list of all registered XML names for descriptors.
 
void getRegisteredTableIds (std::vector< TID > &ids) const
 Get the list of all registered table ids.
 
void getRegisteredTableNames (UStringList &names) const
 Get the list of all registered XML names for tables.
 
void getRegisteredTablesModels (UStringList &names) const
 Get the list of all registered additional XML model file names for tables and descriptors.
 
const TableClassgetTable (const UString &xml_name) const
 Get the description of a table class for a given XML node name.
 
const TableClassgetTable (TID tid, const SectionContext &context=SectionContext()) const
 Get the description of a table class for a given table id and context.
 
Standards getTableStandards (TID id, PID pid=PID_NULL) const
 Get the list of standards which are defined for a given table id.
 
bool isDescriptorAllowed (const UString &xml_name, TID tid) const
 Check if a descriptor is allowed in a table.
 

Static Public Member Functions

static PSIRepositoryInstance ()
 Get the instance of the singleton of this class.
 
static std::type_index NullIndex ()
 Get a value of a "null" type index.
 

Detailed Description

A repository for known PSI/SI tables and descriptors.

This class is a singleton. Use static Instance() method to access the single instance.

Multi-threading considerations: The singleton is built and modified using static registration instances during the initialization of the application (ie. in one single thread). Then, the singleton is only read during the execution of the application. So, no explicit synchronization is required.

Mixed ISDB-DVB compatibility. ISDB is based on a subset of DVB and adds other tables and descriptors. The DVB subset is compatible with ISDB. When another DID or TID is defined with two distinct semantics, one for DVB and one for ISDB, if ISDB is part of the current standards we use the ISDB semantics, otherwise we use the DVB semantics.

Member Typedef Documentation

◆ TableFactory

Profile of a function which creates a table.

Returns
A safe pointer to an instance of a concrete subclass of AbstractTable.

◆ DescriptorFactory

Profile of a function which creates a descriptor.

Returns
A safe pointer to an instance of a concrete subclass of AbstractDescriptor.

Member Function Documentation

◆ Instance()

static PSIRepository & ts::PSIRepository::Instance ( )
inlinestatic

Get the instance of the singleton of this class.

Returns
The instance of the singleton of this class.

◆ NullIndex()

static std::type_index ts::PSIRepository::NullIndex ( )
inlinestatic

Get a value of a "null" type index.

The same value is always returned and can be used as a placeholder for an unused value.

Returns
A value of a "null" type index.

◆ getTable() [1/2]

const TableClass & ts::PSIRepository::getTable ( TID  tid,
const SectionContext context = SectionContext() 
) const

Get the description of a table class for a given table id and context.

Parameters
[in]tidTable id.
[in]contextOptional object to lookup the context of the table. This may help disambiguate tables with distinct standards but identical table_id.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a TableClass).

◆ getTable() [2/2]

const TableClass & ts::PSIRepository::getTable ( const UString xml_name) const

Get the description of a table class for a given XML node name.

Parameters
[in]xml_nameName of XML node.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a TableClass).

◆ getTableStandards()

Standards ts::PSIRepository::getTableStandards ( TID  id,
PID  pid = PID_NULL 
) const

Get the list of standards which are defined for a given table id.

Parameters
[in]idTable id.
Returns
Corresponding list of standards. If multiple definitions exist for this table id, return the common subset of all definitions. This means that only standards which are used in all cases are returned.
Parameters
[in]pidPID on which the section is found.

◆ getDescriptor() [1/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( EDID  edid) const

Get the description of a descriptor class for a given EDID.

Parameters
[in]edidExtended descriptor id.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ getDescriptor() [2/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( XDID  xdid,
DescriptorContext context 
) const

Get the description of a descriptor class for a given descriptor tag and its context.

Parameters
[in]xdidExtension descriptor id. This value is extracted from the descriptor itself.
[in,out]contextObject to lookup the context of the descriptor.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ getDescriptor() [3/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( std::type_index  index,
TID  tid = TID_NULL,
Standards  standards = Standards::NONE 
) const

Get the description of a descriptor class for a given descriptor closs RTTI index.

Useful for a descriptor class to get its own description.

Parameters
[in]indexRTTI index for the descriptor class.
[in]tidOptional TID. If the descriptor class is table-specific for several tables, return the EDID for that table. If tid is TID_NULL and there are several specific tables for that descriptor, the first one is returned.
[in]standardsOptional list of standards for the table.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ getDescriptor() [4/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( const UString xml_name) const

Get the description of a descriptor class for a given XML node name.

Parameters
[in]xml_nameName of XML node.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ isDescriptorAllowed()

bool ts::PSIRepository::isDescriptorAllowed ( const UString xml_name,
TID  tid 
) const

Check if a descriptor is allowed in a table.

Parameters
[in]xml_nameName of the XML node for the descriptor.
[in]tidTable id of the table to check.
Returns
True if the descriptor is allowed, false otherwise. Non-table-specific descriptors are allowed everywhere. Table-specific descriptors are allowed only in a set of specific tables.

◆ descriptorTables()

UString ts::PSIRepository::descriptorTables ( const DuckContext duck,
const UString nodeName 
) const

Get the list of tables where a descriptor is allowed, as a descriptive string.

Parameters
[in]duckTSDuck execution context to interpret table names.
[in]nodeNameName of the XML node for the descriptor.
Returns
Human-readable list of tables where the descriptor is allowed. Empty string for non-table-specific descriptors.

◆ getCADescriptorDisplay()

DisplayCADescriptorFunction ts::PSIRepository::getCADescriptorDisplay ( CASID  cas) const

Get the display function of the CA_descriptor for a given CA_system_id.

Parameters
[in]casCA_system_id.
Returns
Corresponding display function or zero if there is none.

◆ getRegisteredTableIds()

void ts::PSIRepository::getRegisteredTableIds ( std::vector< TID > &  ids) const

Get the list of all registered table ids.

Parameters
[out]idsList of all registered table ids.

◆ getRegisteredDescriptorIds()

void ts::PSIRepository::getRegisteredDescriptorIds ( std::vector< EDID > &  ids) const

Get the list of all registered descriptor tags.

Parameters
[out]idsList of all registered descriptor tags.

◆ getRegisteredTableNames()

void ts::PSIRepository::getRegisteredTableNames ( UStringList names) const

Get the list of all registered XML names for tables.

Parameters
[out]namesList of all registered XML names for tables.

◆ getRegisteredDescriptorNames()

void ts::PSIRepository::getRegisteredDescriptorNames ( UStringList names) const

Get the list of all registered XML names for descriptors.

Parameters
[out]namesList of all registered XML names for descriptors.

◆ getRegisteredTablesModels()

void ts::PSIRepository::getRegisteredTablesModels ( UStringList names) const

Get the list of all registered additional XML model file names for tables and descriptors.

Parameters
[out]namesList of all registered additional XML model file names.

◆ dumpInternalState()

void ts::PSIRepository::dumpInternalState ( std::ostream &  out) const

Dump the internal state of the PSI repository (for debug only).

Parameters
[in,out]outOutput stream.

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