# class BitAccumulator | A 1-byte length bit accumulator. More...
Full name | `TelEngine::BitAccumulator`
Definition | `#include <libs/ymodem/yatemodem.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- inline BitAccumulator (unsigned char dataBits)
- inline unsigned char dataBits () const
- inline void dataBits (unsigned char value)
- inline unsigned char reset (bool* oddParity = 0)
- inline unsigned int accumulate (bool bit, bool* oddParity = 0)

## Detailed Description

This class encapsulates an 8 bits length buffer used to accumulate bits

inline BitAccumulator (unsigned char dataBits) | ### BitAccumulator

Constructor

Parameters:

dataBits | The buffer size. Values interval 1..8

inline unsigned char dataBits () | ### dataBits

[const]

Get the buffer size

Returns: The buffer size

inline void dataBits (unsigned char value) | ### dataBits

Set the buffer size. Reset the accumulator

Parameters:

value | The new buffer size. Values interval 1..8

inline unsigned char reset (bool* oddParity = 0) | ### reset

Reset the accumulator. Returns the old data

Parameters:

oddParity | Optional pointer to get the parity of old data

Returns: The old data

inline unsigned int accumulate (bool bit, bool* oddParity = 0) | ### accumulate

Accumulate a bit. Reset accumulator when full

Parameters:

bit | The bit value to accumulate
oddParity | Optional pointer to get the data parity when full

Returns: The accumulated byte or a value greater then 255 if incomplete

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.