FBB::IRandStream(3bobcat)
β¨ FBB::IRandStream(3bobcat) β Random numbers istream β¨
okay bestie, welcome to the bobcat manual page for FBB::IRandStream π this is the section-3 (3bobcat) page, and it's giving "i just want random numbers out of a stream" energy. let's go π¦
πΈ NAME πΈ
FBB::IRandStream β Istream producing random numbers π
β¨ SYNOPSIS β¨
#include <bobcat/irandstream>
Linking option: -lbobcat
π DESCRIPTION π
so like, FBB::IRandStream objects? you use them to extract random numbers in a given range from a stream. that's the whole vibe. pull numbers out, they're random, they're in a range, slay. π
π«Ά NAMESPACE π«Ά
FBB
every constructor, member, operator and manipulator mentioned in this man-page is defined in the namespace FBB. no cap. π
π INHERITS FROM π
std::istreamFBB::RandBuffer(private)
π CONSTRUCTORS π
IRandStream(int max)β thisFBB::IRandStream()constructor initializes the random generator. it uses the default seed (i.e.,1) for thesrand(3)function, which means every new run of your program will generate the same sequence of random values π (yes, same numbers every time, it's giving groundhog day). another constructor (see below β¬οΈ) exists for when that's not it. random values between1andmax(inclusive) are returned.IRandStream(int min, int max)β thisFBB::IRandStream()constructor initializes the random generator too. again with the default seed (i.e.,1) for thesrand(3)function, so every new run of the program generates the same sequence of random values. and again, another constructor (see below β¬οΈ) is provided when that's not considered appropriate. random values betweenminandmax(inclusive) are returned.IRandStream(int min, int max, size_t seed)β thisFBB::IRandStream()constructor initializes the random generator, and this time theseedis used to initialize the random number generator π±. if you want to start the random generator at some unpredictable point,time(0)could be used. random values betweenminandmax(inclusive) are returned.
copy and move constructors (and assignment operators) are not available. not me trying to copy one π don't.
π§ INHERITED MEMBERS π§
since the class uses public derivation from std::istream, all members of this class can be used. all of them. the whole squad. π«Ά
π₯ EXAMPLE π₯
#include <iostream>
#include <bobcat/irandstream>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
if (argc == 1)
cout << "\n"
"Showing one random value between 1 and 1000 (inclusive).\n"
"If you want more values specify the requested number of\n"
"values as the programβs first argument\n"
"On repeated calls the same numbers are generated\n\n";
IRandStream in(1000);
for (size_t count = argc == 1? 1 : stoul(argv[1]); count--; )
{
size_t random;
in >> random;
cout << random << endl;
}
}
π FILES π
bobcat/irandstreamβ defines the class interface
π SEE ALSO π
π BUGS π
None Reported. (iconic behaviour honestly)
π BOBCAT PROJECT FILES π
https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
β BOBCAT β
Bobcat is an acronym of Brokkenβs Own Base Classes And Templates.
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL).
π¦ AUTHOR π¦
Frank B. Brokken (f.b.brokken@rug.nl).
okay bestie that's the whole page, you ate that π mwah π
libbobcat-dev_6.15.01 Β· 2005-2026 Β· FBB::IRandStream(3bobcat) β periodt, go generate some random numbers β¨
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms