Skip to content

Commit 0d9fea3

Browse files
committed
Improve c3t, c3b load
- Use simdjson to load c3t - Use yasio::ibstream to c3b
1 parent 80ddd8c commit 0d9fea3

File tree

14 files changed

+961
-1391
lines changed

14 files changed

+961
-1391
lines changed

3rdparty/yasio/yasio/ibstream.hpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class binary_reader_impl {
152152
}
153153

154154
binary_reader_impl& operator=(const binary_reader_impl&) = delete;
155-
binary_reader_impl& operator=(binary_reader_impl&&) = delete;
155+
binary_reader_impl& operator=(binary_reader_impl&&) = delete;
156156

157157
/* read 7bit encoded variant integer value
158158
** @dotnet BinaryReader.Read7BitEncodedInt(64)
@@ -189,6 +189,21 @@ class binary_reader_impl {
189189
read_bytes(&oav.front(), len);
190190
}
191191
}
192+
template <typename _Ty>
193+
size_t read_blob(_Ty& out)
194+
{
195+
return read_blob(&out, static_cast<int>(sizeof(_Ty)), 1);
196+
}
197+
template <typename _Ty, size_t _N>
198+
size_t read_blob(_Ty (&out)[_N])
199+
{
200+
return read_blob(out, static_cast<int>(sizeof(_Ty)), static_cast<int>(_N));
201+
}
202+
size_t read_blob(void* out, int size, int count)
203+
{
204+
read_bytes(out, size * count);
205+
return count;
206+
}
192207
void read_bytes(void* oav, int len)
193208
{
194209
if (len > 0)

0 commit comments

Comments
 (0)