diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /ml/dlib/dlib/bit_stream/bit_stream_multi_1.h | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz netdata-5da14042f70711ea5cf66e034699730335462f66.zip |
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ml/dlib/dlib/bit_stream/bit_stream_multi_1.h')
-rw-r--r-- | ml/dlib/dlib/bit_stream/bit_stream_multi_1.h | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/ml/dlib/dlib/bit_stream/bit_stream_multi_1.h b/ml/dlib/dlib/bit_stream/bit_stream_multi_1.h deleted file mode 100644 index bf1cc0357..000000000 --- a/ml/dlib/dlib/bit_stream/bit_stream_multi_1.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (C) 2003 Davis E. King (davis@dlib.net) -// License: Boost Software License See LICENSE.txt for the full license. -#ifndef DLIB_BIT_STREAM_MULTi_1_ -#define DLIB_BIT_STREAM_MULTi_1_ - -#include "bit_stream_multi_abstract.h" - -namespace dlib -{ - template < - typename bit_stream_base - > - class bit_stream_multi_1 : public bit_stream_base - { - - public: - - void multi_write ( - unsigned long data, - int num_to_write - ); - - int multi_read ( - unsigned long& data, - int num_to_read - ); - - }; - - template < - typename bit_stream_base - > - inline void swap ( - bit_stream_multi_1<bit_stream_base>& a, - bit_stream_multi_1<bit_stream_base>& b - ) { a.swap(b); } - -// ---------------------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- - // member function definitions -// ---------------------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- - - template < - typename bit_stream_base - > - void bit_stream_multi_1<bit_stream_base>:: - multi_write ( - unsigned long data, - int num_to_write - ) - { - // move the first bit into the most significant position - data <<= 32 - num_to_write; - - for (int i = 0; i < num_to_write; ++i) - { - // write the first bit from data - this->write(static_cast<char>(data >> 31)); - - // shift the next bit into position - data <<= 1; - - } - } - -// ---------------------------------------------------------------------------------------- - - template < - typename bit_stream_base - > - int bit_stream_multi_1<bit_stream_base>:: - multi_read ( - unsigned long& data, - int num_to_read - ) - { - int bit, i; - data = 0; - for (i = 0; i < num_to_read; ++i) - { - - // get a bit - if (this->read(bit) == false) - break; - - // shift data to make room for this new bit - data <<= 1; - - // put bit into the least significant position in data - data += static_cast<unsigned long>(bit); - - } - - return i; - } - -// ---------------------------------------------------------------------------------------- - -} - -#endif // DLIB_BIT_STREAM_MULTi_1_ - |