| 93 | bool hasNext() const { return valuesLeft > 0; } |
| 94 | |
| 95 | StoredPKValue<T> next() { |
| 96 | DASSERT(valuesLeft > 0); |
| 97 | --valuesLeft; |
| 98 | if constexpr (kIsStringPK) { |
| 99 | uint32_t len = 0; |
| 100 | readBytes(reinterpret_cast<uint8_t*>(&len), sizeof(uint32_t)); |
| 101 | std::string s; |
| 102 | s.resize(len); |
| 103 | if (len > 0) { |
| 104 | readBytes(reinterpret_cast<uint8_t*>(s.data()), len); |
| 105 | } |
| 106 | return s; |
| 107 | } else { |
| 108 | StoredPKValue<T> value; |
| 109 | readBytes(reinterpret_cast<uint8_t*>(&value), sizeof(StoredPKValue<T>)); |
| 110 | return value; |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | private: |
| 115 | void readBytes(uint8_t* dst, size_t n) { |
no test coverage detected