TSDuck Version 3.18-1255 (TSDuck - The MPEG Transport Stream Toolkit)
ts::AIT Class Reference

Representation of an Application Information Table (AIT) More...

Inheritance diagram for ts::AIT:
Collaboration diagram for ts::AIT:

Classes

struct  Application
 Description of an application inside an AIT. More...
 

Public Types

typedef EntryWithDescriptorsMap< ApplicationIdentifier, ApplicationApplicationMap
 List of applications, indexed by their identifier.
 

Public Member Functions

 AIT (uint8_t version=0, bool is_current=true, uint16_t application_type=0, bool test_application=false)
 Default constructor. More...
 
 AIT (const AIT &other)
 Copy constructor. More...
 
 AIT (DuckContext &duck, const BinaryTable &table)
 Constructor from a binary table. More...
 
virtual Standards definingStandards () const override
 Get the list of standards which define this object. More...
 
void deserialize (DuckContext &duck, const BinaryTable &bin)
 This method deserializes a binary table. More...
 
virtual void fromXML (DuckContext &, const xml::Element *) override
 This abstract converts an XML structure to a table or descriptor. More...
 
void invalidate ()
 Invalidate this object. More...
 
bool isValid () const
 Check if this object is valid. More...
 
AIToperator= (const AIT &other)=default
 Assignment operator. More...
 
void serialize (DuckContext &duck, BinaryTable &bin) const
 This method serializes a table. More...
 
TID tableId () const
 Get the table_id. More...
 
virtual xml::ElementtoXML (DuckContext &duck, xml::Element *parent) const
 This method converts this object to XML. More...
 
UString xmlName () const
 Get the XMl node name representing this table or descriptor. More...
 

Static Public Member Functions

static void DisplaySection (TablesDisplay &display, const Section &section, int indent)
 A static method to display a section. More...
 

Public Attributes

uint16_t application_type
 Type of the application.
 
ApplicationMap applications
 Map of applications: key=application_identifier, value=application.
 
DescriptorList descs
 Common descriptor list.
 
bool is_current
 True if table is current, false if table is next.
 
bool test_application_flag
 Indicates the application is meant for receiver testing.
 
uint8_t version
 Table version number.
 

Protected Member Functions

virtual void buildXML (DuckContext &, xml::Element *) const override
 Helper method to convert this object to XML. More...
 
bool checkXMLName (const xml::Element *element) const
 Check that an XML element has the right name for this table. More...
 
virtual void deserializeContent (DuckContext &, const BinaryTable &) override
 This abstract method deserializes the content of a binary table. More...
 
virtual bool isValidTableId (TID tid) const
 This method checks if a table id is valid for this object. More...
 
virtual void serializeContent (DuckContext &, BinaryTable &) const override
 This abstract method serializes the content of a table. More...
 

Static Protected Member Functions

static bool SerializeFixedLength (DuckContext &duck, ByteBlock &bb, const UString &str, const size_t size)
 This static method serializes a DVB string with a required fixed size. More...
 
static bool SerializeLanguageCode (DuckContext &duck, ByteBlock &bb, const UString &str)
 This static method serializes a 3-byte language or country code. More...
 

Protected Attributes

bool _is_valid
 It is the responsibility of the subclasses to set the valid flag.
 
TID _table_id
 The table id can be modified by subclasses only.
 
const UChar *const _xml_name
 XML table or descriptor name.
 

Detailed Description

Representation of an Application Information Table (AIT)

See also
ETSI TS 101 812, 10.4.6.

Constructor & Destructor Documentation

◆ AIT() [1/3]

ts::AIT::AIT ( uint8_t  version = 0,
bool  is_current = true,
uint16_t  application_type = 0,
bool  test_application = false 
)

Default constructor.

Parameters
[in]versionTable version number.
[in]is_currentTrue if table is current, false if table is next.
[in]application_typeApplication type.
[in]test_applicationTrue if this is a test application, false otherwise.

◆ AIT() [2/3]

ts::AIT::AIT ( const AIT other)

Copy constructor.

Parameters
[in]otherOther instance to copy.

◆ AIT() [3/3]

ts::AIT::AIT ( DuckContext duck,
const BinaryTable table 
)

Constructor from a binary table.

Parameters
[in,out]duckTSDuck execution context.
[in]tableBinary table to deserialize.

Member Function Documentation

◆ operator=()

AIT& ts::AIT::operator= ( const AIT other)
default

Assignment operator.

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

◆ fromXML()

virtual void ts::AIT::fromXML ( DuckContext duck,
const xml::Element element 
)
overridevirtual

This abstract converts an XML structure to a table or descriptor.

In case of success, this object is replaced with the interpreted content of the XML structure. In case of error, this object is invalidated.

Parameters
[in,out]duckTSDuck execution context.
[in]elementXML element to convert.

Implements ts::AbstractSignalization.

◆ DisplaySection()

static void ts::AIT::DisplaySection ( TablesDisplay display,
const Section section,
int  indent 
)
static

A static method to display a section.

Parameters
[in,out]displayDisplay engine.
[in]sectionThe section to display.
[in]indentIndentation width.

◆ serializeContent()

