TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Define an element of an argument list with integer output types of mixed sizes. More...
#include <tsArgMix.h>
Public Member Functions | |
ArgMixOut ()=default | |
Default constructor. | |
ArgMixOut (ArgMixOut &&other) noexcept | |
Move constructor. | |
ArgMixOut (const ArgMixOut &other) | |
Copy constructor. | |
ArgMixOut (double *ptr) | |
Constructor from the address of floating point data. | |
template<typename T , typename std::enable_if< std::is_integral< T >::value||std::is_enum< T >::value >::type * = nullptr> | |
ArgMixOut (T *ptr) | |
Constructor from the address of an integer or enum data. | |
std::intmax_t | den () const |
In the case of a std::chrono::duration value, return the denominator of the ratio. | |
bool | isAbstractNumber () const |
Check if the argument value is an AbstractNumber value, either input or output. | |
bool | isAnyString () const |
Check if the argument value is a string of any type. | |
bool | isAnyString16 () const |
Check if the argument value is a string of 16-bit characters. | |
bool | isAnyString8 () const |
Check if the argument value is a string of 8-bit characters. | |
bool | isBool () const |
Check if the argument value is a bool. | |
bool | isCharPtr () const |
Check if the argument value is a char* string. | |
bool | isChrono () const |
Check if the argument value is a std::chrono::duration value. | |
bool | isDouble () const |
Check if the argument value is a double floating point value, either input or output. | |
bool | isInteger () const |
Check if the argument value is an integer, either input or output. | |
bool | isOutputFloat () const |
Check if the argument value is an output floating point. | |
bool | isOutputInteger () const |
Check if the argument value is an output integer. | |
bool | isSigned () const |
Check if the argument value is a signed integer, either input or output. | |
bool | isString () const |
Check if the argument value is a std::string. | |
bool | isUCharPtr () const |
Check if the argument value is a UChar* string. | |
bool | isUnsigned () const |
Check if the argument value is an unsigned integer, either input or output. | |
bool | isUString () const |
Check if the argument value is a ts::UString. | |
std::intmax_t | num () const |
In the case of a std::chrono::duration value, return the numerator of the ratio. | |
size_t | size () const |
Get the original integer size in bytes of the argument data. | |
template<typename FLOAT , typename std::enable_if< std::is_floating_point< FLOAT >::value >::type * = nullptr> | |
bool | storeFloat (FLOAT f) const |
Store a floating point value in the argument data, for pointers to double. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
bool | storeInteger (INT i) const |
Store an integer value in the argument data, for pointers to integer. | |
const AbstractNumber & | toAbstractNumber () const |
Get the argument data value as constant reference to an AbstractNumber instance. | |
bool | toBool () const |
Get the argument data value as a bool. | |
const char * | toCharPtr () const |
Get the argument data value as a nul-terminated string of 8-bit characters. | |
double | toDouble () const |
Get the argument data value as a double floating point value. | |
int32_t | toInt32 () const |
Get the argument data value as a 32-bit signed integer. | |
int64_t | toInt64 () const |
Get the argument data value as a 64-bit signed integer. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
INT | toInteger (bool raw=false) const |
Get the argument data value as an integer. | |
const std::string & | toString () const |
Get the argument data value as constant reference to a C++ string of 8-bit characters. | |
const UChar * | toUCharPtr () const |
Get the argument data value as a nul-terminated string of 16-bit characters. | |
uint32_t | toUInt32 () const |
Get the argument data value as a 32-bit unsigned integer. | |
uint64_t | toUInt64 () const |
Get the argument data value as a 64-bit unsigned integer. | |
const UString & | toUString () const |
Get the argument data value as constant reference to a C++ string of 16-bit characters. | |
Protected Types | |
enum | : TypeFlags { INTEGER = 0x0001 , SIGNED = 0x0002 , STRING = 0x0004 , CLASS = 0x0008 , BIT1 = 0x0010 , BIT8 = 0x0020 , BIT16 = 0x0040 , BIT32 = 0x0080 , BIT64 = 0x0100 , POINTER = 0x0200 , STRINGIFY = 0x0400 , PATH = 0x0800 , DOUBLE = 0x1000 , ANUMBER = 0x2000 , CHRONO = 0x4000 } |
Anonymous enum, used as bitmask. More... | |
using | TypeFlags = uint16_t |
Type of an argument, used as bitmask. | |
Static Protected Attributes | |
static constexpr TypeFlags | BITPATH |
Size flag for std::filesystem::path, either BIT8 or BIT16. | |
Define an element of an argument list with integer output types of mixed sizes.
This class is typically used as element in an std::initializer_list. This mechanism is used by ts::UString::Scan() for instance.
An instance of ArgMixOut references external data. The lifetime of the pointed data must be longer than the ArgMixOut instance. This is the case for a std::initializer_list<ArgMixOut> which is used as parameter to Scan(). But this is not guaranteed in other usages.
|
protectedinherited |
Anonymous enum, used as bitmask.
Enumerator | |
---|---|
INTEGER | Integer type. |
SIGNED | With INTEGER, 1 means signed, 0 means unsigned. |
STRING | String of characters. |
CLASS | With STRING, 1 means std::string or ts::UString, O means const char* or const UChar*. |
BIT1 | 1-bit integer, ie. bool. |
BIT8 | 8-bit integer or string of 8-bit characters (char). |
BIT16 | 16-bit integer or string of 16-bit characters (UChar). |
BIT32 | 32-bit integer. |
BIT64 | 64-bit integer. |
POINTER | A pointer to a writeable data (data type is given by other bits). |
STRINGIFY | A pointer to a StringifyInterface object. |
PATH | A pointer to a StringifyInterface object. |
DOUBLE | Double floating point type. |
ANUMBER | A pointer to an AbstractNumber object. |
CHRONO | A instance of std::chrono::duration. |
|
inline |
Copy constructor.
[in] | other | Other instance to copy. |
|
inlinenoexcept |
Move constructor.
[in,out] | other | Other instance to move. |
|
inline |
Constructor from the address of an integer or enum data.
[in] | ptr | Address of an integer or enum data. |
|
inline |
Constructor from the address of floating point data.
[in] | ptr | Address of a double floating point. |
|
inlineinherited |
Check if the argument value is an integer, either input or output.
|
inlineinherited |
Check if the argument value is an output integer.
|
inlineinherited |
Check if the argument value is an output floating point.
|
inlineinherited |
Check if the argument value is a signed integer, either input or output.
|
inlineinherited |
Check if the argument value is an unsigned integer, either input or output.
|
inlineinherited |
Check if the argument value is a bool.
|
inlineinherited |
Check if the argument value is a string of any type.
|
inlineinherited |
Check if the argument value is a string of 8-bit characters.
|
inlineinherited |
Check if the argument value is a string of 16-bit characters.
|
inlineinherited |
Check if the argument value is a char* string.
|
inlineinherited |
Check if the argument value is a std::string.
|
inlineinherited |
Check if the argument value is a UChar* string.
|
inlineinherited |
Check if the argument value is a ts::UString.
|
inlineinherited |
Check if the argument value is a double floating point value, either input or output.
|
inlineinherited |
Check if the argument value is an AbstractNumber value, either input or output.
|
inlineinherited |
Check if the argument value is a std::chrono::duration value.
|
inlineinherited |
Get the original integer size in bytes of the argument data.
|
inherited |
Get the argument data value as an integer.
INT | An integer type. |
[in] | raw | In the case of fixed-point value, return the integral part when false (the default) and the raw value if true. Ignored for plain integer types. |
|
inlineinherited |
Get the argument data value as a 32-bit signed integer.
|
inlineinherited |
Get the argument data value as a 32-bit unsigned integer.
|
inlineinherited |
Get the argument data value as a 64-bit signed integer.
|
inlineinherited |
Get the argument data value as a 64-bit unsigned integer.
|
inlineinherited |
Get the argument data value as a bool.
|
inherited |
Get the argument data value as a nul-terminated string of 8-bit characters.
|
inherited |
Get the argument data value as a nul-terminated string of 16-bit characters.
|
inherited |
Get the argument data value as constant reference to a C++ string of 8-bit characters.
|
inherited |
Get the argument data value as constant reference to a C++ string of 16-bit characters.
|
inherited |
Get the argument data value as a double floating point value.
|
inherited |
Get the argument data value as constant reference to an AbstractNumber instance.
|
inlineinherited |
In the case of a std::chrono::duration value, return the numerator of the ratio.
The chrono count is obtained using tsInt64().
|
inlineinherited |
In the case of a std::chrono::duration value, return the denominator of the ratio.
The chrono count is obtained using tsInt64().
|
inherited |
Store an integer value in the argument data, for pointers to integer.
INT | An integer type. |
[in] | i | The integer value to store in the argument data. |
|
inherited |
Store a floating point value in the argument data, for pointers to double.
[in] | f | The floating point value to store in the argument data. |
|
staticconstexprprotectedinherited |
Size flag for std::filesystem::path, either BIT8 or BIT16.