Helpers

class Route

Route along ADM elements within an ADM document.

Describes route along ADM elements within an ADM document, i.e. which references were followed to reach a certain element from a given start point.

This is the same purpose (and basic interface) as adm::Path, but currently the implementation and constraints are different.

Thus, the name adm::Route has been chosen to distinguish between those two.

The main/essential difference is that the adm::Route stores pointers to the ADM elements, to make it easy to access the elements after a adm::Route has been created, while the adm::Path does not, as they might become invalid. Instead the adm::Path stores the (coded) element ids, which are also used to check if adm::Paths are equal or not.

To easily create an adm::Route you may use the adm::RouteTracer.

Public Types

typedef std::size_t hash_type
typedef std::vector<adm::ElementConstVariant>::iterator iterator
typedef std::vector<adm::ElementConstVariant>::const_iterator const_iterator
typedef adm::ElementConstVariant value_type

Public Functions

Route()
template<typename Element>
void add(std::shared_ptr<Element> element)
void add(adm::ElementConstVariant element)
template<typename Element>
std::shared_ptr<const Element> getFirstOf() const
template<typename Element>
std::shared_ptr<const Element> getLastOf() const
template<typename Element>
Route::const_iterator findFirstOf() const
template<typename Element>
Route::const_iterator findLastOf() const
const_iterator begin() const
const_iterator end() const
const adm::ElementConstVariant &front() const
const adm::ElementConstVariant &back() const
std::size_t size() const
hash_type hash() const

Get hash value.

class Path

Path along ADM elements within an ADM document.

Describes route along ADM elements within an ADM document, i.e. which references were followed to reach a certain element from a given start point.

This is the same purpose (and basic interface) as adm::Route, but currently the implementation and constraints are different.

Thus, the name adm::Path has been chosen to distinguish between those two.

The main/essential difference is that the adm::Route stores pointers to the ADM elements, to make it easy to access the elements after a adm::Route has been created, while the adm::Path does not, as they might become invalid. Instead the adm::Path stores the (coded) element ids, which are also used to check if adm::Paths are equal or not.

Public Types

typedef std::size_t hash_type
typedef std::vector<ElementIdVariant>::iterator iterator
typedef std::vector<ElementIdVariant>::const_iterator const_iterator

Public Functions

template<typename AdmId>
void add(AdmId id)
template<typename Element>
void add(std::shared_ptr<const Element> element)
void add(ElementConstVariant elementVariant)
void add(ElementIdVariant elementIdVariant)
hash_type hash() const
const_iterator begin() const
const_iterator end() const
ElementIdVariant front() const
ElementIdVariant back() const
std::size_t size() const
template<typename AdmElementId>
AdmElementId getFirstOf() const
template<typename AdmElementId>
AdmElementId getLastOf() const
template<typename AdmElementId>
bool hasIdType() const
using adm::RouteTracer = detail::GenericRouteTracer<Route, detail::DefaultFullDepthStrategy>

Creates adm::Routes.

This implementation traces the following route:

  • audioProgramme

  • audioContent

  • audioObject

  • audioPackFormat

  • audioChannelFormat

Complementary AudioObjects are not interpreted as such. Hence for every complementary audioObject an Route will be returned.

Warning

If the ADM structure contains a reference cycle, trace will get stuck in an infinite loop.

template<typename Property, typename ElementPtr>
Property adm::getPropertyOr(ElementPtr element, Property defaultValue)

Return value of a property or a given defaultValue if the property is not available.

This is just a more expressive shorthand equivalent to

element->has<Property>() ? element->get<Property>() : defaultValue;