TSDuck v3.44-4659
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::BIOPMessage Class Referenceabstract

BIOP Message (polymorphic base). More...

#include <tsDSMCCBIOPMessage.h>

Inheritance diagram for ts::BIOPMessage:
Collaboration diagram for ts::BIOPMessage:

Public Member Functions

 BIOPMessage ()=default
 Default constructor.
 
virtual ~BIOPMessage ()=default
 Virtual destructor.
 
virtual const std::vector< BIOPBinding > * bindingList () const
 Bindings carried by this message, if any.
 
virtual bool fromXML (DuckContext &duck, const xml::Element *element)
 This method decodes an XML BIOPMessage.
 
std::string kindTag () const
 Get the object kind as a trimmed string (without the trailing null, if any).
 
virtual void toXML (DuckContext &duck, xml::Element *parent) const
 This method converts a BIOPMessage to XML.
 

Static Public Member Functions

static std::unique_ptr< BIOPMessageFromXML (DuckContext &duck, const xml::Element *element)
 Parse a BIOP message from an XML element.
 
static std::unique_ptr< BIOPMessageParse (PSIBuffer &buf)
 Parse one BIOP message from a buffer.
 

Public Attributes

BIOPMessageHeader header {}
 BIOP message header.
 
ByteBlock object_info {}
 Object info bytes (kind-specific; opaque at this level).
 
ByteBlock object_key {}
 Object key bytes.
 
ByteBlock object_kind {}
 Object kind bytes on the wire (e.g. 'f','i','l',0). Use kindTag() for the trimmed tag.
 
std::vector< BIOPServiceContextservice_contexts {}
 Service context list.
 

Protected Member Functions

virtual bool deserializeBody (PSIBuffer &buf)=0
 Deserialize the subclass-specific message body.
 
virtual bool fromXMLBody (DuckContext &duck, const xml::Element *msg_element)=0
 Deserialize the subclass-specific body from XML.
 
virtual void toXMLBody (DuckContext &duck, xml::Element *msg_element) const =0
 Serialize the subclass-specific body to XML.
 

Static Protected Member Functions

static std::unique_ptr< BIOPMessageCreateForKind (const std::string &tag)
 Construct a concrete BIOPMessage subclass for a given object_kind tag.
 

Detailed Description

BIOP Message (polymorphic base).

Parses the 8-byte BIOP header plus the common fields shared by all in-carousel BIOP messages (message_size, objectKey, objectKind, objectInfo, serviceContextList, messageBody_length). The body is deserialized by concrete subclasses.

See also
ISO/IEC 13818-6 section 8
ETSI TR 101 202 section 4.4

Member Function Documentation

◆ kindTag()

std::string ts::BIOPMessage::kindTag ( ) const

Get the object kind as a trimmed string (without the trailing null, if any).

Returns
Trimmed kind string.

◆ bindingList()

virtual const std::vector< BIOPBinding > * ts::BIOPMessage::bindingList ( ) const
inlinevirtual

Bindings carried by this message, if any.

Returns
Pointer to the bindings vector for Directory / ServiceGateway messages, nullptr for kinds that don't carry bindings.

Reimplemented in ts::BIOPBindingListMessage.

◆ Parse()

static std::unique_ptr< BIOPMessage > ts::BIOPMessage::Parse ( PSIBuffer buf)
static

Parse one BIOP message from a buffer.

Dispatches to the concrete subclass based on object_kind.

Parameters
[in,out]bufDeserialization buffer.
Returns
Parsed message, or nullptr on error or unsupported kind.

◆ toXML()

virtual void ts::BIOPMessage::toXML ( DuckContext duck,
xml::Element parent 
) const
virtual

This method converts a BIOPMessage to XML.

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

◆ fromXML()

virtual bool ts::BIOPMessage::fromXML ( DuckContext duck,
const xml::Element element 
)
virtual

This method decodes an XML BIOPMessage.

Parameters
[in,out]duckTSDuck execution context.
[in]elementThe XML element containing the message.
Returns
True on success, false on error.

◆ FromXML()

static std::unique_ptr< BIOPMessage > ts::BIOPMessage::FromXML ( DuckContext duck,
const xml::Element element 
)
static

Parse a BIOP message from an XML element.

Dispatches to the concrete subclass based on the object_kind attribute.

Parameters
[in,out]duckTSDuck execution context.
[in]elementThe XML element to parse.
Returns
Parsed message, or nullptr on error or unsupported kind.

◆ CreateForKind()

static std::unique_ptr< BIOPMessage > ts::BIOPMessage::CreateForKind ( const std::string &  tag)
staticprotected

Construct a concrete BIOPMessage subclass for a given object_kind tag.

Parameters
[in]tagTrimmed object_kind string (e.g. "fil", "dir", "srg").
Returns
A new, empty subclass instance, or nullptr if the kind is unsupported.

◆ deserializeBody()

virtual bool ts::BIOPMessage::deserializeBody ( PSIBuffer buf)
protectedpure virtual

Deserialize the subclass-specific message body.

Parameters
[in,out]bufDeserialization buffer. Exactly the body bytes are available.
Returns
True on success.

Implemented in ts::BIOPFileMessage, and ts::BIOPBindingListMessage.

◆ toXMLBody()

virtual void ts::BIOPMessage::toXMLBody ( DuckContext duck,
xml::Element msg_element 
) const
protectedpure virtual

Serialize the subclass-specific body to XML.

Parameters
[in,out]duckTSDuck execution context.
[in,out]msg_elementThe <BIOP_message> XML element to append body children to.

Implemented in ts::BIOPFileMessage, and ts::BIOPBindingListMessage.

◆ fromXMLBody()

virtual bool ts::BIOPMessage::fromXMLBody ( DuckContext duck,
const xml::Element msg_element 
)
protectedpure virtual

Deserialize the subclass-specific body from XML.

Parameters
[in,out]duckTSDuck execution context.
[in]msg_elementThe <BIOP_message> XML element containing the body.
Returns
True on success.

Implemented in ts::BIOPFileMessage, and ts::BIOPBindingListMessage.


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