◆ MemMappedArchive() [1/2]
Constructs a MemMappedArchive for reading from an archive You should construct a separate instance of this class along with a separate IDecompress for each thread.
- Postcondition
- Anything that causes a change to the archive may result in undefined behaviour. This should usually fail at the point of trying to write to the IMemMapper as it should have been opened in read-only mode.
- Parameters
-
| file | an instance of an existing, readable IMemMapper instance consisting of an entire complete archive. |
| comp | an instance of the compatible decompressor for the implementation used to compress the instance |
| hasher | an instance of the hash implementation used to create the archive. |
◆ MemMappedArchive() [2/2]
| AssetMap::MemMappedArchive::MemMappedArchive |
( |
const std::filesystem::directory_entry & |
ent, |
|
|
const IHasher & |
hasher, |
|
|
IMemMapper & |
file, |
|
|
ICompress & |
comp, |
|
|
IDecompress * |
decomp = nullptr |
|
) |
| |
Constructs an instance for creating (optionally, reading) an archive.
- Postcondition
- If no decompressor or a decompressor incompatible with the compressor is provided, the behaviour of any archive read functions is undefined. All interface refs must remain valid for the duration of this instance's lifetime and any objects retrieved through this instance.
file will be altered. Existing data will be destroyed.
- Parameters
-
| ent | A directory which will be recursed to create the archive. |
| hasher | A hasher which will be used to determine bucketing. |
| file | An IMemMapper which can (and will) be resized. |
| comp | An implementation used to compress files. |
| decomp | An optional decompressor should you wish to immediately read data back. |
◆ begin()
| Iterator AssetMap::MemMappedArchive::begin |
( |
| ) |
const |
|
noexcept |
Obtains an iterator to the first bucket in the archive.
- Returns
- Iterator to the first bucket. Will compare equal to end() if no buckets are present.
◆ BucketCount()
| lam_size_t AssetMap::MemMappedArchive::BucketCount |
( |
| ) |
const |
|
noexcept |
Obtains the total number of buckets in the archive.
- Returns
- The number of buckets in the archive.
◆ DictionarySize()
| lam_size_t AssetMap::MemMappedArchive::DictionarySize |
( |
| ) |
const |
|
noexcept |
Obtains the size (in bytes) of the ICompressor's dictionary.
- Returns
- The size of the dictionary or 0 if no dictionary is in use. A 0-size dictionary should never be present, but it will also return 0 in such a situation.
◆ EmptyBuckets()
| lam_size_t AssetMap::MemMappedArchive::EmptyBuckets |
( |
| ) |
const |
|
noexcept |
Obtains the number of empty (unused) buckets in the archive.
- Returns
- the number of empty (unused) buckets.
◆ end()
| Iterator AssetMap::MemMappedArchive::end |
( |
| ) |
const |
|
noexcept |
Obtains an iterator to one-past-the-end as for C++ iterators.
- Returns
- The one-past-the-end iterator.
◆ operator[]() [1/2]
| MemMappedBucket AssetMap::MemMappedArchive::operator[] |
( |
lam_size_t |
idx | ) |
const |
|
noexcept |
Obtains the bucket for the given index.
- Precondition
idx must be in the range 0 <= idx < BucketCount(). If there are no buckets, the behaviour is undefined.
- Parameters
-
| idx | The bucket index to retrieve. |
- Returns
- A bucket object
◆ operator[]() [2/2]
Obtains the entry matching the specified name.
- Precondition
- the instance must have been constructed with a valid and compatible IDecompress, IHasher and IMemMapper.
- Postcondition
- If the entry does not exist, the implementation may return either an object explicitly convertible to
bool false or a valid object with a non-matching name. You must test both cases if you do not know in advance that the entry exists.
- Parameters
-
| name | The name of the item to retrieve |
- Returns
- a MemMappedBucketEntry object.
The documentation for this class was generated from the following file: