You've already forked mariadb-columnstore-engine
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:
committed by
Roman Nozdrin
parent
5287e6860b
commit
638202417f
@ -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
|
||||
{
|
||||
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user