FB...am(3bobcat)

๐Ÿ“ฆ
version 6.15.01 ยท 3 versions
, in ubuntu stonking

๐Ÿ’– FB...am(3bobcat) ๐Ÿ’–

okay bestie, this is the manual page FB...am(3bobcat), and its whole vibe is std::istream using FBB::MmapBuf as streambuf. Bobcat manual, section 3. We're mapping files straight into memory, no cap ๐Ÿงšโœจ


๐ŸŽ€ NAME ๐ŸŽ€

FBB::OmmapStream โ€” an Input Stream that does mmap(2) through FBB::MmapBuf.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <bobcat/ommapstream>

Linking option: -lbobcat

โœจ DESCRIPTION โœจ

So like, FBB::OmmapStream objects are how you write information to files that get made available in the virtual address space of the calling process. The whole "living in virtual address space" situation is handled by the class's privately inherited FBB::MmapBuf (std::streambuf class. ๐Ÿซถ

And the reason you'd even do this: 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 ๐Ÿ’…

Now the serious bit โ€” an std::exception gets thrown, and an error message gets written to cerr, if the FBB::MmapBuf base class can't figure out the size of the file you specified, or when the (un)mapping just cannot be performed. no cap, so watch out for that one ๐Ÿ˜ญ


๐Ÿ’œ NAMESPACE ๐Ÿ’œ

FBB

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


๐Ÿฆ‹ INHERITS FROM ๐Ÿฆ‹

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


๐Ÿ‘‘ CONSTRUCTORS ๐Ÿ‘‘

  • OmmapStream() โ€” the default constructor just constructs an empty OmmapStream object, lowkey useless on its own. To turn it into a usable object you use move assignment.
  • OmmapStream(std::string const &fname, char const *bufSize = 0, std::ios::openmode openMode = std::ios::out, mode_t mode = 0644) โ€” this one initializes the OmmapStream object for a file named fname. ๐ŸŽ€

The openMode parameter says how fname gets used. The standard ios::in, ios::out, ios::trunc, ios::app, and ios::ate modes are all supported. slay.

By default bfOmmapStream) rocks a mapping buffer size of 10 times the standard page size (cf. sysconf(3), and the member pageSize below). You can also set the size of the mapping buffer with the bufSize parameter โ€” to do that, use a value followed by K, M, or G, which stand for, resp., 1024, 1024 * 1024, and 1024 * 1024 * 1024 bytes. The final buffer size is at least equal to the standard page size. When you specify a bigger value, the buffer size that actually gets used is set to specified / pageSize * pageSize. math is math bestie ๐Ÿงฎ

The mode parameter specifies the user/group/other access mode that's used when the file is created by MmapBuf. Its default value means read/write access by the user, and read access by others. )

The move constructor and the move assignment operator are available. The copy constructor and the copy assignment operator are not available. don't even try it ๐Ÿ™ˆ

๐Ÿ’… MEMBER FUNCTIONS ๐Ÿ’…

All members of std::ostream are available, because FBB::OmmapStream inherits from that class. everything. inherited. iconic.

  • size_t bufSize() const โ€” returns the size of the used t(mmap) buffer;
  • size_t fileSize() const โ€” returns the current size of the used file. The size gets updated to a larger size when you write beyond the current file size. And once the OmmapStream object ceases to exist, the used file's size is modified to the current fileSize value. glow up on exit โœจ
  • size_t pageSize() const โ€” returns the smallest page size used by t(mmap).

๐ŸŒˆ EXAMPLE ๐ŸŒˆ

There's an example waiting for you in bobcat's source archive and gitlab repository at bobcat/ommapstream/demo. go look, it's cute ๐Ÿฆ‹


๐Ÿ“ FILES ๐Ÿ“

  • bobcat/ommapstream โ€” defines the class interface

๐ŸŒŸ SEE ALSO ๐ŸŒŸ

bobcat(7), chmod(2), immapstream(3bobcat), iommapstream(3bobcat), mmap(2), mmapbuf(3bobcat) sysconf(3)


๐Ÿ’€ BUGS ๐Ÿ’€

None Reported. (and honestly? we love that for us)


๐ŸŽ€ 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. an acronym AND a whole personality.


This is free software, distributed under the terms of the GNU General Public License (GPL). free as in bestie ๐Ÿ’œ


๐Ÿ’– AUTHOR ๐Ÿ’–

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


okay that's the whole page, we ate and left no crumbs ๐Ÿซถ this was libbobcat-dev_6.15.01, dated 2005-2026, and you just read FB...am(3bobcat) โ€” main character energy, fr fr โญ

๐Ÿ“ฆ where this page comes from