Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

at::gray_tools Namespace Reference


Compounds

struct  gray_to_bin_helper
struct  gray_to_bin_helper< T, shift_count, true >
struct  signed_tester
struct  signed_tester< T, false >

Functions

template<typename T> T bin_to_gray (const T &i_value)
template<typename T> T gray_to_bin (T value)


Detailed Description

The gray_tools namespace exposes some tools for converting to and from the common gray code.


Function Documentation

template<typename T>
T bin_to_gray const T &    i_value
 

bin_to_gray converts any integer POD type from a binary (2s complement for signed numbers) to the run-of-the mill gray code commonly found.

template<typename T>
T gray_to_bin   value
 

gray_to_bin computes the gray binary code given the gray code value. Even though this function exists, it is far more appropriate to use class gray_code below as this will render code more readable and far less prone to error.

Parameters:
value  contains the value to be converted.

Generated for Austria by doxygen and MakeXS at Sun Oct 24 17:35:34 PDT 2004