FBB::SharedMemory(3bobcat)

Shared Memory Memory
(libbobcat-dev_4.08.03-x.tar.gz)

2005-2018

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 by FBB::SharedMemory objects, which are true objects, not themselves 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 enum SizeUnit within the namespace FBB.

The requested amount of shared memory is always a lower bound to the maximum amount of shared memory that eventually may become available. When defining a SharedMemory object not all of its potentially available shared memory is immediately allocated. Shared memory will be allocated by the SharedMemory object once needed (up to a calculated maximum).

As a fictitious example: assume 100 kB of memory is requested. The SharedMemory object then maintains a table of, e.g., 10 entries, each entry controlling 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. Newly allocated data blocks are 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 (although they can be retrieved and removed by additional means, like ipcs(1) and ipcrm(1)). The member 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 assignment 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), ipcs(1), ipcrm(1), isharedstream(3bobcat), osharedstream(3bobcat), sharedblock(3bobcat), sharedcondition(3bobcat), sharedmutex(3bobcat), sharedpos(3bobcat), sharedreadme(7bobcat), 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).