Tesseract  3.02
BITS16 Class Reference

#include <bits16.h>

List of all members.

Public Member Functions

 BITS16 ()
 BITS16 (uinT16 init)
void turn_on_bit (uinT8 bit_num)
void turn_off_bit (uinT8 bit_num)
void set_bit (uinT8 bit_num, BOOL8 value)
BOOL8 bit (uinT8 bit_num) const

Public Attributes

uinT16 val

Detailed Description

Definition at line 25 of file bits16.h.


Constructor & Destructor Documentation

BITS16::BITS16 ( ) [inline]

Definition at line 30 of file bits16.h.

             {
      val = 0;
    }                            // constructor
BITS16::BITS16 ( uinT16  init)

Definition at line 27 of file bits16.cpp.

                            {  // initial val
  val = init;
}

Member Function Documentation

BOOL8 BITS16::bit ( uinT8  bit_num) const [inline]

Definition at line 56 of file bits16.h.

                                   {  // bit to access
      return (val >> bit_num) & 01;
    };
void BITS16::set_bit ( uinT8  bit_num,
BOOL8  value 
) [inline]

Definition at line 47 of file bits16.h.

                              {  // value to flip to
      if (value)
        val = val | 01 << bit_num;
      else
        val = val & ~(01 << bit_num);
    };
void BITS16::turn_off_bit ( uinT8  bit_num) [inline]

Definition at line 42 of file bits16.h.

                                     {  // bit to flip 0..7
      val = val & ~(01 << bit_num);
    };
void BITS16::turn_on_bit ( uinT8  bit_num) [inline]

Definition at line 37 of file bits16.h.

                                    {  // bit to flip 0..7
      val = val | 01 << bit_num;
    };

Member Data Documentation

Definition at line 28 of file bits16.h.


The documentation for this class was generated from the following files: