File: sharedpos.yo

package info (click to toggle)
bobcat 6.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,960 kB
  • sloc: cpp: 18,954; fortran: 5,617; makefile: 2,787; sh: 659; perl: 401; ansic: 26
file content (145 lines) | stat: -rw-r--r-- 5,819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
includefile(include/header)

COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::Sharedpos)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_)
                    (Shared Memory Offsets)

manpagename(FBB::Sharedpos)(Shared Memory offset controller)

manpagesynopsis()
    bf(#include <bobcat/sharedpos>)nl()
    Linking option: tt(-lbobcat)

manpagedescription()

    The class bf(SharedPos) is a support class for Bobcat's shared memory
handling classes. It controls the shared memory read/write ofset and ensures
that shared memory operations never exceed the shared memory's maximum offset.

    The class bf(SharedPos) has several public members, but they are primarily
useful for other tt(Shared*) classes offered by Bobcat. There is probably
little use for a stand-alone bf(SharedPos) object.

    In the descriptions of the class's member functions tt(offset) refers to
the read/write offset within a bf(FBB::SharedSegment)(3bobcat) object for
which bf(SharedPos) performs the offset-administration.

includefile(include/namespace)

manpagesection(INHERITS FROM)
    -

manpagesection(TYPEDEFS AND ENUMS)

manpagesection(CONSTRUCTORS)

    Default, copy and move constructors as well as the copy and move
    assignment operators are available. The default constructor
    does not yet monitor the offset of an tt(FBB::SharedSegment)
    object. The member tt(reset) is used to start monitoring offsets.

manpagesection(OVERLOADED OPERATORS)
    itemization(
    itb(void operator++())
       The offset is incremented. If this member is called when the offset is
        equal to the shared memory's maximum offset an tt(FBB::Exception) is
        thrown.

    itb(void operator+=(size_t len))
       The offset is incremented by tt(len). If tt(offset + len) exceeds the
        shared memory's maximum offset then the offset is set to the maximum
        offset and an tt(FBB::Exception) is thrown.

    itb(std::ostream &operator<<(std::ostream &out, SharedPos const &pos))
       Inserts information about the bf(SharedPos) object into tt(out).
    )


manpagesection(MEMBER FUNCTIONS)

    Note: the behavior of member functions returning values which refer to
information of an tt(FBB::SharedSegment) is undefined until the member
tt(reset) has been called.

    itemization(
    itb(bool atMaxOffset() const)
       Returns tt(true) if offset equals the maximum offset that can be used
        for the configured tt(FBB::SharedSegment) object.

    itb(size_t blockIdx() const)
       The index of the configured tt(FBB::SharedSegment) object's shared
        segment data block to which offset refers is returned.

    itb(size_t blockOffset() const)
       The offset within the shared segment data block matching the member
        tt(offset)'s return value is returned.

    itb(bool eof() const)
       Returns tt(true) if offset exceeds the maximum offset of any character
        ever written to the shared memory to which the bf(SharedPos) object
        interfaces. If tt(eof) returns tt(true) information may still be
        em(written) to the shared memory: writing is possible until the
        maximum shared memory segment offset has been reached.

    itb(std::streamsize eos() const)
       The offset just beyond the maximum offset for the current shared
        segment data block is returned. E.g., if tt(blockIdx) returns 5, and
        the size of the shared segment data blocks equals 2000, then tt(eos)
        returns 12000 (the first offset of segment 6).

    itb(std::streamsize maxOffset() const)
       The maximum possible offset that can be used for the currently
        monitored tt(FBB::SharedSegment) is returned.

    itb(std::streamsize offset() const)
       The offset within the currently monitored shared memory segment is
        returned.

    itb(void reset(SharedSegment *sharedData))
       The tt(SharedPos) object is reset to monitor the offset of the
        tt(FBB::SharedSegment) object whose address is passed as argument to
        tt(reset). The address must point to a bf(sharedsegment)(3bobcat)
        object that must exist until the end of the bf(SharedPos)
        object's lifetime or until its next tt(reset) call. Immediately after
        calling tt(reset) offset is reset to 0.

    itb(std::streamsize showmanyc() const)
       The number of characters that can be read from the current shared
        segment data block is returned.  This member interrogates the number
        of readable characters in the shared memory segment. This number may
        change while this member is being executed. In order to receive a
        stable return value, calling functions should have obtained a lock on
        the tt(FBB::SharedSegment) data before calling this member. See also
        the bf(sharedsegment)(3bobcat) man-page.

    itb(std::ios::pos_type seek(std::ios::off_type offset,
                                std::ios::seekdir origin = std::ios::beg))
       The monitored offset is changed to this member's tt(offset) argument,
        relative to tt(origin). Seeking beyond tt(eof) is OK. However, -1 is
        returned when seeking beyond tt(maxOffset) or seeking before the
        shared segment's offset 0.
    )

manpagesection(EXAMPLE)
    See the bf(sharedstream)(3bobcat) man page.

manpagefiles()
    em(bobcat/sharedpos) - defines the class interface

manpageseealso()
    bf(bobcat)(7),
        bf(isharedstream)(3bobcat),
        bf(osharedstream)(3bobcat),
        bf(sharedblock)(3bobcat),
        bf(sharedcondition)(3bobcat),
        bf(sharedmemory)(3bobcat),
        bf(sharedmutex)(3bobcat),
        bf(sharedreadme)(7bobcat),
        bf(sharedsegment)(3bobcat),
        bf(sharedstream)(3bobcat),
        bf(sharedbuf)(3bobcat)

manpagebugs()
    None Reported.

includefile(include/trailer)