00001 #ifndef _rand_h 00002 #define _rand_h 00003 #include <cstdlib> 00004 00005 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) 00006 using namespace std; 00007 #endif 00008 00009 class MyRandomGenerator 00010 { 00011 public: 00012 unsigned long operator()(unsigned long n_) 00013 { 00014 return rand() % n_; 00015 } 00016 }; 00017 00018 #endif // _rand_h