TSDuck Version 3.16-1064 (TSDuck - The MPEG Transport Stream Toolkit)
ts::Service Class Reference

Describe a DVB service. More...

Inheritance diagram for ts::Service:

Public Types

enum  ServiceField : uint32_t {
  ID = 0x0001,
  TSID = 0x0002,
  ONID = 0x0004,
  PMT_PID = 0x0008,
  LCN = 0x0010,
  TYPE = 0x0020,
  NAME = 0x0040,
  PROVIDER = 0x0080,
  EITS = 0x0100,
  EITPF = 0x0200,
  CA = 0x0400,
  RUNNING = 0x0800
}
 List of possible fields a Service may have set. More...
 

Public Member Functions

 Service ()
 Default constructor.
 
 Service (uint16_t id)
 Constructor using a service id. More...
 
 Service (const UString &desc)
 Constructor using a string description. More...
 
virtual ~Service ()
 Destructor.
 
virtual void clear ()
 Clear all fields.
 
void clearCAControlled ()
 Clear the CA-controlled (as declared in the SDT) . More...
 
void clearEITpfPresent ()
 Clear the EIT present/following present (as declared in the SDT) . More...
 
void clearEITsPresent ()
 Clear the EIT schedule present (as declared in the SDT) . More...
 
void clearId ()
 Clear the Service Id . More...
 
void clearLCN ()
 Clear the Logical Channel Number . More...
 
void clearName ()
 Clear the Service Name . More...
 
void clearONId ()
 Clear the Original Network Id . More...
 
void clearPMTPID ()
 Clear the PMT PID . More...
 
void clearProvider ()
 Clear the Provider Name . More...
 
void clearRunningStatus ()
 Clear the Running status (as declared in the SDT) . More...
 
void clearTSId ()
 Clear the Transport Stream Id . More...
 
void clearType ()
 Clear the Service Type (as declared in service_descriptor) . More...
 
bool getCAControlled () const
 Get the CA-controlled (as declared in the SDT) . More...
 
bool getEITpfPresent () const
 Get the EIT present/following present (as declared in the SDT) . More...
 
bool getEITsPresent () const
 Get the EIT schedule present (as declared in the SDT) . More...
 
uint32_t getFields () const
 Get the list of fields which are set in a Service. More...
 
uint16_t getId () const
 Get the Service Id . More...
 
uint16_t getLCN () const
 Get the Logical Channel Number . More...
 
UString getName () const
 Get the Service Name . More...
 
uint16_t getONId () const
 Get the Original Network Id . More...
 
PID getPMTPID () const
 Get the PMT PID . More...
 
UString getProvider () const
 Get the Provider Name . More...
 
uint8_t getRunningStatus () const
 Get the Running status (as declared in the SDT) . More...
 
uint16_t getTSId () const
 Get the Transport Stream Id . More...
 
uint8_t getType () const
 Get the Service Type (as declared in service_descriptor) . More...
 
bool hasCAControlled () const
 Check if the CA-controlled (as declared in the SDT) is present. More...
 
bool hasCAControlled (bool value) const
 Check if the CA-controlled (as declared in the SDT) has a given value. More...
 
bool hasEITpfPresent () const
 Check if the EIT present/following present (as declared in the SDT) is present. More...
 
bool hasEITpfPresent (bool value) const
 Check if the EIT present/following present (as declared in the SDT) has a given value. More...
 
bool hasEITsPresent () const
 Check if the EIT schedule present (as declared in the SDT) is present. More...
 
bool hasEITsPresent (bool value) const
 Check if the EIT schedule present (as declared in the SDT) has a given value. More...
 
bool hasId (uint16_t value) const
 Check if the Service Id has a given value. More...
 
bool hasId () const
 Check if the Service Id is present. More...
 
bool hasLCN () const
 Check if the Logical Channel Number is present. More...
 
bool hasLCN (uint16_t value) const
 Check if the Logical Channel Number has a given value. More...
 
bool hasName () const
 Check if the Service Name is present. More...
 
bool hasName (const UString &value) const
 Check if the Service Name has a given value. More...
 
bool hasONId () const
 Check if the Original Network Id is present. More...
 
bool hasONId (uint16_t value) const
 Check if the Original Network Id has a given value. More...
 
bool hasPMTPID () const
 Check if the PMT PID is present. More...
 
bool hasPMTPID (PID value) const
 Check if the PMT PID has a given value. More...
 
bool hasProvider () const
 Check if the Provider Name is present. More...
 
bool hasProvider (const UString &value) const
 Check if the Provider Name has a given value. More...
 
