28template <
typename TBase>
29class SequenceLengthForcing :
public TBase
31 using BaseImpl = TBase;
33 using ValueType =
typename BaseImpl::ValueType;
34 using ElementType =
typename BaseImpl::ElementType;
36 SequenceLengthForcing() =
default;
38 explicit SequenceLengthForcing(
const ValueType& val)
43 explicit SequenceLengthForcing(ValueType&& val)
44 : BaseImpl(
std::move(val))
48 SequenceLengthForcing(
const SequenceLengthForcing&) =
default;
49 SequenceLengthForcing(SequenceLengthForcing&&) =
default;
50 SequenceLengthForcing& operator=(
const SequenceLengthForcing&) =
default;
51 SequenceLengthForcing& operator=(SequenceLengthForcing&&) =
default;
53 void forceReadLength(std::size_t val)
59 void clearReadLengthForcing()
64 template <
typename TIter>
67 if (m_forced == Cleared) {
68 return BaseImpl::read(iter, len);
75 return BaseImpl::read(iter, m_forced);
78 template <
typename TIter>
79 ErrorStatus readN(std::size_t count, TIter& iter, std::size_t& len)
81 if (m_forced == Cleared) {
82 return BaseImpl::read(iter, len);
89 return BaseImpl::readN(count, iter, m_forced);
92 static constexpr bool hasReadNoStatus()
97 template <
typename TIter>
98 void readNoStatus(TIter& iter) =
delete;
100 template <
typename TIter>
101 void readNoStatusN(std::size_t count, TIter& iter) =
delete;
104 static const std::size_t Cleared = std::numeric_limits<std::size_t>::max();
105 std::size_t m_forced = Cleared;
This file contains classes required for generic custom assertion functionality.
#define COMMS_ASSERT(expr)
Generic assert macro.
Definition Assert.h:170
This file contain definition of error statuses used by comms module.
Main namespace for all classes / functions of COMMS library.
ErrorStatus
Error statuses reported by the Communication module.
Definition ErrorStatus.h:19