~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/re2/src/util/random.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2005-2009 The RE2 Authors.  All Rights Reserved.
2
 
// Use of this source code is governed by a BSD-style
3
 
// license that can be found in the LICENSE file.
4
 
 
5
 
// Modified from Google perftools's tcmalloc_unittest.cc.
6
 
 
7
 
#ifndef RE2_UTIL_RANDOM_H__
8
 
#define RE2_UTIL_RANDOM_H__
9
 
 
10
 
#include "util/util.h"
11
 
 
12
 
namespace re2 {
13
 
 
14
 
// ACM minimal standard random number generator.  (re-entrant.)
15
 
class ACMRandom {
16
 
 public:
17
 
  ACMRandom(int32 seed) : seed_(seed) {}
18
 
  int32 Next();
19
 
  int32 Uniform(int32);
20
 
 
21
 
  void Reset(int32 seed) { seed_ = seed; }
22
 
 
23
 
 private:
24
 
  int32 seed_;
25
 
};
26
 
 
27
 
}  // namespace re2
28
 
 
29
 
#endif  // RE2_UTIL_RANDOM_H__