bool hasRunningStatus () const
 Check if the Running status (as declared in the SDT) is present. More...
 
bool hasRunningStatus (uint8_t value) const
 Check if the Running status (as declared in the SDT) has a given value. More...
 
bool hasTSId () const
 Check if the Transport Stream Id is present. More...
 
bool hasTSId (uint16_t value) const
 Check if the Transport Stream Id has a given value. More...
 
bool hasType (uint8_t value) const
 Check if the Service Type (as declared in service_descriptor) has a given value. More...
 
bool hasType () const
 Check if the Service Type (as declared in service_descriptor) is present. More...
 
virtual void set (const UString &desc)
 Reset using a string description. More...
 
void setCAControlled (bool value)
 Set the CA-controlled (as declared in the SDT) . More...
 
void setEITpfPresent (bool value)
 Set the EIT present/following present (as declared in the SDT) . More...
 
void setEITsPresent (bool value)
 Set the EIT schedule present (as declared in the SDT) . More...
 
void setId (uint16_t value)
 Set the Service Id . More...
 
void setLCN (uint16_t value)
 Set the Logical Channel Number . More...
 
void setName (const UString &value)
 Set the Service Name . More...
 
void setONId (uint16_t value)
 Set the Original Network Id . More...
 
void setPMTPID (PID value)
 Set the PMT PID . More...
 
void setProvider (const UString &value)
 Set the Provider Name . More...
 
void setRunningStatus (uint8_t value)
 Set the Running status (as declared in the SDT) . More...
 
void setTSId (uint16_t value)
 Set the Transport Stream Id . More...
 
void setType (uint8_t value)
 Set the Service Type (as declared in service_descriptor) . More...
 

Static Public Member Functions

template<class ITERATOR >
static std::ostream & Display (std::ostream &strm, const UString &margin, const ITERATOR &begin, const ITERATOR &end, bool header=true)
 Display a container of services, one line per service. More...
 
template<class CONTAINER >
static std::ostream & Display (std::ostream &strm, const UString &margin, const CONTAINER &container, bool header=true)
 Display a container of services, one line per service. More...
 
static bool Sort1 (const Service &s1, const Service &s2)
 Sorting criterion method, used by std::sort(). More...
 
static bool Sort2 (const Service &s1, const Service &s2)
 Sorting criterion method, used by std::sort(). More...
 
static bool Sort3 (const Service &s1, const Service &s2)
 Sorting criterion method, used by std::sort(). More...
 

Detailed Description

Describe a DVB service.

An instance of this class contains all possible properties of a DVB service. But all properties are optional. They may be set and cleared. Check the availability of a property before getting it.

Member Enumeration Documentation

◆ ServiceField

enum ts::Service::ServiceField : uint32_t

List of possible fields a Service may have set.

Can be used as bitfield.

Enumerator
ID 

Service id.

TSID 

Transport stream id.

ONID 

Original network id.

PMT_PID 

PMT PID.

LCN 

Logical channel number.

TYPE 

Service type (as defined in service_descriptor).

NAME 

Service name.

PROVIDER 

Provider name.

EITS 

EIT schedule present (as declared in the SDT).

EITPF 

EIT present/following present (as declared in the SDT).

CA 

CA-controlled (as declared in the SDT).

RUNNING 

Running status (as declared in the SDT).

Constructor & Destructor Documentation

◆ Service() [1/2]

ts::Service::Service ( uint16_t  id)

Constructor using a service id.

Parameters
[in]idService id.

◆ Service() [2/2]

ts::Service::Service ( const UString desc)

Constructor using a string description.

Parameters
[in]descService description string. If the string evaluates to an integer (decimal or hexa), this is a service id, otherwise this is a service name.

Member Function Documentation

◆ set()

virtual void ts::Service::set ( const UString desc)
virtual

Reset using a string description.

Parameters
[in]descService description string. If the string evaluates to an integer (decimal or hexa), this is a service id, otherwise this is a service name.

Reimplemented in ts::ServiceDiscovery.

◆ hasId() [1/2]

bool ts::Service::hasId ( ) const
inline

Check if the Service Id is present.

Returns
True if the Service Id is present.

◆ clearId()

void ts::Service::clearId ( )
inline

Clear the Service Id .

◆ getId()

uint16_t ts::Service::getId ( ) const
inline

Get the Service Id .

Returns
The Service Id or 0 if unset.

◆ setId()

void ts::Service::setId ( uint16_t  value)
inline

Set the Service Id .

Parameters
[in]valueThe Service Id .

◆ hasId() [2/2]

