![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsFeatures.h>
Classes | |
| class | Register |
Public Types | |
| using | GetVersionFunc = UString (*)() |
| using | index_t = Names::int_t |
| enum | Support { ALWAYS , SUPPORTED , UNSUPPORTED } |
Public Member Functions | |
| std::list< std::pair< UString, UString > > | getAllVersions () |
| UString | getVersion (const UString &option) |
| UString | getVersion (index_t index) |
| bool | isSupported (const UString &option) |
| bool | isSupported (index_t index) |
| index_t | registerFeature (const UString &option, const fs::path &library) |
| index_t | registerFeature (const UString &option, const UString &name, Support support, GetVersionFunc get_version) |
| const Names & | supportEnum () const |
| const Names & | versionEnum () const |
Static Public Member Functions | |
| static Features & | Instance () |
| Get the instance of the singleton of this class. | |
Repository of dynamically registered features.
| using ts::Features::index_t = Names::int_t |
Each feature is assigned a unique positive number.
| using ts::Features::GetVersionFunc = UString (*)() |
Profile of a function return a version string for a feature.
|
static |
Get the instance of the singleton of this class.
| index_t ts::Features::registerFeature | ( | const UString & | option, |
| const UString & | name, | ||
| Support | support, | ||
| GetVersionFunc | get_version ) |
Register a feature.
| [in] | option | Feature name as used in command line options. |
| [in] | name | Feature name as used on display. |
| [in] | support | Level of support. |
| [in] | get_version | Function returning the version of the feature. Can be null (no identified version). |
Register a feature which is in another shared image. If a feature with the same option name is already registered, do nothing. Otherwise, the library name is stored for later usage. The first time the feature is searched, the shared library is loaded. If the load succeeds and the initialization of the shared image registered a feature with the same name, the feature becomes defined. Otherwise, the feature is definitely marked as unsupported.
| [in] | option | Feature name as used in command line options. |
| [in] | library | Name of a shared image (typically without directory). |
|
inline |
Enumeration of optional features. Typically used to implement the --support command line option.
|
inline |
Enumeration of versioned features. Typically used to implement the --version command line option.
| bool ts::Features::isSupported | ( | index_t | index | ) |
Check if a feature is supported.
| [in] | index | Index of the feature as returned in supportEnum(). |
| bool ts::Features::isSupported | ( | const UString & | option | ) |
Check if a feature is supported.
| [in] | option | Command line option of the feature. |
Get the version of a feature, if supported.
| [in] | index | Index of the feature as returned in versionEnum(). |
Get the version of a feature, if supported.
| [in] | option | Command line option of the feature. |
Get the version of all features.