libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
cross-reference.hxx
1#ifndef art__paperback__carousel__cross_reference_hxx_
2#define art__paperback__carousel__cross_reference_hxx_
3
4#include <art/paperback/types.hxx>
5#include <art/paperback/forward.hxx>
6
7#include <art/paperback/carousel/writer.hxx>
8
10{
11
12 /// Implements the COS cross-reference table.
13 ///
15 {
16 public:
17 /// Constructor.
18 ///
20
21 /// Constructor.
22 ///
24
25 /// Constructor.
26 ///
28
29 /// Destructor.
30 ///
31 ~cross_Reference() noexcept;
32
33 /// Get the size of the cross-reference table.
34 ///
35 uint32_t
36 size() const;
37
38 /// Allocate a new object index.
39 ///
41 allocate();
42
43 /// Get the offset of a used entry.
44 ///
45 int64_t
46 get_offset(Identity) const;
47
48 /// Set the offset of a used entry.
49 ///
50 void
51 set_offset(Identity, int64_t);
52
53 /// Get the next available object identity.
54 ///
56 next() const;
57
58 /// Write the cross-reference to an output stream.
59 ///
60 void
61 write(Writer&, bool);
62
63 /// Clears the offsets of used entries.
64 ///
65 void
67
68 /// Assignment.
69 ///
71 operator=(cross_Reference const&);
72
73 /// Assignment.
74 ///
76 operator=(cross_Reference&&);
77
78 private:
79 struct Free_entry;
80 struct Used_entry;
81
82 using Entry = variant<Free_entry, Used_entry>;
83
84 /// Cross-reference table entries.
85 ///
86 map<Identity, Entry> _table;
87
88 };
89
90} // namespace Art::Paperback::Carousel
91
92#endif
Definition writer.hxx:13
Identity allocate()
Allocate a new object index.
Definition cross-reference.cxx:92
map< Identity, Entry > _table
Cross-reference table entries.
Definition cross-reference.hxx:86
int64_t get_offset(Identity) const
Get the offset of a used entry.
Definition cross-reference.cxx:104
void write(Writer &, bool)
Write the cross-reference to an output stream.
Definition cross-reference.cxx:163
uint32_t size() const
Get the size of the cross-reference table.
Definition cross-reference.cxx:75
Identity next() const
Get the next available object identity.
Definition cross-reference.cxx:145
cross_Reference(cross_Reference &&)
Constructor.
void clear_offsets()
Clears the offsets of used entries.
Definition cross-reference.cxx:283
cross_Reference()
Constructor.
Definition cross-reference.cxx:54
~cross_Reference() noexcept
Destructor.
Definition cross-reference.cxx:68
cross_Reference(cross_Reference const &)
Constructor.
void set_offset(Identity, int64_t)
Set the offset of a used entry.
Definition cross-reference.cxx:126
COS file format implementation namespace.
Definition array.cxx:6
Represents a free entry in the cross-reference table.
Definition cross-reference.cxx:14
Represents a used entry in the cross-reference table.
Definition cross-reference.cxx:32
Represents the identity of an indirect object.
Definition types.hxx:81