Tawara
0.1.0
|
The MasterElement interface. More...
#include <tawara/master_element.h>
Public Member Functions | |
MasterElement (uint32_t id, bool crc=false) | |
Create a new MasterElement. More... | |
virtual | ~MasterElement () |
Destructor. More... | |
![]() | |
Element (tawara::ids::ID id) | |
Create a new Element. More... | |
virtual | ~Element () |
Destructor. More... | |
uint32_t | id () const |
Get the element's ID. More... | |
std::streampos | offset () const |
Get the element's offset in the byte stream. More... | |
virtual std::streamsize | size () const |
Get the total size of the element. More... | |
virtual std::streamsize | write (std::ostream &output) |
Element writing. More... | |
virtual std::streamsize | read (std::istream &input) |
Element reading. More... | |
Additional Inherited Members | |
![]() | |
virtual std::streamsize | body_size () const =0 |
Get the size of the body of this element. More... | |
std::streamsize | write_id (std::ostream &output) |
Element ID writing. More... | |
virtual std::streamsize | write_size (std::ostream &output) |
Element size writing. More... | |
virtual std::streamsize | write_body (std::ostream &output)=0 |
Element body writing. More... | |
virtual std::streamsize | read_body (std::istream &input, std::streamsize size)=0 |
Element body reading implementation. More... | |
![]() | |
tawara::ids::ID | id_ |
std::streampos | offset_ |
The MasterElement interface.
EBML elements can be divided into primitive elements and master elements. While primitive elements directly store a single piece of data in a format corresponding to their type, master elements are used to group other elements together. Instead of a single data value, they store zero or more child elements, which can themselves be master or primitive elements.
Generally, each master element will have quite specific functionality. In such cases, a new class should be created that inherits from and implements this interface.
Definition at line 63 of file master_element.h.
tawara::MasterElement::MasterElement | ( | uint32_t | id, |
bool | crc = false |
||
) |
Create a new MasterElement.
[in] | id | The element's ID, as an unsigned integer up to 28 bits. |
[in] | crc | Use a CRC32 element to provide a check for file corruption. |
|
inlinevirtual |
Destructor.
Definition at line 76 of file master_element.h.