virtual void ts::AIT::serializeContent ( DuckContext duck,
BinaryTable bin 
) const
overrideprotectedvirtual

This abstract method serializes the content of a table.

This method is invoked by serialize() when the table is valid.

Parameters
[in,out]duckTSDuck execution context.
[out]binA binary table object. Its content is replaced with a binary representation of this object.

Implements ts::AbstractTable.

◆ deserializeContent()

virtual void ts::AIT::deserializeContent ( DuckContext duck,
const BinaryTable bin 
)
overrideprotectedvirtual

This abstract method deserializes the content of a binary table.

In case of success, this object is replaced with the interpreted content of bin. In case of error, this object is invalidated.

Parameters
[in,out]duckTSDuck execution context.
[in]binA binary table to interpret according to the table subclass.

Implements ts::AbstractTable.

◆ buildXML()

virtual void ts::AIT::buildXML ( DuckContext duck,
xml::Element root 
) const
overrideprotectedvirtual

Helper method to convert this object to XML.

When this object is valid, the default implementation of toXML() creates a root node with the default XML name and then invoke buildXML() to populate the XML node.

The default implementation is to do nothing. Subclasses which override toXML() do not need to implement buildXML() since it won't be invoked.

Parameters
[in,out]rootThe root node for the new XML tree.
[in,out]duckTSDuck execution context.

Reimplemented from ts::AbstractSignalization.

◆ tableId()

TID ts::AbstractTable::tableId ( ) const
inlineinherited

Get the table_id.

Returns
The table_id.

◆ serialize()

void ts::AbstractTable::serialize ( DuckContext duck,
BinaryTable bin 
) const
inherited

This method serializes a table.

Parameters
[in,out]duckTSDuck execution context.
[out]binA binary table object. Its content is replaced with a binary representation of this object.

◆ deserialize()

void ts::AbstractTable::deserialize ( DuckContext duck,
const BinaryTable bin 
)
inherited

This method deserializes a binary table.

In case of success, this object is replaced with the interpreted content of bin. In case of error, this object is invalidated.

Parameters
[in,out]duckTSDuck execution context.
[in]binA binary table to interpret according to the table subclass.

◆ isValidTableId()

virtual bool ts::AbstractTable::isValidTableId ( TID  tid) const
protectedvirtualinherited

This method checks if a table id is valid for this object.

Parameters
[in]tidA table id to check.
Returns
True if tid is a valid table id for this object, false otherwise. The default implementation checks that tid is identical to the table id of this object.

Reimplemented in ts::SDT, ts::EIT, and ts::NIT.

◆ isValid()

bool ts::AbstractSignalization::isValid ( ) const
inlineinherited

Check if this object is valid.

Returns
True if this object is valid.

◆ invalidate()

void ts::AbstractSignalization::invalidate ( )
inlineinherited

Invalidate this object.

This object must be rebuilt.

◆ xmlName()

UString ts::AbstractSignalization::xmlName ( ) const
inherited

Get the XMl node name representing this table or descriptor.

Returns
The XML node name.

◆ toXML()

virtual xml::Element* ts::AbstractSignalization::toXML ( DuckContext duck,
xml::Element parent 
) const
virtualinherited

This method converts this object to XML.

When this object is valid, the default implementation of toXML() creates a root node with the default XML name and then invoke buildXML() to populate the XML node.

Subclasses have the choice to either implement buildXML() or toXML(). If the object is serialized as one single XML node, it is simpler to implement buidlXML().

Parameters
[in,out]duckTSDuck execution context.
[in,out]parentThe parent node for the new XML tree.
Returns
The new XML element.

Reimplemented in ts::SSULinkageDescriptor, and ts::SSUDataBroadcastIdDescriptor.

◆ definingStandards()

virtual Standards ts::AbstractSignalization::definingStandards ( ) const
overridevirtualinherited

Get the list of standards which define this object.

Returns
A bit mask of standards.

Implements ts::AbstractDefinedByStandards.

◆ checkXMLName()

bool ts::AbstractSignalization::checkXMLName ( const xml::Element element) const
protectedinherited

Check that an XML element has the right name for this table.

Parameters
[in]elementXML element to check.
Returns
True on success, false on error.

◆ SerializeFixedLength()

static bool ts::AbstractSignalization::SerializeFixedLength ( DuckContext duck,
ByteBlock bb,
const UString str,
const size_t  size 
)
staticprotectedinherited

This static method serializes a DVB string with a required fixed size.

Parameters
[in,out]duckTSDuck execution context.
[in,out]bbA byte-block where str will be appended if its size is correct.
[in]strString to serialize.
[in]sizeRequired size in bytes of the serialized string.
Returns
True if the size has the required length and has been serialized.

◆ SerializeLanguageCode()

static bool ts::AbstractSignalization::SerializeLanguageCode ( DuckContext duck,
ByteBlock bb,
const UString str 
)
staticprotectedinherited

This static method serializes a 3-byte language or country code.

Parameters
[in,out]duckTSDuck execution context.
[in,out]bbA byte-block where str will be appended if its size is correct.
[in]strString to serialize.
Returns
True if the size has the required length and has been serialized.

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