You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-10-31 18:30:33 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			514 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			514 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef MYRAND_MYRAND_H__
 | |
| #define MYRAND_MYRAND_H__
 | |
| 
 | |
| #include <cstdlib>
 | |
| 
 | |
| namespace myrand
 | |
| {
 | |
| class MyRand
 | |
| {
 | |
| public:
 | |
| 	explicit MyRand(int min, int max);
 | |
| 	~MyRand() { }
 | |
| 
 | |
| 	int generate()
 | |
| 	{ return (fMin + (int)((double)(fMax - fMin + 1) * (rand_r(&fSeed) / (RAND_MAX + 1.0)))); }
 | |
| 
 | |
| 	int operator()() { return generate(); }
 | |
| 
 | |
| protected:
 | |
| 
 | |
| private:
 | |
| 	//defaults okay (I guess)
 | |
| 	//MyRand(const MyRand& rhs);
 | |
| 	//MyRand& operator=(const MyRand& rhs);
 | |
| 
 | |
| 	unsigned int fSeed;
 | |
| 	int fMin;
 | |
| 	int fMax;
 | |
| };
 | |
| }
 | |
| 
 | |
| #endif
 | |
| // vim:ts=4 sw=4:
 | |
| 
 |