FBB::Sharedpos(3bobcat)
π FBB::Sharedpos π
okay bestie, gather round, because today we're talking about FBB::Sharedpos β that's the page you're on, Sharedpos(3bobcat), aka the Shared Memory Offsets legend. it lives in the bobcat manual set and it is, lowkey, the backstage manager of your shared memory vibes. β¨
πΈ NAME πΈ
FBB::Sharedpos β the shared memory offset controller. she's in charge. she's the one keeping track. periodt.
π SYNOPSIS π
#include <bobcat/sharedpos>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
so SharedPos is a support class for Bobcat's shared memory handling classes. what does that mean? it means she's the girl behind the girl. she controls the shared memory read/write offset, and she makes absolutely sure that shared memory operations never β and I mean never β exceed the shared memory's maximum offset. no cap. π₯
SharedPos has several public members, but honestly? they're primarily useful for the other Shared* classes that Bobcat offers. there's probably little use for a stand-alone SharedPos object. she's not a solo artist, she's a group project member who does all the work. π
and just so we're clear on vocab, bestie: in the descriptions of the class's member functions, offset refers to the read/write offset within an FBB::SharedSegment(3bobcat) object β the object for which SharedPos performs the offset-administration. she's keeping the books. π
π NAMESPACE π
FBB
all constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. yes, all of them. every single one. π
π§ INHERITS FROM π§
-
(as in: nobody. she's self-made. main character energy from the jump. π)
β TYPEDEFS AND ENUMS β
(nothing here bestie, moving on π«Ά)
π CONSTRUCTORS π
default, copy and move constructors are all available, plus the copy and move assignment operators. the whole squad. π
the thing is, though: the default constructor does not yet monitor the offset of an FBB::SharedSegment object. she's awake but she hasn't picked up her shift yet. to actually start monitoring offsets, you use the member reset. that's her clocking in. β°
β¨ OVERLOADED OPERATORS β¨
void operator++()β the offset gets incremented. but heads up: if this member is called when the offset is equal to the shared memory's maximum offset, anFBB::Exceptionis thrown. she does not tolerate going over the line, bestie. πvoid operator+=(size_t len)β the offset is incremented bylen. ifoffset + lenexceeds the shared memory's maximum offset, then the offset is set to the maximum offset and anFBB::Exceptionis thrown. so she caps it and yells at you. iconic behavior honestly.std::ostream &operator<<(std::ostream &out, SharedPos const &pos)β inserts information about theSharedPosobject intoout. cute little info dump. π
π MEMBER FUNCTIONS π
note: the behavior of member functions returning values which refer to information of anFBB::SharedSegmentis undefined until the memberresethas been called. like, undefined undefined. don't test her. π¨
bool atMaxOffset() constβ returnstrueif offset equals the maximum offset that can be used for the configuredFBB::SharedSegmentobject. she's at capacity, babe. π‘οΈsize_t blockIdx() constβ returns the index of the configuredFBB::SharedSegmentobject's shared segment data block to which offset refers. which block are we in? she knows. ποΈsize_t blockOffset() constβ returns the offset within the shared segment data block that matches the memberoffset's return value. so: where are we inside the block. πbool eof() constβ returnstrueif offset exceeds the maximum offset of any character ever written to the shared memory to which theSharedPosobject interfaces. and listen β ifeofreturnstrue, information may still be written to the shared memory: writing is possible until the maximum shared memory segment offset has been reached. soeofbeing true is not the end of the story, it's more of a vibe check. πstd::streamsize eos() constβ returns the offset just beyond the maximum offset for the current shared segment data block. for example: ifblockIdxreturns5, and the size of the shared segment data blocks equals2000, theneosreturns12000(the first offset of segment6). math girlies rise. π₯std::streamsize maxOffset() constβ returns the maximum possible offset that can be used for the currently monitoredFBB::SharedSegment. the ceiling. the limit. the final boss. π§±std::streamsize offset() constβ returns the offset within the currently monitored shared memory segment. where are we right now. πvoid reset(SharedSegment *sharedData)β resets theSharedPosobject to monitor the offset of theFBB::SharedSegmentobject whose address is passed as argument toreset. important, bestie: the address must point to asharedsegment(3bobcat)object that must exist until the end of theSharedPosobject's lifetime, or until its nextresetcall. do not let it ghost you. π» immediately after callingreset, offset is reset to0. fresh start, clean slate. π§Όstd::streamsize showmanyc() constβ returns the number of characters that can be read from the current shared segment data block. this member interrogates the number of readable characters in the shared memory segment. and here's the tea: this number may change while this member is being executed. π³ in order to receive a stable return value, calling functions should have obtained a lock on theFBB::SharedSegmentdata before calling this member. see also thesharedsegment(3bobcat)man-page. lock first, ask questions later. πstd::ios::pos_type seek(std::ios::off_type offset, std::ios::seekdir origin = std::ios::beg)β the monitored offset is changed to this member'soffsetargument, relative toorigin. seeking beyondeofis OK, so don't stress about that. however,-1is returned when seeking beyondmaxOffsetor when seeking before the shared segment's offset0. boundaries, babes. she has them. π§
πΈ EXAMPLE πΈ
see the sharedstream(3bobcat) man page. that's where the demo lives. go look. π«Ά
π¦ FILES π¦
bobcat/sharedpos β defines the class interface. that's her home address. π
π SEE ALSO π
bobcat(7), isharedstream(3bobcat), osharedstream(3bobcat), sharedblock(3bobcat), sharedcondition(3bobcat), sharedmemory(3bobcat), sharedmutex(3bobcat), sharedreadme(7bobcat), sharedsegment(3bobcat), sharedstream(3bobcat), sharedbuf(3bobcat)
the whole friend group. they all hang out together. π
π BUGS π
None Reported.
(we love a clean record. no drama. no bugs. just vibes. β¨)
π 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. yes, it's a backronym, and yes, it ate. π
π COPYRIGHT π
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!! thank you for coming to my ted talk π this was libbobcat-dev_6.07.01, dated 2005-2025, and she's still serving after all these years. stan a long-running manpage. mwah. πβ¨π¦
π¦ where this page comes from
- debian trixie: libbobcat-dev 6.07.01-2 Β· GPL-3.0-or-later WITH OpenSSL exception
- ubuntu questing: libbobcat-dev 6.07.01-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms