Tide 0.1.0
|
Float primitive element. More...
#include <tide/float_element.h>
Public Member Functions | |
FloatElement (uint32_t id, double value, EBMLFloatPrec precision=EBML_FLOAT_PREC_DOUBLE) | |
Create a new float element with no default. | |
FloatElement (uint32_t id, double value, double default_value, EBMLFloatPrec precision=EBML_FLOAT_PREC_DOUBLE) | |
Create a new float element with a default value. | |
virtual FloatElement & | operator= (double const &rhs) |
Value assignment operator. | |
virtual EBMLFloatPrec | precision () const |
Get the precision setting. | |
virtual void | precision (EBMLFloatPrec precision) |
Set the precision setting. | |
virtual std::streamsize | write_body (std::ostream &output) |
Element body writing. | |
Protected Member Functions | |
virtual std::streamsize | body_size () const |
Get the size of the body of this element. | |
virtual std::streamsize | read_body (std::istream &input, std::streamsize size) |
Element body loading. | |
Protected Attributes | |
EBMLFloatPrec | prec_ |
Float primitive element.
This element stores an IEEE floating-point number. 4-byte and 8-byte floats are allowed.
Definition at line 53 of file float_element.h.
tide::FloatElement::FloatElement | ( | uint32_t | id, |
double | value, | ||
EBMLFloatPrec | precision = EBML_FLOAT_PREC_DOUBLE |
||
) |
Create a new float element with no default.
[in] | id | The element's ID, as an unsigned integer up to 28 bits. |
[in] | value | The element's value. |
[in] | precision | The element's precision, single or double. This only has an effect when writing the float to file. |
tide::FloatElement::FloatElement | ( | uint32_t | id, |
double | value, | ||
double | default_value, | ||
EBMLFloatPrec | precision = EBML_FLOAT_PREC_DOUBLE |
||
) |
Create a new float element with a default value.
[in] | id | The element's ID, as an unsigned integer up to 28 bits. |
[in] | value | The element's value. |
[in] | precision | The element's precision, single or double. This only has an effect when writing the float to a file. |
[in] | default_value | The default value of the element. |
virtual std::streamsize tide::FloatElement::body_size | ( | ) | const [protected, virtual] |
Get the size of the body of this element.
Implements tide::Element.
virtual FloatElement& tide::FloatElement::operator= | ( | double const & | rhs | ) | [virtual] |
Value assignment operator.
Reimplemented from tide::PrimitiveElement< double >.
virtual EBMLFloatPrec tide::FloatElement::precision | ( | ) | const [inline, virtual] |
Get the precision setting.
Definition at line 83 of file float_element.h.
virtual void tide::FloatElement::precision | ( | EBMLFloatPrec | precision | ) | [inline, virtual] |
Set the precision setting.
This value determines if the float is single or double precision. The precision value has no effect until the float is written to a file, at which point single-precision floats are written using 4 bytes while double-precision floats are written using 8 bytes.
Definition at line 92 of file float_element.h.
virtual std::streamsize tide::FloatElement::read_body | ( | std::istream & | input, |
std::streamsize | size | ||
) | [protected, virtual] |
Element body loading.
BadElementLength | if the float element is an incorrect length (i.e. not 4 or 8 bytes). |
Implements tide::Element.
virtual std::streamsize tide::FloatElement::write_body | ( | std::ostream & | output | ) | [virtual] |
Element body writing.
Implements tide::Element.
EBMLFloatPrec tide::FloatElement::prec_ [protected] |
Definition at line 99 of file float_element.h.