ndn-cxx: NDN C++ Library 0.9.0-33-g832ea91d
Loading...
Searching...
No Matches
ndn::tlv::detail Namespace Reference

Typedefs

template<typename Iterator , typename DecayedIterator = std::decay_t<Iterator>, typename ValueType = typename std::iterator_traits<DecayedIterator>::value_type>
using IsContiguousIterator = std::disjunction< std::conjunction< std::bool_constant< sizeof(ValueType)==1 >, std::negation< std::is_same< ValueType, bool > >, std::disjunction< std::is_convertible< DecayedIterator, const ValueType * >, std::is_convertible< DecayedIterator, typename std::vector< ValueType >::const_iterator > > >, std::conjunction< std::is_same< ValueType, char >, std::is_convertible< DecayedIterator, typename std::basic_string< ValueType >::const_iterator > > >
 Determine whether to select the readNumber() implementation for ContiguousIterator.
 

Functions

template<typename Iterator >
constexpr bool readNumber (size_t size, Iterator &begin, Iterator end, uint64_t &number) noexcept
 

Typedef Documentation

◆ IsContiguousIterator

template<typename Iterator , typename DecayedIterator = std::decay_t<Iterator>, typename ValueType = typename std::iterator_traits<DecayedIterator>::value_type>
using ndn::tlv::detail::IsContiguousIterator = typedef std::disjunction< std::conjunction< std::bool_constant<sizeof(ValueType) == 1>, std::negation<std::is_same<ValueType, bool> >, std::disjunction< std::is_convertible<DecayedIterator, const ValueType*>, std::is_convertible<DecayedIterator, typename std::vector<ValueType>::const_iterator> >> , std::conjunction< std::is_same<ValueType, char>, std::is_convertible<DecayedIterator, typename std::basic_string<ValueType>::const_iterator> >>

Determine whether to select the readNumber() implementation for ContiguousIterator.

This is not a full ContiguousIterator detection implementation. It returns true for the most common ContiguousIterator types used with TLV decoding function templates.

Todo:
Replace with std::contiguous_iterator concept when we migrate to C++20.

Definition at line 289 of file tlv.hpp.

Function Documentation

◆ readNumber()

template<typename Iterator >
constexpr bool ndn::tlv::detail::readNumber ( size_t  size,
Iterator &  begin,
Iterator  end,
uint64_t &  number 
)
constexprnoexcept

Definition at line 310 of file tlv.hpp.