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 // Copyright (c) 2009-2011 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  {
17  public:
18  Random();
19  Random(int64_t seed);
20 
21  virtual ~Random();
22 
23  protected:
24  int64_t seed;
25 
26  public:
27  void setSeed(int64_t seed);
28  int32_t nextInt(int32_t limit = INT_MAX);
29  double nextDouble();
30 
31  protected:
32  int32_t next(int32_t bits);
33  };
34 }
35 
36 #endif

clucene.sourceforge.net