DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
Random.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "Common.h"
9#include "System/Object.h"
10
11namespace DotNetDupe {
12 namespace System {
13
18 class Random : public Object {
19 public:
22
25 DOTNETDUPE_API Random(int seed);
26
29 DOTNETDUPE_API virtual int Next();
30
34 DOTNETDUPE_API virtual int Next(int maxValue);
35
40 DOTNETDUPE_API virtual int Next(int minValue, int maxValue);
41
45 DOTNETDUPE_API virtual void NextBytes(unsigned char* buffer, int bufferSize);
46
49 DOTNETDUPE_API virtual double NextDouble();
50
51 private:
52 int _seed;
53 };
54 }
55}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Base object class for DotNetDupe mirroring .NET System.Object.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
virtual double NextDouble()
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1....
Definition Random.cpp:41
Random()
Initializes a new instance of the Random class, using a time-dependent default seed value.
Definition Random.cpp:7
virtual int Next()
Returns a non-negative random integer.
Definition Random.cpp:11
virtual void NextBytes(unsigned char *buffer, int bufferSize)
Fills the elements of a specified array of bytes with random numbers.
Definition Random.cpp:32