bool ts::Service::hasId ( uint16_t  value) const
inline

Check if the Service Id has a given value.

Parameters
[in]valueThe Service Id to check.
Returns
True if the Service Id is equal to value.

◆ hasTSId() [1/2]

bool ts::Service::hasTSId ( ) const
inline

Check if the Transport Stream Id is present.

Returns
True if the Transport Stream Id is present.

◆ clearTSId()

void ts::Service::clearTSId ( )
inline

Clear the Transport Stream Id .

◆ getTSId()

uint16_t ts::Service::getTSId ( ) const
inline

Get the Transport Stream Id .

Returns
The Transport Stream Id or 0 if unset.

◆ setTSId()

void ts::Service::setTSId ( uint16_t  value)
inline

Set the Transport Stream Id .

Parameters
[in]valueThe Transport Stream Id .

◆ hasTSId() [2/2]

bool ts::Service::hasTSId ( uint16_t  value) const
inline

Check if the Transport Stream Id has a given value.

Parameters
[in]valueThe Transport Stream Id to check.
Returns
True if the Transport Stream Id is equal to value.

◆ hasONId() [1/2]

bool ts::Service::hasONId ( ) const
inline

Check if the Original Network Id is present.

Returns
True if the Original Network Id is present.

◆ clearONId()

void ts::Service::clearONId ( )
inline

Clear the Original Network Id .

◆ getONId()

uint16_t ts::Service::getONId ( ) const
inline

Get the Original Network Id .

Returns
The Original Network Id or 0 if unset.

◆ setONId()

void ts::Service::setONId ( uint16_t  value)
inline

Set the Original Network Id .

Parameters
[in]valueThe Original Network Id .

◆ hasONId() [2/2]

bool ts::Service::hasONId ( uint16_t  value) const
inline

Check if the Original Network Id has a given value.

Parameters
[in]valueThe Original Network Id to check.
Returns
True if the Original Network Id is equal to value.

◆ hasLCN() [1/2]

bool ts::Service::hasLCN ( ) const
inline

Check if the Logical Channel Number is present.

Returns
True if the Logical Channel Number is present.

◆ clearLCN()

void ts::Service::clearLCN ( )
inline

Clear the Logical Channel Number .

◆ getLCN()

uint16_t ts::Service::getLCN ( ) const
inline

Get the Logical Channel Number .

Returns
The Logical Channel Number or 0 if unset.

◆ setLCN()

void ts::Service::setLCN ( uint16_t  value)
inline

Set the Logical Channel Number .

Parameters
[in]valueThe Logical Channel Number .

◆ hasLCN() [2/2]

bool ts::Service::hasLCN ( uint16_t  value) const
inline

Check if the Logical Channel Number has a given value.

Parameters
[in]valueThe Logical Channel Number to check.
Returns
True if the Logical Channel Number is equal to value.

◆ hasPMTPID() [1/2]

bool ts::Service::hasPMTPID ( ) const
inline

Check if the PMT PID is present.

Returns
True if the PMT PID is present.

◆ clearPMTPID()

void ts::Service::clearPMTPID ( )
inline

Clear the PMT PID .

◆ getPMTPID()

PID ts::Service::getPMTPID ( ) const
inline

Get the PMT PID .

Returns
The PMT PID or PID_NULL if unset.

◆ setPMTPID()

void ts::Service::setPMTPID ( PID  value)
inline

Set the PMT PID .

Parameters
[in]valueThe PMT PID .

◆ hasPMTPID() [2/2]

bool ts::Service::hasPMTPID ( PID  value) const
inline

Check if the PMT PID has a given value.

Parameters
[in]valueThe PMT PID to check.
Returns
True if the PMT PID is equal to value.

◆ hasType() [1/2]

bool ts::Service::hasType ( ) const
inline

Check if the Service Type (as declared in service_descriptor) is present.

Returns
True if the Service Type (as declared in service_descriptor) is present.

◆ clearType()

void ts::Service::clearType ( )
inline

Clear the Service Type (as declared in service_descriptor) .

◆ getType()

uint8_t ts::Service::getType ( ) const
inline

Get the Service Type (as declared in service_descriptor) .

Returns
The Service Type (as declared in service_descriptor) or 0 if unset.

◆ setType()

void ts::Service::setType ( uint8_t  value)
inline

Set the Service Type (as declared in service_descriptor) .

Parameters
[in]valueThe Service Type (as declared in service_descriptor) .

◆ hasType() [2/2]

bool ts::Service::hasType ( uint8_t  value) const
inline

