FBB::ISharedStream(3bobcat)
std::istream on shared memory
(libbobcat-dev_6.04.00)
2005-2023
NAME
FBB::ISharedStream - std::istream operations on shared memory
SYNOPSIS
#include <bobcat/isharedstream>
Linking option: -lpthread -lbobcat
DESCRIPTION
This class offers the features of the std::istream class, operating on
shared memory.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
INHERITS FROM
FBB::ISharedBuf (private inheritance),
std::istream,
FBB::SharedEnum__ (cf. sharedmemory(3bobcat) for a description of
this last base class).
SIZEUNIT ENUMERATION
The enum SizeUnit defines the following symbolic constants:
- kB, representing 1024 (2**10) bytes of memory;
- MB, representing 1048576 (2**20) bytes of memory;
- GB, representing 1073741824 (2**30) bytes of memory
CONSTRUCTORS
- ISharedStream():
The default constructor defines a stub a ISharedStream object that
cannot immediately be used to access shared memory. To use it, its
member open must first be called.
- ISharedStream(size_t maxSize, SizeUnit sizeUnit,
std::ios::openmode openMode = std::ios::in,
size_t access = 0600):
This constructor creates an std::istream that interfaces to a
shared memory segment having a capacity of at least maxSize *
sizeUnit bytes. By default, the shared memory segment is opened for
reading. Different from the open modes used for file streams, creating
a shared memory stream with open modes ios::in is OK. In this case
the shared memory segment is created and once information has been
written to the shared memory by another process (or object) the
information can be read. The shared memory's access rights are defined
by the access parameter, using the well-known (chmod(1)) way
to define the access rights for the owner, the group and others, using
octal digits. If construction succeeds the shared memory is ready for
use. If construction fails, an FBB::Exception is thrown.
- ISharedStream(int id, std::ios::openmode openMode = std::ios::in):
This constructor creates an std::istream that connects to a shared
memory segment having ID id. If construction succeeds the shared
memory is ready for use. If construction fails (e.g., no shared memory
segment having ID id exists), an FBB::Exception is thrown.
Copy and move constructors (and assignment operators) are not available.
MEMBER FUNCTIONS
All members of std::istream, and the enum values kB, MB, and
GB, defined by FBB::ISharedEnum__ are available.
EXAMPLE
See the sharedstream(3bobcat) man page.
FILES
bobcat/isharedstream - defines the class interface
SEE ALSO
bobcat(7), chmod(1),
osharedstream(3bobcat),
sharedblock(3bobcat),
sharedcondition(3bobcat),
sharedmemory(3bobcat),
sharedmutex(3bobcat),
sharedpos(3bobcat),
sharedreadme(7bobcat),
sharedsegment(3bobcat),
sharedstream(3bobcat),
sharedbuf(3bobcat)
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
- https://fbb-git.gitlab.io/bobcat/: gitlab project page;
- bobcat_6.04.00-x.dsc: detached signature;
- bobcat_6.04.00-x.tar.gz: source archive;
- bobcat_6.04.00-x_i386.changes: change log;
- libbobcat1_6.04.00-x_*.deb: debian package containing the
libraries;
- libbobcat1-dev_6.04.00-x_*.deb: debian package containing the
libraries, headers and manual pages;
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).