proj home

Files   Classes   Functions   Hierarchy  

snakeindextest Class Reference

Look at snakeindex indexes. More...

#include <snakeindextest.h>

List of all members.

Static Public Member Functions

static void test01 ()
 Test the iterator in the forward direction.
static void test02 ()
 Test the iterator in the backwards direction.
static void test03 ()
 Test iterating in a vertical direction.


Detailed Description

Look at snakeindex indexes.

Definition at line 7 of file snakeindextest.h.


Member Function Documentation

void snakeindextest::test01 (  )  [static]

Test the iterator in the forward direction.

Definition at line 9 of file snakeindextest.cpp.

References snakeindex< T >::pos(), snakeindex< T >::reset(), and SHOW.

Referenced by main().

00010 {
00011   snakeindex<> si(6,17);
00012 
00013   int k2;
00014 
00015   int row;
00016   int col;
00017 
00018   for (si.reset(); !si; ++si)
00019   {
00020     si.pos(row,col);
00021     si.pos(k2);
00022     cout << "(" << row << ", " << col << ")   ";
00023     cout << SHOW(k2) << endl;
00024   }
00025 
00026 }

void snakeindextest::test02 (  )  [static]

Test the iterator in the backwards direction.

Definition at line 28 of file snakeindextest.cpp.

References snakeindex< T >::pos(), snakeindex< T >::reset(), and SHOW.

Referenced by main().

00029 {
00030   snakeindex<> si(6,17,false);
00031 
00032   int k2;
00033 
00034   int row;
00035   int col;
00036 
00037   for (si.reset(); !si; ++si)
00038   {
00039     si.pos(row,col);
00040     si.pos(k2);
00041     cout << "(" << row << ", " << col << ")   ";
00042     cout << SHOW(k2) << endl;
00043   }
00044 
00045 }

void snakeindextest::test03 (  )  [static]

Test iterating in a vertical direction.

Definition at line 47 of file snakeindextest.cpp.

References snakeindex< T >::pos(), snakeindex< T >::reset(), and SHOW.

Referenced by main().

00048 {
00049   snakeindex<> si(3,17);
00050 
00051   int ai[] = 
00052   {
00053     0, 6,  12,
00054     1, 7,  13,
00055     2, 8,  14,
00056     3, 9,  15,
00057     4, 10, 16,
00058     5, 11
00059   };
00060 
00061   int k2;
00062   int row;
00063   int col;
00064 
00065 
00066   for (si.reset(); !si; ++si)
00067   {
00068     si.pos(row,col);
00069     si.pos(k2);
00070     cout << "(" << col << ", " << row << ")   ";
00071 
00072     cout << SHOW(ai[k2]) << endl;
00073   }
00074 }


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

Generated on Fri Mar 4 00:50:17 2011 for Chelton Evans Source by  doxygen 1.5.8