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

Resolves the absolute path of BIOP objects within a DSM-CC Object Carousel by tracking the parent/child graph established by ServiceGateway and Directory bindings. More...

#include <tsDSMCCBIOPNameResolver.h>

Public Types

using EmitCallback = std::function< void(uint16_t module_id, const UString &name, const BIOPMessage &msg)>
 Callback invoked once a BIOP message is ready to be reported.
 
using NameKey = std::pair< uint16_t, ByteBlock >
 Identifies an object inside the carousel: (module_id, object_key).
 

Public Member Functions

 BIOPNameResolver ()=default
 Default constructor.
 
void addRoot (const NameKey &key)
 Mark a key as a carousel root (a ServiceGateway).
 
void clear ()
 Reset all internal state.
 
void defer (uint16_t module_id, std::unique_ptr< BIOPMessage > msg)
 Defer a BIOP message for later emission, in arrival order.
 
void drain (const EmitCallback &cb)
 Emit every deferred message whose name now resolves.
 
void flush (const EmitCallback &cb)
 Drain, then emit any still-deferred messages with an empty name.
 
void recordBindings (const NameKey &parent, const std::vector< BIOPBinding > &bindings)
 Record the parent->child name links carried by a Directory or ServiceGateway.
 
UString resolveName (const NameKey &key) const
 Resolve the absolute path of an object.
 

Detailed Description

Resolves the absolute path of BIOP objects within a DSM-CC Object Carousel by tracking the parent/child graph established by ServiceGateway and Directory bindings.

Buffers BIOP messages whose parent has not yet been seen and emits them once their name becomes resolvable.

Member Typedef Documentation

◆ EmitCallback

using ts::BIOPNameResolver::EmitCallback = std::function<void(uint16_t module_id, const UString& name, const BIOPMessage& msg)>

Callback invoked once a BIOP message is ready to be reported.

Parameters: module id, resolved path (empty if unresolved), the message.

Member Function Documentation

◆ addRoot()

void ts::BIOPNameResolver::addRoot ( const NameKey key)

Mark a key as a carousel root (a ServiceGateway).

Parameters
[in]key(module_id, object_key) of the ServiceGateway.

◆ recordBindings()

void ts::BIOPNameResolver::recordBindings ( const NameKey parent,
const std::vector< BIOPBinding > &  bindings 
)

Record the parent->child name links carried by a Directory or ServiceGateway.

Parameters
[in]parentIdentifier of the directory/SRG containing the bindings.
[in]bindingsThe bindings to record.

◆ defer()

void ts::BIOPNameResolver::defer ( uint16_t  module_id,
std::unique_ptr< BIOPMessage msg 
)

Defer a BIOP message for later emission, in arrival order.

Parameters
[in]module_idModule the message was parsed from.
[in]msgThe parsed message (ownership transferred).

◆ drain()

void ts::BIOPNameResolver::drain ( const EmitCallback cb)

Emit every deferred message whose name now resolves.

Messages that still cannot be resolved remain deferred.

Parameters
[in]cbCallback invoked for each emitted message.

◆ flush()

void ts::BIOPNameResolver::flush ( const EmitCallback cb)

Drain, then emit any still-deferred messages with an empty name.

Parameters
[in]cbCallback invoked for each emitted message.

◆ resolveName()

UString ts::BIOPNameResolver::resolveName ( const NameKey key) const

Resolve the absolute path of an object.

Parameters
[in]key(module_id, object_key) of the object.
Returns
Joined path starting with '/', or empty if no chain reaches a root.

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