.TH "FBB::IRandStream" "3bobcat" "2005\-2020" "libbobcat\-dev_5\&.07\&.00" "Random numbers istream" .PP .SH "NAME" FBB::IRandStream \- Istream producing random numbers .PP .SH "SYNOPSIS" \fB#include \fP .br Linking option: \fI\-lbobcat\fP .PP .SH "DESCRIPTION" \fBFBB::IRandStream\fP objects may be used to extract random numbers in a given range from a stream\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \fBstd::istream\fP, .br \fBFBB::RandBuffer\fP (private) .PP .SH "CONSTRUCTORS" .IP o \fBIRandStream(int max)\fP: .br This \fBFBB::IRandStream()\fP constructor initializes the random generator\&. The default seed (i\&.e\&., 1) for the \fBsrand\fP(3) function is used, meaning that every new run of the program will generate the same sequence of random values\&. Another constructor (see below) is provided when this is not considered appropriate\&. Random values between 1 and \fImax\fP (inclusive) are returned\&. .IP .IP o \fBIRandStream(int min, int max)\fP: .br This \fBFBB::IRandStream()\fP constructor initializes the random generator\&. The default seed (i\&.e\&., 1) for the \fBsrand\fP(3) function is used, meaning that every new run of the program will generate the same sequence of random values\&. Another constructor (see below) is provided when this is not considered appropriate\&. Random values between \fImin\fP and \fImax\fP (inclusive) are returned\&. .IP .IP o \fBIRandStream(int min, int max, size_t seed)\fP: .br This \fBFBB::IRandStream()\fP constructor initializes the random generator\&. The seed is used to initialize the random number generator\&. To start the random generator at some unpredictable point, \fItime(0)\fP could be used\&. Random values between \fImin\fP and \fImax\fP (inclusive) are returned\&. .PP Copy and move constructors (and assignment operators) are not available\&. .PP .SH "INHERITED MEMBERS" .PP Since the class uses public derivation from \fBstd::istream\fP, all members of this class can be used\&. .PP .SH "EXAMPLE" .nf #include #include using namespace std; using namespace FBB; int main(int argc, char **argv) { IRandStream in(1000); for (; argc\-\-; ) { size_t random; in >> random; cout << random << endl; } } .fi .PP .SH "FILES" \fIbobcat/irandstream\fP \- defines the class interface .PP .SH "SEE ALSO" \fBbobcat\fP(7), \fBrandbuf\fP(3bobcat) .PP .SH "BUGS" None Reported\&. .PP .SH "BOBCAT PROJECT FILES" .PP .IP o \fIhttps://fbb\-git\&.gitlab\&.io/bobcat/\fP: gitlab project page; .IP o \fIbobcat_5\&.07\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_5\&.07\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_5\&.07\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_5\&.07\&.00\-x_*\&.deb\fP: debian package containing the libraries; .IP o \fIlibbobcat1\-dev_5\&.07\&.00\-x_*\&.deb\fP: debian package containing the libraries, headers and manual pages; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP