libmpd++
DASH MPD parsing and manipulation library
 
Loading...
Searching...
No Matches
com::bbc::libmpdpp::FrameRate Class Reference

#include <libmpd++/FrameRate.hh>

Public Types

using size_type = size_t
 Type used to hold numerators and denominators.
 

Public Member Functions

 FrameRate ()
 
 FrameRate (const std::string &frame_rate_str)
 
 FrameRate (size_type numerator, size_type denominator=1)
 
 FrameRate (const FrameRate &other)
 
 FrameRate (FrameRate &&other)
 
virtual ~FrameRate ()
 
FrameRateoperator= (const FrameRate &other)
 
FrameRateoperator= (FrameRate &&other)
 
bool operator== (const FrameRate &other) const
 
bool operator!= (const FrameRate &other) const
 
 operator std::string () const
 
size_type numerator () const
 
FrameRatenumerator (size_type num)
 
size_type denominator () const
 
FrameRatedenominator (size_type den)
 

Detailed Description

FrameRate class

This is a container for DASH MPD XML @frameRate attributes and follows the definition of FrameRateType from ISO 23009-1:2022 Clause 5.3.3.3.

Although the original definition in ISO 23009-1:2022 is simply a restricted string type, this class breaks the string down into a useful numerator and denominator pair.

Member Typedef Documentation

◆ size_type

Type used to hold numerators and denominators.

Constructor & Destructor Documentation

◆ FrameRate() [1/5]

com::bbc::libmpdpp::FrameRate::FrameRate ( )
inline

Default constructor

This will create a new FrameRate value of "0/1".

◆ FrameRate() [2/5]

com::bbc::libmpdpp::FrameRate::FrameRate ( const std::string & frame_rate_str)

Construct from string value

This will parse a DASH MPD XML FrameRateType value and store it in a new FrameRate object. The string should be in the form "<numerator>[/<denominator>]". If the optional denominator part is omitted then the denominator will default to 1.

Parameters
frame_rate_strThe string to parse.
Exceptions
ParseErrorThrown if the string cannot be parsed correctly.

◆ FrameRate() [3/5]

com::bbc::libmpdpp::FrameRate::FrameRate ( size_type numerator,
size_type denominator = 1 )
inline

Construct by value

Construct a new FrameRate from the numerator and denominator provided.

Parameters
numeratorThe numerator for the frame rate.
denominatorThe denominator for the frame rate.

◆ FrameRate() [4/5]

com::bbc::libmpdpp::FrameRate::FrameRate ( const FrameRate & other)
inline

Copy constructor

Make a new copy of other.

Parameters
otherThe other FrameRate to copy.

◆ FrameRate() [5/5]

com::bbc::libmpdpp::FrameRate::FrameRate ( FrameRate && other)
inline

Move constructor

Make a new copy of other.

Parameters
otherThe other FrameRate to copy.

◆ ~FrameRate()

virtual com::bbc::libmpdpp::FrameRate::~FrameRate ( )
inlinevirtual

Destructor

Member Function Documentation

◆ denominator() [1/2]

size_type com::bbc::libmpdpp::FrameRate::denominator ( ) const
inline

Get the denominator

Returns
The denominator for this FrameRate.

◆ denominator() [2/2]

FrameRate & com::bbc::libmpdpp::FrameRate::denominator ( size_type den)
inline

Set the denominator

Parameters
denThe new denominator to set.
Returns
This FrameRate.

◆ numerator() [1/2]

size_type com::bbc::libmpdpp::FrameRate::numerator ( ) const
inline

Get the numerator

Returns
The numerator for this FrameRate.

◆ numerator() [2/2]

FrameRate & com::bbc::libmpdpp::FrameRate::numerator ( size_type num)
inline

Set the numerator

Parameters
numThe new numerator to set.
Returns
This FrameRate.

◆ operator std::string()

com::bbc::libmpdpp::FrameRate::operator std::string ( ) const

string cast operator

This converts the FrameRate into a string suitable for use as a @frameRate attribute value.

Returns
The attribute value string for this FrameRate.

◆ operator!=()

bool com::bbc::libmpdpp::FrameRate::operator!= ( const FrameRate & other) const
inline

Inequality operator

Check if this FrameRate does not have the same value as other.

Parameters
otherThe other FrameRate to compare to this one.
Returns
true if the other FrameRate does not have the same value as this one.

◆ operator=() [1/2]

FrameRate & com::bbc::libmpdpp::FrameRate::operator= ( const FrameRate & other)
inline

Copy operator

Copy another FrameRate from other into this FrameRate.

Parameters
otherThe other FrameRate to copy.
Returns
This FrameRate.

◆ operator=() [2/2]

FrameRate & com::bbc::libmpdpp::FrameRate::operator= ( FrameRate && other)
inline

Move operator

Copies another FrameRate from other into this FrameRate.

Parameters
otherThe other FrameRate to copy.
Returns
This FrameRate.

◆ operator==()

bool com::bbc::libmpdpp::FrameRate::operator== ( const FrameRate & other) const
inline

Equality operator

Check if this FrameRate has the same value as other.

Parameters
otherThe other FrameRate to compare to this one.
Returns
true if the other FrameRate has the same value as this one.

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