Check if the Service Type (as declared in service_descriptor) has a given value.

Parameters
[in]valueThe Service Type (as declared in service_descriptor) to check.
Returns
True if the Service Type (as declared in service_descriptor) is equal to value.

◆ hasRunningStatus() [1/2]

bool ts::Service::hasRunningStatus ( ) const
inline

Check if the Running status (as declared in the SDT) is present.

Returns
True if the Running status (as declared in the SDT) is present.

◆ clearRunningStatus()

void ts::Service::clearRunningStatus ( )
inline

Clear the Running status (as declared in the SDT) .

◆ getRunningStatus()

uint8_t ts::Service::getRunningStatus ( ) const
inline

Get the Running status (as declared in the SDT) .

Returns
The Running status (as declared in the SDT) or 0 if unset.

◆ setRunningStatus()

void ts::Service::setRunningStatus ( uint8_t  value)
inline

Set the Running status (as declared in the SDT) .

Parameters
[in]valueThe Running status (as declared in the SDT) .

◆ hasRunningStatus() [2/2]

bool ts::Service::hasRunningStatus ( uint8_t  value) const
inline

Check if the Running status (as declared in the SDT) has a given value.

Parameters
[in]valueThe Running status (as declared in the SDT) to check.
Returns
True if the Running status (as declared in the SDT) is equal to value.

◆ hasEITsPresent() [1/2]

bool ts::Service::hasEITsPresent ( ) const
inline

Check if the EIT schedule present (as declared in the SDT) is present.

Returns
True if the EIT schedule present (as declared in the SDT) is present.

◆ clearEITsPresent()

void ts::Service::clearEITsPresent ( )
inline

Clear the EIT schedule present (as declared in the SDT) .

◆ getEITsPresent()

bool ts::Service::getEITsPresent ( ) const
inline

Get the EIT schedule present (as declared in the SDT) .

Returns
The EIT schedule present (as declared in the SDT) or false if unset.

◆ setEITsPresent()

void ts::Service::setEITsPresent ( bool  value)
inline

Set the EIT schedule present (as declared in the SDT) .

Parameters
[in]valueThe EIT schedule present (as declared in the SDT) .

◆ hasEITsPresent() [2/2]

bool ts::Service::hasEITsPresent ( bool  value) const
inline

Check if the EIT schedule present (as declared in the SDT) has a given value.

Parameters
[in]valueThe EIT schedule present (as declared in the SDT) to check.
Returns
True if the EIT schedule present (as declared in the SDT) is equal to value.

◆ hasEITpfPresent() [1/2]

bool ts::Service::hasEITpfPresent ( ) const
inline

Check if the EIT present/following present (as declared in the SDT) is present.

Returns
True if the EIT present/following present (as declared in the SDT) is present.

◆ clearEITpfPresent()

void ts::Service::clearEITpfPresent ( )
inline

Clear the EIT present/following present (as declared in the SDT) .

◆ getEITpfPresent()

bool ts::Service::getEITpfPresent ( ) const
inline

Get the EIT present/following present (as declared in the SDT) .

Returns
The EIT present/following present (as declared in the SDT) or false if unset.

◆ setEITpfPresent()

void ts::Service::setEITpfPresent ( bool  value)
inline

Set the EIT present/following present (as declared in the SDT) .

Parameters
[in]valueThe EIT present/following present (as declared in the SDT) .

◆ hasEITpfPresent() [2/2]

bool ts::Service::hasEITpfPresent ( bool  value) const
inline

Check if the EIT present/following present (as declared in the SDT) has a given value.

Parameters
[in]valueThe EIT present/following present (as declared in the SDT) to check.
Returns
True if the EIT present/following present (as declared in the SDT) is equal to value.

◆ hasCAControlled() [1/2]

bool ts::Service::hasCAControlled ( ) const
inline

Check if the CA-controlled (as declared in the SDT) is present.

Returns
True if the CA-controlled (as declared in the SDT) is present.

◆ clearCAControlled()

void ts::Service::clearCAControlled ( )
inline

Clear the CA-controlled (as declared in the SDT) .

◆ getCAControlled()

bool ts::Service::getCAControlled ( ) const
inline

Get the CA-controlled (as declared in the SDT) .

Returns
The CA-controlled (as declared in the SDT) or false if unset.

◆ setCAControlled()

void ts::Service::setCAControlled ( bool  value)
inline

Set the CA-controlled (as declared in the SDT) .

Parameters
[in]valueThe CA-controlled (as declared in the SDT) .

◆ hasCAControlled() [2/2]

bool ts::Service::hasCAControlled ( bool  value) const
inline

