1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4171

This commit is contained in:
David Hall
2020-07-30 17:28:11 -05:00
committed by Roman Nozdrin
parent 5287e6860b
commit 638202417f
40 changed files with 807 additions and 250 deletions

View File

@ -236,6 +236,17 @@ ByteStream& ByteStream::operator<<(const uint64_t o)
}
// WIP MCOL-641
ByteStream& ByteStream::operator<<(const int128_t& o)
{
if (fBuf == 0 || (fCurInPtr - fBuf + 16U > fMaxLen + ISSOverhead))
growBuf(fMaxLen + BlockSize);
*((int128_t*) fCurInPtr) = o;
fCurInPtr += 16;
return *this;
}
ByteStream& ByteStream::operator<<(const uint128_t& o)
{
if (fBuf == 0 || (fCurInPtr - fBuf + 16U > fMaxLen + ISSOverhead))
@ -332,6 +343,13 @@ ByteStream& ByteStream::operator>>(uint64_t& o)
}
// WIP MCOL-641
ByteStream& ByteStream::operator>>(int128_t& o)
{
peek(o);
fCurOutPtr += 16;
return *this;
}
ByteStream& ByteStream::operator>>(uint128_t& o)
{
peek(o);
@ -420,6 +438,15 @@ void ByteStream::peek(uint64_t& o) const
}
// WIP MCOL-641
void ByteStream::peek(int128_t& o) const
{
if (length() < 16)
throw underflow_error("ByteStream>int128_t: not enough data in stream to fill datatype");
o = *((int128_t*) fCurOutPtr);
}
void ByteStream::peek(uint128_t& o) const
{

View File

@ -45,6 +45,7 @@ class ByteStreamTestSuite;
#define EXPORT
#endif
using int128_t = __int128;
using uint128_t = unsigned __int128;
namespace messageqcpp
@ -147,6 +148,10 @@ public:
*/
EXPORT ByteStream& operator<<(const uint64_t o);
// WIP MCOL-641
/**
* push an uint128_t onto the end of the stream. The byte order is whatever the native byte order is.
*/
EXPORT ByteStream& operator<<(const int128_t& o);
/**
* push an uint128_t onto the end of the stream. The byte order is whatever the native byte order is.
*/
@ -216,6 +221,10 @@ public:
*/
EXPORT ByteStream& operator>>(uint64_t& o);
// WIP MCOL-641
/**
* extract an uint128_t from the front of the stream. The byte order is whatever the native byte order is.
*/
EXPORT ByteStream& operator>>(int128_t& o);
/**
* extract an uint128_t from the front of the stream. The byte order is whatever the native byte order is.
*/
@ -291,6 +300,10 @@ public:
*/
EXPORT void peek(uint64_t& o) const;
// WIP MCOL-641
/**
* Peek at an uint128_t from the front of the stream. The byte order is whatever the native byte order is.
*/
EXPORT void peek(int128_t& o) const;
/**
* Peek at an uint128_t from the front of the stream. The byte order is whatever the native byte order is.
*/