FBB::MemoryBuf(3bobcat)

Memory memory streambuf
(libbobcat-dev_6.12.01)

2005-2026

NAME

FBB::MemoryBuf - streambuf interfacing to memory segments

SYNOPSIS

#include <bobcat/memorybuf>
Linking option: -lbobcat

DESCRIPTION

MemoryBuf implements a specialization of the std::streambuf class, allowing stream classes (std::iostream, FBB::MemoryStream) to perform I/O operations on memory segmnts (cf. shmget(2)).

FBB::MemoryBuf povides the streambufs of FBB::MemoryStream objects using a FBB::MemoryBridge object interfacing to the shared memory blocks read/written by a FBB::MemoryBuf object.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

std::streambuf.

CONSTRUCTORS

The move constructor and the move assignment operator are available, the copy constructor and copy assignment operator are not available.

BUFSIZE

The bufSize parameter required by the second MemoryStream constructor and the open member (see below) specifies the default number nummber of shared memory memory blocks and their sizes. The size of the memory blocks is specified as k, M or G, indicating block sizes in kilo-, Mega- and GigaBytes. Before those letters the default number of blocks is specified. E.g., "100M". Internally the number of kiloBytes is converted to `pages', using the system's page size, which is commonly equal to 4 kB (so when specifying "5k" then the stream prepares for two shared data segments, each having a capacity of 4 kB. The number of MegaBytes is used as specified, and when specifying GB the data segments are .5 GB.

The number of shared data segments is aotomatically enlarged when the current capacity is exceeded, and the potentially available data segments are initially not allocated: they're allocated once information is written into their areas.

MEMBER FUNCTIONS

All members of std::streambuf are available.

EXAMPLE

See the memorystream(3bobcat) man page.

FILES

bobcat/memorybuf - defines the class interface

SEE ALSO

bobcat(7), chmod(1), memorybridge(3bobcat), memoryreadme(7bobcat), memorystream(3bobcat), shmget(2),

BUGS

Note that by default exceptions thrown from within a std::stream object are caught by the stream object, setting its ios::failbit flag. To allow exceptions to leave a stream object, its exceptions member can be called, e.g., using:

    myStream.exceptions(ios::failbit | ios::badbit | ios::eofbit);
        

BOBCAT PROJECT FILES

Debian Bobcat project files:

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).