Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Test/ArrayFn2.cpp

Go to the documentation of this file.
00001 // Fred P. for J2K Library
00002 // LGPL Licensed.
00003 // http://j2k.sourceforge.net/
00004 
00005 #ifndef __ARRAY_FN2_CPP__
00006 #define __ARRAY_FN2_CPP__
00007 
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include <iostream.h>
00011 
00012 class ArrayFn {
00013 public:
00014   typedef void ( ArrayFn::*JCALLBACK )( int );
00015 
00016   void fn1(int a) { cout << "fn1"; }
00017   void fn2(int a) { cout << "fn2"; }
00018 
00019 
00020   static const JCALLBACK Table[] = {
00021     &ArrayFn::fn1, 
00022     &ArrayFn::fn2 
00023   };
00024 
00025   void Disp( int a, int b ) const {  
00026     ( this->*Table[a] )( b );
00027   }
00028 
00029 };
00030 
00031 void main() {
00032   ArrayFn* af = new ArrayFn();
00033   af->Disp( 1, 2 );
00034   delete af;
00035 }
00036 
00037 #endif

Generated on Sun Oct 14 18:46:43 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001