FBB::MemoryBridge(3bobcat)

Memory Segments
(libbobcat-dev_6.09.00)

2005-2025

NAME

FBB::MemoryBridge - Memory Segments Data Structure

SYNOPSIS

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

DESCRIPTION

The class FBB::MemoryBridge provides the interface to the memory segments used by Bobcat's Memory... classes. Bobcat's MemoryBridge class accesses or modifies those segments, controlling all its read and write operations.

NAMESPACE

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

INHERITS FROM

-

CONSTRUCTORS

  • MemoryBridge():
    The default constructor defines a stub MemoryBridge object that cannot immediately be used to access memory segments. The class's move-assignment operator can be used to turn it into a usable object.

  • MemoryBridge((std::string const &bufSize, bool erase, size_t access = 0600)) Constructs a MemoryBridge object. Its default capacity is specified by bufSize (cf. section BUFSIZE), using memory segments containing the stream's bytes.

    The access rights of the data stored in MemoryStream objects are defined by the access parameter, interpreted as an octal value, using the specifications used by (chmod(1)).

    The erase parameter is used to specify what happens to the memory segments once the MemoryBridge object goes out of scope. When specified as false the allocated memory segments are not destroyed when the object goes out of scope (and can be reaccessed until the computer is rebooted) using the memory object's ID (see the next constructor). When specified as true the memory segments are erased from memory when the object goes out of scope.

    If construction fails, an FBB::Exception is thrown.

  • MemoryBridge(int id, bool erase):
    This constructor connects to a memory segment having ID id.

    The erase parameter is used as it is used by the previous constructor.

    An FBB::Exception is thrown if construction fails (e.g., no memory segment having ID id exists), :

    The move constructor and 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

    Most of the following members throw exceptions when called from a MemoryBridge object that was initialized by its default constructor.

    EXAMPLE

    See the memorystream(3bobcat) man page.

    FILES

    bobcat/memorybridge - defines the class interface

    SEE ALSO

    bobcat(7), chmod(1), memoryaccess(3bobcat), memorybuf(3bobcat), memoryreadme(7bobcat), memorystream(3bobcat),

    BUGS

    None Reported.

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