rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
random.h
Go to the documentation of this file.
1 #ifndef _RAPID_UTILS_RANDOM_H_
2 #define _RAPID_UTILS_RANDOM_H_
3 
4 namespace rapid {
5 namespace utils {
8  public:
9  virtual ~RandomNumberInterface() {}
15  virtual int rand() const = 0;
16 };
17 
20  public:
21  RandomNumber();
22  int rand() const;
23 };
24 
34  public:
36  int rand() const;
37 
39  void set_rand(int val);
40 
41  private:
42  int number_;
43 };
44 } // namespace utils
45 } // namespace rapid
46 
47 #endif // _RAPID_UTILS_RANDOM_H_
Interface for random number generators.
Definition: random.h:7
int rand() const
Generate a random number in [0, RAND_MAX].
virtual int rand() const =0
Generate a random number in [0, RAND_MAX].
int rand() const
Generate a random number in [0, RAND_MAX].
The cstdlib random number generator.
Definition: random.h:19
A mock random number generator for unit testing.
Definition: random.h:33
void set_rand(int val)
Set what rand() will return next.