class BitAccumulator

A 1-byte length bit accumulator. More...

Full nameTelEngine::BitAccumulator
Definition#include <libs/ymodem/yatemodem.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

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

inline  BitAccumulator (unsigned char dataBits)

BitAccumulator

Constructor

Parameters:
dataBitsThe 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:
valueThe new buffer size. Values interval 1..8

inline unsigned char  reset (bool* oddParity = 0)

reset

Reset the accumulator. Returns the old data

Parameters:
oddParityOptional 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:
bitThe bit value to accumulate
oddParityOptional 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 Sun Oct 20 21:06:06 2013, using kdoc 2.0a54.