MiniOB
1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
src
common
math
random_generator.h
1
/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2
miniob is licensed under Mulan PSL v2.
3
You can use this software according to the terms and conditions of the Mulan PSL v2.
4
You may obtain a copy of Mulan PSL v2 at:
5
http://license.coscl.org.cn/MulanPSL2
6
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9
See the Mulan PSL v2 for more details. */
10
11
//
12
// Created by Longda on 2021/4/20.
13
//
14
#pragma once
15
16
#include <stdlib.h>
17
18
#include "common/lang/random.h"
19
20
namespace
common {
21
22
#define DEFAULT_RANDOM_BUFF_SIZE 512
23
24
class
RandomGenerator
25
{
26
27
public
:
28
RandomGenerator
();
29
virtual
~RandomGenerator
();
30
31
public
:
32
unsigned
int
next();
33
unsigned
int
next(
unsigned
int
range);
34
35
private
:
36
// The GUN Extended TLS Version
37
mt19937 randomData;
38
};
39
40
}
// namespace common
common::RandomGenerator
Definition:
random_generator.h:25
制作者
1.9.5