FBB::SharedMemory

libbobcat-dev_3.22.00-x.tar.gz

2005-2014


FBB::SharedMemory(3bobcat)

FBB::SharedMemory(3bobcat)

libbobcat-dev_3.22.00-x.tar.gz Shared Memory Memory

2005-2014

NAME

FBB::SharedMemory - Shared Memory memory structure

SYNOPSIS

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

DESCRIPTION

The class FBB::SharedMemory implements a usable interface to a shared memory segment made available by FBB::SharedSegment and monitored by FBB::SharedPos. It is the main building block for FBB::SharedStreambuf, defining the `device' to which FBB::SharedStreambuf interfaces. All shared memory related I/O should be performed through an FBB::SharedMemory object, which is a true object, not itself residing in shared memory. An FBB::SharedMemory object defines, connects to and manages access to shared memory, encapsulating all raw shared memory operations. In addition to the class FBB::SharedMemory the header file bobcat/sharedmemory also defines a struct SharedEnum__ defining an enum SizeUnit.

The total amount of requested shared memory is always a lower bound to the actual amount of shared memory that eventually may become available. As a fictitious example: assume 100 kB of memory is requested, then a table of, e.g., 10 entries is maintained, each entry controlling the access to a shared memory block of, 10 kB. These 10 kB blocks aren't immediately allocated, but become available once the program reads from or writes to addresses located in these data blocks. Whenever a data block is created it is initialized to 0-bytes.

Caveat: when constructing a shared memory segment make sure the segment's ID is stored at a retrievable location. This allows other processes to access the shared segment. The shared segment ID is also required to delete a shared memory segment. If the shared segment ID is lost, the memory occupied by the shared memory segment remains inaccessible, and will reduce the amount of usable memory until the computer is rebooted. The member function id returns the ID of the shared memory currently monitored by an FBB::SharedMemory object.

NAMESPACE

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

INHERITS FROM

FBB::SharedEnum__

The struct SharedEnum__ is a wrapper struct around enum SizeUnit, which is available through inheritance in several FBB::Shared* classes, and offers symbolic constants defining standard memory sizes. The enum SizeUnit defines the following symbolic constants:

CONSTRUCTORS, DESTRUCTOR

copy and move constructors are not available.

OVERLOADED OPERATORS

The overloaded copy assignement operator is not available.

MEMBER FUNCTIONS

EXAMPLE

See the sharedstream(3bobcat) man page.

FILES

bobcat/sharedmemory - defines the class interface

SEE ALSO

bobcat(7), chmod(1), isharedstream(3bobcat), osharedstream(3bobcat), sharedblock(3bobcat), sharedmutex(3bobcat), sharedpos(3bobcat), sharedsegment(3bobcat), sharedstream(3bobcat), sharedstreambuf(3bobcat)

BUGS

None Reported.

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