|
pstore2
|
The data store file header. More...
#include <file_header.hpp>

Classes | |
| struct | body |
| Represents the portion of the header structure which is covered by the computed CRC value. More... | |
Public Member Functions | |
| bool | is_valid () const noexcept |
| std::uint32_t | get_crc () const noexcept |
| Computes the CRC value for the header. | |
| uuid | id () const noexcept |
| Returns the database ID. More... | |
| void | set_id (uuid const &id) noexcept |
| std::array< std::uint16_t, 2 > const & | version () const noexcept |
| Returns the file format version number (major, minor). | |
Public Attributes | |
| body | a |
| std::uint32_t | crc = 0 |
| The fields of the header, up to and including this one, are not modified as the code interacts with the data store; they're effectively read-only. More... | |
| std::uint32_t | unused1 = 0 |
| std::atomic< typed_address< trailer > > | footer_pos |
| The file offset of the current (most recent) file footer. More... | |
The data store file header.
|
inlinenoexcept |
Returns the database ID.
When created, each pstore file has a unique ID number. It is preserved by import/export and strip/merge. External references may use this ID to check that they are referring to the correct database.
| std::uint32_t pstore::header::crc = 0 |
The fields of the header, up to and including this one, are not modified as the code interacts with the data store; they're effectively read-only.
Unfortunately, we can't make them physically read-only – for example by marking the containing memory page as read-only – because the library does need to be able to modify the footer_pos field when a transaction is committed.
This crc is used to ensure that the fields from #signature1 to #sync_name are not modified.
| std::atomic<typed_address<trailer> > pstore::header::footer_pos |
The file offset of the current (most recent) file footer.
This value is modified as the the very last step of commiting a transaction.
1.8.13