25template <
typename TBase>
26class SequenceLengthForcing :
public TBase
28 using BaseImpl = TBase;
30 using ValueType =
typename BaseImpl::ValueType;
31 using ElementType =
typename BaseImpl::ElementType;
33 SequenceLengthForcing() =
default;
35 explicit SequenceLengthForcing(
const ValueType& val)
40 explicit SequenceLengthForcing(ValueType&& val)
41 : BaseImpl(
std::move(val))
45 SequenceLengthForcing(
const SequenceLengthForcing&) =
default;
46 SequenceLengthForcing(SequenceLengthForcing&&) =
default;
47 SequenceLengthForcing& operator=(
const SequenceLengthForcing&) =
default;
48 SequenceLengthForcing& operator=(SequenceLengthForcing&&) =
default;
50 void forceReadLength(std::size_t val)
56 void clearReadLengthForcing()
61 template <
typename TIter>
64 if (forced_ == Cleared) {
65 return BaseImpl::read(iter, len);
72 return BaseImpl::read(iter, forced_);
75 template <
typename TIter>
76 ErrorStatus readN(std::size_t count, TIter& iter, std::size_t& len)
78 if (forced_ == Cleared) {
79 return BaseImpl::read(iter, len);
86 return BaseImpl::readN(count, iter, forced_);
89 static constexpr bool hasReadNoStatus()
94 template <
typename TIter>
95 void readNoStatus(TIter& iter) =
delete;
97 template <
typename TIter>
98 void readNoStatusN(std::size_t count, TIter& iter) =
delete;
102 static const std::size_t Cleared = std::numeric_limits<std::size_t>::max();
103 std::size_t 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:17