Helpers¶
-
class adm::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 aadm::Route
has been created, while theadm::Path
does not, as they might become invalid. Instead theadm::Path
stores the (coded) element ids, which are also used to check ifadm::Path
s are equal or not.To easily create an
adm::Route
you may use theadm::RouteTracer
.Routes are ordered first by the hash of their elements, then by the elements themselves.
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() = default¶
-
inline void add(adm::ElementConstVariant element)¶
-
template<typename Element>
const_iterator findFirstOf() const¶
-
template<typename Element>
const_iterator findLastOf() const¶
-
inline const_iterator begin() const¶
-
inline const_iterator end() const¶
-
inline const adm::ElementConstVariant &front() const¶
-
inline const adm::ElementConstVariant &back() const¶
-
inline std::size_t size() const¶
-
typedef std::size_t hash_type¶
-
class adm::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 aadm::Route
has been created, while theadm::Path
does not, as they might become invalid. Instead theadm::Path
stores the (coded) element ids, which are also used to check ifadm::Path
s 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
-
void add(ElementConstVariant elementVariant)¶
-
void add(ElementIdVariant elementIdVariant)¶
-
inline const_iterator begin() const¶
-
inline const_iterator end() const¶
-
inline ElementIdVariant front() const¶
-
inline ElementIdVariant back() const¶
-
inline std::size_t size() const¶
-
template<typename AdmElementId>
AdmElementId getFirstOf() const¶
-
template<typename AdmElementId>
AdmElementId getLastOf() const¶
-
template<typename AdmElementId>
bool hasIdType() const¶
-
typedef std::size_t hash_type¶
-
using adm::RouteTracer = detail::GenericRouteTracer<Route, detail::DefaultFullDepthStrategy>¶
Creates
adm::Route
s.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;