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

at::gray_tools::gray_to_bin_helper< T, shift_count, terminal_calc > Struct Template Reference

#include <at_gray_code.h>

List of all members.

Static Public Methods

void calculate (T &io_value)


Detailed Description

template<typename T, int shift_count = 1, bool terminal_calc = ( shift_count >= ( std::numeric_limits<T>::digits ) )>
struct at::gray_tools::gray_to_bin_helper< T, shift_count, terminal_calc >

gray_to_bin_helper contains a static helper method to generate binary code from gray code. This is a recursive template that will terminate when the specialization below is used.


Member Function Documentation

template<typename T, int shift_count = 1, bool terminal_calc = ( shift_count >= ( std::numeric_limits<T>::digits ) )>
void at::gray_tools::gray_to_bin_helper< T, shift_count, terminal_calc >::calculate T &    io_value [inline, static]
 

calculate will calculate the inverse of the gray code conversion above. The value is passed by reference and is modified in place.

In general the computation is :

value ^= value >> 1; value ^= value >> 2; value ^= value >> 4; // terminate here for 8 bit value ^= value >> 8; // terminate here for 16 bit value ^= value >> 16; // terminate here for 32 bit value ^= value >> 32; // terminate here for 64 bit

Parameters:
the  value being computed


The documentation for this struct was generated from the following file:

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