aria2/test/FixedNumberRandomizer.h
Tatsuhiro Tsujikawa 1b7c198289 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: 
prefix to c++
	standard classes.
	Included string.h where mem* function are used.
2008-02-08 15:53:45 +00:00

40 lines
718 B
C++

#ifndef _D_FIXED_NUMBER_RANDOMIZER_H_
#define _D_FIXED_NUMBER_RANDOMIZER_H_
#include "Randomizer.h"
namespace aria2 {
class FixedNumberRandomizer : public Randomizer {
private:
int32_t fixedNumber;
public:
FixedNumberRandomizer():fixedNumber(0) {}
virtual ~FixedNumberRandomizer() {}
virtual long int getRandomNumber() {
return fixedNumber;
}
virtual long int getMaxRandomNumber() {
return RAND_MAX;
}
virtual long int getRandomNumber(long int to)
{
return getRandomNumber();
}
void setFixedNumber(int32_t num) {
this->fixedNumber = num;
}
int32_t getFixedNumber() const {
return fixedNumber;
}
};
} // namespace aria2
#endif // _D_FIXED_NUMBER_RANDOMIZER_H_