Lucene++ - a full-featured, c++ search engine
API Documentation


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Random.h
Go to the documentation of this file.
1 
2 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef RANDOM_H
8 #define RANDOM_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
15 class LPPAPI Random : public LuceneObject {
16 public:
17  Random();
18  Random(int64_t seed);
19 
20  virtual ~Random();
21 
22 protected:
23  int64_t seed;
24 
25 public:
26  void setSeed(int64_t seed);
27  int32_t nextInt(int32_t limit = INT_MAX);
28  double nextDouble();
29 
30 protected:
31  int32_t next(int32_t bits);
32 };
33 
34 }
35 
36 #endif

clucene.sourceforge.net