"vscode:/vscode.git/clone" did not exist on "401f22cadddfc8e58461aabaf0a45e3866be7a40"
Commit 754da0ef authored by Davis King's avatar Davis King
Browse files

Properly organized the svn repository. Finally.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402199
parent 49388714
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BIT_STREAm_
#define DLIB_BIT_STREAm_
#include "bit_stream/bit_stream_kernel_1.h"
#include "bit_stream/bit_stream_kernel_c.h"
#include "bit_stream/bit_stream_multi_1.h"
#include "bit_stream/bit_stream_multi_c.h"
namespace dlib
{
class bit_stream
{
bit_stream() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef bit_stream_kernel_1
kernel_1a;
typedef bit_stream_kernel_c<kernel_1a >
kernel_1a_c;
//---------- extensions ------------
// multi_1 extend kernel_1a
typedef bit_stream_multi_1<kernel_1a>
multi_1a;
typedef bit_stream_multi_c<bit_stream_multi_1<kernel_1a_c> >
multi_1a_c;
};
}
#endif // DLIB_BIT_STREAm_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_BIT_STREAM_MULTi_ABSTRACT_
#ifdef DLIB_BIT_STREAM_MULTi_ABSTRACT_
#include "bit_stream_kernel_abstract.h"
namespace dlib
{
template <
typename bit_stream_base
>
class bit_stream_multi : public bit_stream_base
{
/*!
REQUIREMENTS ON BIT_STREAM_BASE
it is an implementation of bit_stream/bit_stream_kernel_abstract.h
WHAT THIS EXTENSION DOES FOR BIT_STREAM
this gives a bit_stream object the ability to read/write multible bits
at a time
!*/
public:
void multi_write (
unsigned long data,
int num_to_write
);
/*!
requires
- is_in_write_mode() == true
- 0 <= num_to_write <= 32
ensures
- num_to_write low order bits from data will be written to the ostream
- object associated with *this
example: if data is 10010 then the bits will be written in the
order 1,0,0,1,0
!*/
int multi_read (
unsigned long& data,
int num_to_read
);
/*!
requires
- is_in_read_mode() == true
- 0 <= num_to_read <= 32
ensures
- tries to read num_to_read bits into the low order end of #data
example: if the incoming bits were 10010 then data would end
up with 10010 as its low order bits
- all of the bits in #data not filled in by multi_read() are zero
- returns the number of bits actually read into #data
!*/
};
template <
typename bit_stream_base
>
inline void swap (
bit_stream_multi<bit_stream_base>& a,
bit_stream_multi<bit_stream_base>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
}
#endif // DLIB_BIT_STREAM_MULTi_ABSTRACT_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment