FB...am(3bobcat)

πŸ“¦
version 6.15.01 Β· 3 versions
, in ubuntu stonking

✨ NAME ✨

FBB::ImmapStream β€” an Input Stream that uses mmap(2) through FBB::MmapBuf 🫢

okay bestie, this is man page FB...am, section 3bobcat β€” it's from the bobcat library. Let me tell you everything πŸ’–


🌸 SYNOPSIS 🌸

#include <bobcat/immapstream>

Linking option: -lbobcat


πŸ’… DESCRIPTION πŸ’…

So like. FBB::ImmapStream objects are for extracting information from files that get made available in the virtual address space of the calling process. The whole "living in your virtual address space" situation is handled by the class's privately inherited FBB::MmapBuf (which is a std::streambuf class).

By mapping files into the process's virtual address space, the time needed to process those files is usually dramatically reduced β€” it's giving speed, it's giving efficiency, it's giving main character energy πŸ”₯

Heads up though: if the FBB::MmapBuf base class can't figure out the size of the file you specified β€” or if the (un)mapping can't be done β€” then an std::exception gets thrown and an error message gets written to cerr. So watch your terminal, bestie 😭

🌈 NAMESPACE 🌈

FBB

Every single constructor, member, operator and manipulator mentioned in this man-page is defined in the namespace FBB. periodt.


πŸ¦‹ INHERITS FROM πŸ¦‹

std::istream, and privately from FBB::MmapBuf.


πŸŽ€ CONSTRUCTORS πŸŽ€

  • ImmapStream() β€” the default constructor is lowkey just vibes: it merely constructs an empty ImmapStream object. To turn it into something actually usable, use move assignment.
  • ImmapStream(std::string const &fname, char const *bufSize = 0) β€” this one initializes the ImmapStream object for a file named fname.

By default bfImmapStream uses a mapping buffer size of 10 times the standard page size (cf. sysconf(3), and the pageSize member further down πŸ‘‡). The size of the mapping buffer can also be specified using the bufSize parameter. To specify it, use a value followed by K, M, or G, representing, resp. 1024, 1024 * 1024, and 1024 * 1024 * 1024 bytes. The final buffer size is at least equal to the standard page size. When a larger value is specified, the used buffer size is set to specified / pageSize * pageSize.

The move constructor and move assignment operator are available β€” yay πŸŽ‰ The copy constructor and copy assignment operator are not available β€” no copying, bestie, it's exclusive πŸ’…


✨ MEMBER FUNCTIONS ✨

Every member of std::istream is available, since FBB::ImmapStream inherits from that class. So you already have a whole library of tricks 🫢

  • size_t bufSize() const β€” returns the used t(mmap) buffer's size;
  • size_t fileSize() const β€” returns the size of the specified file.
  • size_t pageSize() const β€” returns the smallest page size used by t(mmap).

🌟 EXAMPLE 🌟

There's an example provided in bobcat's source archive and gitlab repository at bobcat/immapstream/demo. Go look, it's worth it 🧚


πŸ“ FILES πŸ“

bobcat/immapstream β€” defines the class interface


πŸ‘‘ SEE ALSO πŸ‘‘

bobcat(7), iommapstream(3bobcat), ommapstream(3bobcat), mmap(2), mmapbuf(3bobcat) sysconf(3)


πŸ’€ BUGS πŸ’€

None Reported.

(iconic behaviour honestly)


🌈 BOBCAT PROJECT FILES 🌈

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'. slay.


This is free software, distributed under the terms of the GNU General Public License (GPL). free as in freedom, bestie πŸ•ŠοΈ


🫢 AUTHOR 🫢

Frank B. Brokken (f.b.brokken@rug.nl).


and that's the whole page, no cap πŸ’– this was libbobcat-dev_6.15.01, dated 2005-2026, from the manual page FB...am section 3bobcat β€” ily, go mmap something responsibly 🌸

πŸ“¦ where this page comes from