libebml_ng
Public Member Functions | List of all members
ebml::childTypeSpec_t Class Reference

Specifies accepted child element types within a parent element. More...

#include <childTypeSpec.h>

Public Member Functions

 childTypeSpec_t ()
 
 childTypeSpec_t (childClassSpecArg_init_l)
 
 childTypeSpec_t (const childTypeSpecArg_l &)
 
 childTypeSpec_t (const childTypeSpec_t &)=default
 
 childTypeSpec_t (childTypeSpec_t &&)=default
 
childTypeSpec_toperator= (childClassSpecArg_init_l)
 
childTypeSpec_toperator= (const childTypeSpecArg_l &)
 
childTypeSpec_toperator= (const childTypeSpec_t &)=default
 
childTypeSpec_toperator= (childTypeSpec_t &&)=default
 
void add (const childTypeSpecArg_t &)
 Adds a child type. More...
 
void add (const ebmlElementType *, unsigned long min=0, long max=-1)
 Adds a child type with occurrence limits. More...
 
void remove (ebmlID_t)
 Removes child type for a given EBML ID. More...
 
const ebmlElementTypeoperator[] (ebmlID_t) const
 Retrieves the child type for a given EBML ID. More...
 
size_t count (ebmlID_t) const
 Determines if a child type for a given EBML ID exists. More...
 
size_t count (const ebmlElementType *) const
 Determines if an ebml::ebmlElementType instance is a child type. More...
 
size_t size () const
 Returns the total number of child type specifications. More...
 
const occurSpec_doccurSpec () const
 Retrieves the complete occurrence specifications. More...
 
const occurSpec_toccurSpec (ebmlID_t) const
 Retrieves the occurrence specification for a given EBML ID. More...
 
const occurSpec_toccurSpec (const ebmlElementType *) const
 Retrieves the occurrence specification for a given child type. More...
 
bool isValid (const ebmlElement_sp &) const
 Checks whether a given element is valid under this specification. More...
 
ebmlElementClass_d::const_iterator begin () const
 Returns an iterator pointing to the beginning of the specifications. More...
 
ebmlElementClass_d::const_iterator end () const
 Returns an iterator pointing past the end of the specifications. More...
 

Detailed Description

Specifies accepted child element types within a parent element.

This class is used to look up allowed ebmlElementType instances by EBML ID and to validate occurrences. Instances of this class are stored within an ebml::ebmlMasterElementType instance.

Constructor & Destructor Documentation

◆ childTypeSpec_t() [1/5]

ebml::childTypeSpec_t::childTypeSpec_t ( )

◆ childTypeSpec_t() [2/5]

ebml::childTypeSpec_t::childTypeSpec_t ( childClassSpecArg_init_l  items)

◆ childTypeSpec_t() [3/5]

ebml::childTypeSpec_t::childTypeSpec_t ( const childTypeSpecArg_l items)

◆ childTypeSpec_t() [4/5]

ebml::childTypeSpec_t::childTypeSpec_t ( const childTypeSpec_t )
default

◆ childTypeSpec_t() [5/5]

ebml::childTypeSpec_t::childTypeSpec_t ( childTypeSpec_t &&  )
default

Member Function Documentation

◆ add() [1/2]

void ebml::childTypeSpec_t::add ( const childTypeSpecArg_t spec)

Adds a child type.

Parameters
specThe specification to add.

◆ add() [2/2]

void ebml::childTypeSpec_t::add ( const ebmlElementType ,
unsigned long  min = 0,
long  max = -1 
)

Adds a child type with occurrence limits.

Parameters
childPointer to the ebml::ebmlElementType.
minMinimum required occurrences.
maxMaximum allowed occurrences.

◆ begin()

ebmlElementClass_d::const_iterator ebml::childTypeSpec_t::begin ( ) const

Returns an iterator pointing to the beginning of the specifications.

Returns
Constant iterator.

◆ count() [1/2]

size_t ebml::childTypeSpec_t::count ( ebmlID_t  ebmlID) const

Determines if a child type for a given EBML ID exists.

Parameters
ebmlIDThe EBML ID.
Returns
Count of matching specifications.

◆ count() [2/2]

size_t ebml::childTypeSpec_t::count ( const ebmlElementType ) const

Determines if an ebml::ebmlElementType instance is a child type.

Parameters
clsPointer to the element type.
Returns
Occurrence count.

◆ end()

ebmlElementClass_d::const_iterator ebml::childTypeSpec_t::end ( ) const

Returns an iterator pointing past the end of the specifications.

Returns
Constant iterator.

◆ isValid()

bool ebml::childTypeSpec_t::isValid ( const ebmlElement_sp elem) const

Checks whether a given element is valid under this specification.

Parameters
elemThe EBML element smart pointer to validate.
Returns
True if valid, false otherwise.

◆ occurSpec() [1/3]

const occurSpec_d & ebml::childTypeSpec_t::occurSpec ( ) const

Retrieves the complete occurrence specifications.

Returns
A constant reference to the occurrence specification map.

◆ occurSpec() [2/3]

const occurSpec_t & ebml::childTypeSpec_t::occurSpec ( ebmlID_t  ebmlID) const

Retrieves the occurrence specification for a given EBML ID.

Parameters
ebmlIDThe EBML ID.
Returns
The occurrence specification.

◆ occurSpec() [3/3]

const occurSpec_t & ebml::childTypeSpec_t::occurSpec ( const ebmlElementType cls) const

Retrieves the occurrence specification for a given child type.

Parameters
clsPointer to the child element type.
Returns
The occurrence specification.

◆ operator=() [1/4]

childTypeSpec_t & ebml::childTypeSpec_t::operator= ( childClassSpecArg_init_l  items)

◆ operator=() [2/4]

childTypeSpec_t & ebml::childTypeSpec_t::operator= ( const childTypeSpecArg_l items)

◆ operator=() [3/4]

childTypeSpec_t& ebml::childTypeSpec_t::operator= ( const childTypeSpec_t )
default

◆ operator=() [4/4]

childTypeSpec_t& ebml::childTypeSpec_t::operator= ( childTypeSpec_t &&  )
default

◆ operator[]()

const ebmlElementType * ebml::childTypeSpec_t::operator[] ( ebmlID_t  ebmlID) const

Retrieves the child type for a given EBML ID.

Parameters
ebmlIDThe EBML ID.
Returns
Pointer to the corresponding ebmlElementType.
Exceptions
ebmlNoChildMatchif no matching type is found.

◆ remove()

void ebml::childTypeSpec_t::remove ( ebmlID_t  )

Removes child type for a given EBML ID.

Parameters
ebmlIDThe EBML ID to remove.

◆ size()

size_t ebml::childTypeSpec_t::size ( ) const

Returns the total number of child type specifications.

Returns
Total count.

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