File: insert.cc

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 (30 lines) | stat: -rw-r--r-- 914 bytes parent folder | download | duplicates (6)
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
#include "sharedsegment.ih"

ostream &SharedSegment::insert(ostream &out) const
{
    out << "Access mode: 0" << oct << d_access << dec << "\n"
            "Information readable until offset " << d_nReadable << "\n"
            "Size of the data segments: " << d_segmentSize << " bytes\n" <<
            d_nBlocks << " data segments may be defined, "
                "with a total capacity of " <<
                static_cast<double>(d_segmentSize) * d_nBlocks / 1024 << "kB";

    bool firstBlock = true;

    for (size_t idx = 0; idx != d_nBlocks; ++idx)
    {
        if (d_block[idx].id() != -1)
        {
            if (firstBlock)
            {
                firstBlock = false;
                out << "\n"
                       "ID(s) of data segments:";
            }
            out << "\n"
                   "    at idx " << idx << ": id = " << d_block[idx].id();
        }
    }

    return out;
}