◆ MemMappedBucketEntry() [1/3]
| AssetMap::MemMappedBucketEntry::MemMappedBucketEntry |
( |
uint8_t * |
data, |
|
|
ICompress & |
comp |
|
) |
| |
Constructor to reference available space for writing.
- Parameters
-
| data | A pointer to the location where entry data is to be written. |
| comp | A valid instance of a compressor to compress the data. |
◆ MemMappedBucketEntry() [2/3]
| AssetMap::MemMappedBucketEntry::MemMappedBucketEntry |
( |
uint8_t * |
data, |
|
|
IDecompress & |
decomp |
|
) |
| |
Constructor to reference an existing entry for reading.
- Parameters
-
| data | A pointer to the location where an entry (may) exist. |
| decomp | A valid instance of a decompressor to extract the data. |
◆ MemMappedBucketEntry() [3/3]
| AssetMap::MemMappedBucketEntry::MemMappedBucketEntry |
( |
std::nullptr_t |
| ) |
|
|
explicit |
Constructs an instance not pointing to any data.
- Postcondition
- Calling anything other than the comparison operators results in undefined behaviour.
- Parameters
-
| nullptr_t | requires you to pass nullptr - nothing else is valid |
◆ DecompressedSize()
| lam_size_t AssetMap::MemMappedBucketEntry::DecompressedSize |
( |
| ) |
const |
|
noexcept |
Obtains the size that would be required to fully decompress.
- Returns
- the number of bytes needed to fully decompress the data.
◆ FileSize()
| lam_size_t AssetMap::MemMappedBucketEntry::FileSize |
( |
| ) |
const |
|
noexcept |
Obtains the (compressed) size of this entry's file.
- Returns
- the size of this entry's file.
◆ InMemorySize()
| size_t AssetMap::MemMappedBucketEntry::InMemorySize |
( |
| ) |
const |
|
noexcept |
Obtains the full size (in bytes) of this entry, including padding.
- Returns
- the full size of this entry. Generally used to calculate the appropriate address to store the next entry.
◆ MakeNull()
| size_t AssetMap::MemMappedBucketEntry::MakeNull |
( |
| ) |
|
|
noexcept |
Initializes this entry to a size of zero and an empty name.
- Returns
- The total in-memory size of this entire entry.
◆ Name()
| std::string_view AssetMap::MemMappedBucketEntry::Name |
( |
| ) |
const |
|
noexcept |
Obtains the name of this entry.
- Returns
- the name of this entry.
◆ operator bool()
| AssetMap::MemMappedBucketEntry::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Tests if this entry is valid.
Returns true if this entry points to a valid address and has a non-empty name.
- Returns
- whether or not the instance is valid.
◆ operator!=()
compares this instance to another instance for inequality
Elements compare inequal if operator== would return false.
- Parameters
-
- Returns
- true if the instance are not equivalent.
◆ operator++()
Increments this entry to point to the next entry space.
- Precondition
- This instance must currently have a valid name and size.
- Returns
- a reference to *this.
◆ operator==()
compares this instance to another instance for equality
Elements compare equal if they point to the same location.
- Parameters
-
- Returns
- true if the instances are equivalent.
◆ Populate()
| size_t AssetMap::MemMappedBucketEntry::Populate |
( |
std::string_view |
name, |
|
|
const uint8_t * |
ptr, |
|
|
size_t |
len |
|
) |
| |
|
noexcept |
Initialises this entry by compressing and writing the input data to ptr.
- Precondition
name must not be empty.
- Parameters
-
| name | The name of the file |
| ptr | The source data to compress and write to the file |
| len | The length of the source data (in bytes) |
- Returns
- The total in-memory size of this entire entry.
- See also
- InMemorySize()
◆ Retrieve() [1/2]
| std::pair<std::unique_ptr<uint8_t[]>, size_t> AssetMap::MemMappedBucketEntry::Retrieve |
( |
| ) |
|
Allocates and returns the decompressed data and its size.
- Returns
- a pair containing the data and its size.
◆ Retrieve() [2/2]
| size_t AssetMap::MemMappedBucketEntry::Retrieve |
( |
uint8_t * |
buf, |
|
|
size_t |
len |
|
) |
| |
Decompresses the data into buf up to a limit of len.
- Returns
- the number of bytes written to
buf
The documentation for this class was generated from the following file: