TSDuck Version 3.15-955 (TSDuck - The MPEG Transport Stream Toolkit)
ts::ShortEventDescriptor Class Reference

Representation of an short_event_descriptor. More...

Inheritance diagram for ts::ShortEventDescriptor:
Collaboration diagram for ts::ShortEventDescriptor:

Public Member Functions

 ShortEventDescriptor ()
 Default constructor.
 
 ShortEventDescriptor (const UString &lang, const UString &name, const UString &text)
 Constructor. More...
 
 ShortEventDescriptor (const Descriptor &bin, const DVBCharset *charset=0)
 Constructor from a binary descriptor. More...
 
virtual void buildXML (xml::Element *) const override
 Helper method to convert this object to XML. More...
 
virtual void deserialize (const Descriptor &, const DVBCharset *=0) override
 This abstract method deserializes a binary descriptor. More...
 
void deserialize (const DescriptorList &dlist, size_t index, const DVBCharset *charset=0)
 Deserialize a descriptor from a descriptor list. More...
 
virtual void fromXML (const xml::Element *) override
 This abstract converts an XML structure to a table or descriptor. More...
 
void invalidate ()
 Invalidate this object. More...
 
bool isPrivateDescriptor () const
 Check if this descriptor is a private descriptor. More...
 
bool isValid () const
 Check if this object is valid. More...
 
PDS requiredPDS () const
 Get the required private data specifier. More...
 
virtual void serialize (Descriptor &, const DVBCharset *=0) const override
 This abstract method serializes a descriptor. More...
 
size_t splitAndAdd (DescriptorList &dlist, const DVBCharset *charset=0) const
 Split the content into several ShortEventDescriptor. More...
 
DID tag () const
 Get the descriptor tag. More...
 
virtual xml::ElementtoXML (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 DisplayDescriptor (TablesDisplay &display, DID did, const uint8_t *payload, size_t size, int indent, TID tid, PDS pds)
 Static method to display a descriptor. More...
 

Public Attributes

UString event_name
 Event name.
 
UString language_code
 ISO-639 language code, 3 characters.
 
UString text
 Short event description.
 

Protected Member Functions

bool checkXMLName (const xml::Element *element) const
 Check that an XML element has the right name for this table. More...
 
bool serializeEnd (Descriptor &bin, const ByteBlockPtr &bbp) const
 Tool for serialization: complete a serialization. More...
 
ByteBlockPtr serializeStart () const
 Tool for serialization: get a byte buffer for serialization. More...
 

Static Protected Member Functions

static bool SerializeFixedLength (ByteBlock &bb, const UString &str, const size_t size, const DVBCharset *charset=0)
 This static method serializes a DVB string with a required fixed size. More...
 
static bool SerializeLanguageCode (ByteBlock &bb, const UString &str, const DVBCharset *charset=0)
 This abstract 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.
 
PDS _required_pds
 Required private data specified.
 
DID _tag
 The descriptor tag can be modified by subclasses only.
 
const UChar *const _xml_name
 XML table or descriptor name.
 

Detailed Description

Representation of an short_event_descriptor.

See also
ETSI 300 468, 6.2.37.

Constructor & Destructor Documentation

◆ ShortEventDescriptor() [1/2]

ts::ShortEventDescriptor::ShortEventDescriptor ( const UString lang,
const UString name,
const UString text 
)

Constructor.

Parameters
[in]langISO-639 language code, 3 characters.
[in]nameEvent name.
[in]textShort event description.

◆ ShortEventDescriptor() [2/2]

ts::ShortEventDescriptor::ShortEventDescriptor ( const Descriptor bin,
const DVBCharset charset = 0 
)

Constructor from a binary descriptor.

Parameters
[in]binA binary descriptor to deserialize.
[in]charsetIf not zero, character set to use without explicit table code.

Member Function Documentation

◆ splitAndAdd()

size_t ts::ShortEventDescriptor::splitAndAdd ( DescriptorList dlist,
const DVBCharset charset = 0 
) const

Split the content into several ShortEventDescriptor.

Split if the content is too long and add them in a descriptor list.

Parameters
[in,out]dlistDescriptor list.
[in]charsetIf not zero, default character set to use.
Returns
The number of descriptors.

◆ serialize()

virtual void ts::ShortEventDescriptor::serialize ( Descriptor bin,
const DVBCharset charset = 0 
) const
overridevirtual

This abstract method serializes a descriptor.

Parameters
[out]binA binary descriptor object. Its content is replaced with a binary representation of this object.
[in]charsetIf not zero, default character set to use.

Implements ts::AbstractDescriptor.

◆ deserialize() [1/2]

virtual void ts::ShortEventDescriptor::deserialize ( const Descriptor bin,
const DVBCharset charset = 0 
)
overridevirtual

This abstract method deserializes a binary descriptor.

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

Parameters
[in]binA binary descriptor to interpret according to the descriptor subclass.
[in]charsetIf not zero, character set to use without explicit table code.

Implements ts::AbstractDescriptor.

◆ buildXML()

virtual void ts::ShortEventDescriptor::buildXML ( xml::Element root) const
overridevirtual

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.

Reimplemented from ts::AbstractSignalization.

◆ fromXML()

virtual void ts::ShortEventDescriptor::fromXML ( 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]elementXML element to convert.

Implements ts::AbstractSignalization.

◆ DisplayDescriptor()

static void ts::ShortEventDescriptor::DisplayDescriptor ( TablesDisplay display,
DID  did,
const uint8_t *  payload,
size_t  size,
int  indent,
TID  tid,
PDS  pds 
)
static

Static method to display a descriptor.

Parameters
[in,out]displayDisplay engine.
[in]didDescriptor id.
[in]payloadAddress of the descriptor payload.
[in]sizeSize in bytes of the descriptor payload.
[in]indentIndentation width.
[in]tidTable id of table containing the descriptors.
[in]pdsPrivate Data Specifier.

◆ tag()

DID ts::AbstractDescriptor::tag ( ) const
inlineinherited

Get the descriptor tag.

Returns
The descriptor tag.

◆ requiredPDS()

PDS ts::AbstractDescriptor::requiredPDS ( ) const
inlineinherited

Get the required private data specifier.

Returns
The private data specifier which is required to interpret correctly this descriptor in a section. Return zero if this descriptor is a DVB-defined or MPEG-defined descriptor, not a private specifier.

◆ isPrivateDescriptor()

bool ts::AbstractDescriptor::isPrivateDescriptor ( ) const
inlineinherited

Check if this descriptor is a private descriptor.

Returns
True if this descriptor is a private descriptor, false if it is a DVB-defined or MPEG-defined descriptor.

◆ deserialize() [2/2]

void ts::AbstractDescriptor::deserialize ( const DescriptorList dlist,
size_t  index,
const DVBCharset charset = 0 
)
inherited

Deserialize a descriptor from a descriptor list.

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

Parameters
[in]dlistA list of binary descriptors.
[in]indexIndex of the descriptor to deserialize in dlist.
[in]charsetIf not zero, character set to use without explicit table code.

◆ serializeStart()

ByteBlockPtr ts::AbstractDescriptor::serializeStart ( ) const
protectedinherited

Tool for serialization: get a byte buffer for serialization.

Returns
A safe pointer to a two-byte byffer containing the descriptor tag and zero as length.

◆ serializeEnd()

bool ts::AbstractDescriptor::serializeEnd ( Descriptor bin,
const ByteBlockPtr bbp 
) const
protectedinherited

Tool for serialization: complete a serialization.

Parameters
[out]binA binary descriptor object which receives the serialized object.
[in]bbpSafe pointer containing the serialized data, typically returned by serializeStart(). The tag and length will be updated.
Returns
True if the serialized descriptor is valid.

◆ 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 ( 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]parentThe parent node for the new XML tree.
Returns
The new XML element.

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

◆ 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 ( ByteBlock bb,
const UString str,
const size_t  size,
const DVBCharset charset = 0 
)
staticprotectedinherited

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

Parameters
[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.
[in]charsetIf not zero, default character set to use.
Returns
True if the size has the required length and has been serialized.

◆ SerializeLanguageCode()

static bool ts::AbstractSignalization::SerializeLanguageCode ( ByteBlock bb,
const UString str,
const DVBCharset charset = 0 
)
inlinestaticprotectedinherited

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

Parameters
[in,out]bbA byte-block where str will be appended if its size is correct.
[in]strString to serialize.
[in]charsetIf not zero, default character set to use.
Returns
True if the size has the required length and has been serialized.

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