BVarStream Class Reference

#include <BByteStream.h>

List of all members.


Detailed Description

BVarStream encodes/decodes samples of variable length. Given an integer sample value and a cascading sequence of bit lengths to try, it will write escape sequences until it encounters a bit length long enough to encapsulate the value.

It was ported to C because it was a step along the way in the implementation of class BPack. It was put into this file in case it ever became useful. Buyer beware, however, since it has been neither used nor tested since the port to C++.

Definition at line 127 of file BByteStream.h.

Public Member Functions

 BVarStream ()
 ~BVarStream ()
void InitWrite (int size, void *pointer)
void InitRead (int size, const void *pointer)
int Put (int *numbits_array, int val)
int Get (int *numbits_array)


Member Function Documentation

int BVarStream::Get int *  numbits_array  )  [inline]
 

Decode a sample based on a given sequence of bit lengths. For each bit length, a value equal to the mask (all 1's) is interpreted as an escape sequence. Every time an escape sequence encountered, we jump to the next value in numbits_array to try to interpret the value. This sequence of bit lengths must match what was used on the write side.

Definition at line 311 of file BByteStream.h.

void BVarStream::InitRead int  size,
const void *  pointer
[inline]
 

We have a buffer that we would like to use varstream to read from. matching this call with a vsfree is unnecessary (but would do no harm). pointer must be 4-byte aligned.

Definition at line 272 of file BByteStream.h.

void BVarStream::InitWrite int  size,
void *  pointer
[inline]
 

We already have a buffer that we would like to use varstream to fill w/ data. matching this call with a vsfree is unnecessary (but would do no harm). pointer must be 4-byte aligned.

Definition at line 260 of file BByteStream.h.

int BVarStream::Put int *  numbits_array,
int  val
[inline]
 

The numbits_array is an array of bit lengths which should be attempted, in order. It is assumed that at least one of the lengths is sufficient for the given val. For EdgeBreaker, we used {2,6,10,14,18,22,26,31}

Definition at line 284 of file BByteStream.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:39 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5