Check if the CA-controlled (as declared in the SDT) has a given value.

Parameters
[in]valueThe CA-controlled (as declared in the SDT) to check.
Returns
True if the CA-controlled (as declared in the SDT) is equal to value.

◆ hasName() [1/2]

bool ts::Service::hasName ( ) const
inline

Check if the Service Name is present.

Returns
True if the Service Name is present.

◆ clearName()

void ts::Service::clearName ( )
inline

Clear the Service Name .

◆ getName()

UString ts::Service::getName ( ) const
inline

Get the Service Name .

Returns
The Service Name or UString() if unset.

◆ setName()

void ts::Service::setName ( const UString value)
inline

Set the Service Name .

Parameters
[in]valueThe Service Name .

◆ hasName() [2/2]

bool ts::Service::hasName ( const UString value) const
inline

Check if the Service Name has a given value.

Parameters
[in]valueThe Service Name to check.
Returns
True if the Service Name is similar to value, case insensitive and ignoring blanks.

◆ hasProvider() [1/2]

bool ts::Service::hasProvider ( ) const
inline

Check if the Provider Name is present.

Returns
True if the Provider Name is present.

◆ clearProvider()

void ts::Service::clearProvider ( )
inline

Clear the Provider Name .

◆ getProvider()

UString ts::Service::getProvider ( ) const
inline

Get the Provider Name .

Returns
The Provider Name or UString() if unset.

◆ setProvider()

void ts::Service::setProvider ( const UString value)
inline

Set the Provider Name .

Parameters
[in]valueThe Provider Name .

◆ hasProvider() [2/2]

bool ts::Service::hasProvider ( const UString value) const
inline

Check if the Provider Name has a given value.

Parameters
[in]valueThe Provider Name to check.
Returns
True if the Provider Name is similar to value, case insensitive and ignoring blanks.

◆ getFields()

uint32_t ts::Service::getFields ( ) const

Get the list of fields which are set in a Service.

Returns
The list of fields which are set in a Service as an or'ed mask of ServiceField values.

◆ Sort1()

static bool ts::Service::Sort1 ( const Service s1,
const Service s2 
)
static

Sorting criterion method, used by std::sort().

Sort order: LCN, ONId, TSId, Id, name, provider, type, PMT PID.

If both objects have a given field set, sort according to this field. If only one object has this field set, it comes first. If none of the two objects have this field set, use to next criterion.

Parameters
[in]s1First service.
[in]s2First service.
Returns
True is s1 is logically less than s2, false otherwise.

◆ Sort2()

static bool ts::Service::Sort2 ( const Service s1,
const Service s2 
)
static

Sorting criterion method, used by std::sort().

Sort order: name, provider, LCN, ONId, TSId, Id, type, PMT PID.

If both objects have a given field set, sort according to this field. If only one object has this field set, it comes first. If none of the two objects have this field set, use to next criterion.

Parameters
[in]s1First service.
[in]s2First service.
Returns
True is s1 is logically less than s2, false otherwise.

◆ Sort3()

static bool ts::Service::Sort3 ( const Service s1,
const Service s2 
)
static

Sorting criterion method, used by std::sort().

Sort order: ONId, TSId, Id, type, name, provider, LCN, PMT PID.

If both objects have a given field set, sort according to this field. If only one object has this field set, it comes first. If none of the two objects have this field set, use to next criterion.

Parameters
[in]s1First service.
[in]s2First service.
Returns
True is s1 is logically less than s2, false otherwise.

◆ Display() [1/2]

template<class ITERATOR >
static std::ostream& ts::Service::Display ( std::ostream &  strm,
const UString margin,
const ITERATOR &  begin,
const ITERATOR &  end,
bool  header = true 
)
static

Display a container of services, one line per service.

Template Parameters
ITERATORAn iterator class in the container.
Parameters
[in,out]strmOutput text stream.
[in]marginThe string to print as left margin.
[in]beginIterator to the first object to display.
[in]endIterator after the last object to display.
[in]headerIf true, display a header line first.
Returns
A reference to strm.

◆ Display() [2/2]

template<class CONTAINER >
static std::ostream& ts::Service::Display ( std::ostream &  strm,
const UString margin,
const CONTAINER &  container,
bool  header = true 
)
inlinestatic

Display a container of services, one line per service.

Template Parameters
CONTAINERA container class.
Parameters
[in,out]strmOutput text stream.
[in]marginThe string to print as left margin.
[in]containerContainer of services to display.
[in]headerIf true, display a header line first.
Returns
A reference to strm.

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