TSDuck Version 3.32-2769 (TSDuck - The MPEG Transport Stream Toolkit)
ts::CASDate< YEARBASE > Class Template Reference

Template representation of a CAS date. More...

Inheritance diagram for ts::CASDate< YEARBASE >:
Collaboration diagram for ts::CASDate< YEARBASE >:

Public Member Functions

 CASDate ()
 Default constructor. More...
 
 CASDate (const Time &t)
 Constructor from a Time object. More...
 
 CASDate (int year, int month, int day)
 Constructor from fields. More...
 
 CASDate (uint16_t value)
 Constructor from a 16-bit binary value. More...
 
int day () const
 Get the day number. More...
 
void invalidate ()
 Make the date invalid.
 
bool isValid () const
 Check if a date is valid. More...
 
int month () const
 Get the month number. More...
 
 operator ts::Time () const
 Convert to a Time object. More...
 
bool operator!= (const CASDate &t) const
 Comparison operator. More...
 
bool operator< (const CASDate &t) const
 Comparison operator. More...
 
bool operator<= (const CASDate &t) const
 Comparison operator. More...
 
bool operator== (const CASDate &t) const
 Comparison operator. More...
 
bool operator> (const CASDate &t) const
 Comparison operator. More...
 
bool operator>= (const CASDate &t) const
 Comparison operator. More...
 
virtual UString toString () const override
 Convert to a string object. More...
 
uint16_t value () const
 Convert to a 16-bit value, for binary insertion. More...
 
int year () const
 Get the year number. More...
 

Static Public Member Functions

static CASDate Max ()
 A static function to return the maximum date. More...
 
static CASDate Min ()
 A static function to return the minimum date. More...
 

Static Public Attributes

static constexpr uint16_t INVALID_DATE = 0xFFFF
 An invalid 16-bit date value.
 
static constexpr int MAX_YEAR = YEARBASE + 127
 The last representable year.
 
static constexpr int MIN_YEAR = YEARBASE
 The first representable year.
 

Detailed Description

template<int YEARBASE>
class ts::CASDate< YEARBASE >

Template representation of a CAS date.

This general format is used by several CAS vendors.

Template Parameters
YEARBASEThe base year for the dates (CAS dependent).

Constructor & Destructor Documentation

◆ CASDate() [1/4]

template<int YEARBASE>
ts::CASDate< YEARBASE >::CASDate ( )
inline

Default constructor.

The date is initially invalid.

◆ CASDate() [2/4]

template<int YEARBASE>
ts::CASDate< YEARBASE >::CASDate ( uint16_t  value)
inline

Constructor from a 16-bit binary value.

Parameters
[in]value16-bit binary representation of the date.

◆ CASDate() [3/4]

template<int YEARBASE>
ts::CASDate< YEARBASE >::CASDate ( int  year,
int  month,
int  day 
)
inline

Constructor from fields.

Parameters
[in]yearYear number.
[in]monthMonth number.
[in]dayDay number.

◆ CASDate() [4/4]

template<int YEARBASE>
ts::CASDate< YEARBASE >::CASDate ( const Time t)

Constructor from a Time object.

Parameters
[in]tA Time object.

Member Function Documentation

◆ Min()

template<int YEARBASE>
static CASDate ts::CASDate< YEARBASE >::Min ( )
inlinestatic

A static function to return the minimum date.

Returns
The minimum date (January 1st, base year).

◆ Max()

template<int YEARBASE>
static CASDate ts::CASDate< YEARBASE >::Max ( )
inlinestatic

A static function to return the maximum date.

Returns
The maximum date (December 31st, last year).

◆ isValid()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::isValid ( ) const
inline

Check if a date is valid.

Returns
True if the date is valid.

◆ year()

template<int YEARBASE>
int ts::CASDate< YEARBASE >::year ( ) const
inline

Get the year number.

Returns
The year number.

◆ month()

template<int YEARBASE>
int ts::CASDate< YEARBASE >::month ( ) const
inline

Get the month number.

Returns
The month number.

◆ day()

template<int YEARBASE>
int ts::CASDate< YEARBASE >::day ( ) const
inline

Get the day number.

Returns
The day number.

◆ value()

template<int YEARBASE>
uint16_t ts::CASDate< YEARBASE >::value ( ) const
inline

Convert to a 16-bit value, for binary insertion.

Returns
The 16-bit value, for binary insertion.

◆ operator ts::Time()

template<int YEARBASE>
ts::CASDate< YEARBASE >::operator ts::Time ( ) const

Convert to a Time object.

Returns
The Time object or Time::Epoch if invalid.

◆ toString()

template<int YEARBASE>
virtual UString ts::CASDate< YEARBASE >::toString ( ) const
overridevirtual

Convert to a string object.

Returns
This object, converted as a string.

Implements ts::StringifyInterface.

◆ operator==()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::operator== ( const CASDate< YEARBASE > &  t) const
inline

Comparison operator.

Parameters
[in]tA data to assign.
Returns
True if this object == t.

◆ operator!=()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::operator!= ( const CASDate< YEARBASE > &  t) const
inline

Comparison operator.

Parameters
[in]tA data to assign.
Returns
True if this object != t.

◆ operator<()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::operator< ( const CASDate< YEARBASE > &  t) const
inline

Comparison operator.

Parameters
[in]tA data to assign.
Returns
True if this object < t.

◆ operator<=()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::operator<= ( const CASDate< YEARBASE > &  t) const
inline

Comparison operator.

Parameters
[in]tA data to assign.
Returns
True if this object <= t.

◆ operator>()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::operator> ( const CASDate< YEARBASE > &  t) const
inline

Comparison operator.

Parameters
[in]tA data to assign.
Returns
True if this object > t.

◆ operator>=()

template<int YEARBASE>
bool ts::CASDate< YEARBASE >::operator>= ( const CASDate< YEARBASE > &  t) const
inline

Comparison operator.

Parameters
[in]tA data to assign.
Returns
True if this object >= t.

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