File RelationRange.h

namespace podio
template<typename ReferenceType>
class RelationRange
#include <podio/RelationRange.h>

A simple helper class that allows one to return related objects in a way that makes it possible to use the return type in a range-based for loop.

Public Types

using ConstIteratorType = typename std::vector<ReferenceType>::const_iterator

Public Functions

RelationRange() = delete
inline RelationRange(ConstIteratorType begin, ConstIteratorType end)
inline ConstIteratorType begin() const

begin of the range (necessary for range-based for loop)

inline ConstIteratorType end() const

end of the range (necessary for range-based for loop)

inline ConstIteratorType cbegin() const

constant begin of the range

inline ConstIteratorType cend() const

constant end of the range

inline size_t size() const

convenience overload for size

inline bool empty() const

convenience overload to check if the range is empty

inline explicit operator bool() const

check whether the range is not empty

inline ReferenceType operator[](size_t i) const

Indexed access.

inline ReferenceType front() const

First element of the range.

inline ReferenceType back() const

Last element of the range.

inline ReferenceType at(size_t i) const

Indexed access with range check.

Private Members

ConstIteratorType m_begin
ConstIteratorType m_end
size_t m_size = {0}