#include <FileNameRepo.h>
The FileNameRepo class is used as a central mapping between string filenames and unique numerical ids for efficient filename storage.
◆ ConstFileNames
The ConstFileNames are reserved file ids for internal usage.
Enumerator |
---|
TMPObjectName | |
ProjectionFileName | |
ValidFileNameStart | |
◆ addFile()
FILEID FileNameRepo::addFile |
( |
const std::string & |
file | ) |
|
Adds a (new) file to he file->ID mappings. If the file was already mapped, the same id is returned as previously.
- Parameters
-
- Returns
- the mapped file ID
◆ getFile()
std::string FileNameRepo::getFile |
( |
FILEID |
id | ) |
|
Retrieves a file path previously mapped to an ID.
If a reserved id is given, a string representation of this reserved keyword is returned. If the id does not exist an emtpy string is returned.
- Parameters
-
id | The id to translate into a file path |
- Returns
- the translated file path
◆ getFiles()
std::vector< std::string > FileNameRepo::getFiles |
( |
const std::unordered_set< FILEID > & |
ids | ) |
|
Retrieves multiple file paths previously mapped to IDs.
If a reserved id is given, a string representation of this reserved keyword is returned. If the id does not exist an emtpy string is returned.
- Parameters
-
ids | The ids to translate into a file path |
- Returns
- the translated file paths
◆ getNextID()
FILEID FileNameRepo::getNextID |
( |
| ) |
|
|
protected |
◆ validFile()
static constexpr bool FileNameRepo::validFile |
( |
FILEID |
id | ) |
|
|
inlinestaticconstexpr |
Checks if the given id is in a valid range.
- Parameters
-
- Returns
- True if the id should point to a file.
◆ currID
FILEID FileNameRepo::currID = 1 |
|
protected |
◆ file_id
std::unordered_map<std::string, FILEID> FileNameRepo::file_id |
|
protected |
◆ id_file
std::unordered_map<FILEID, std::string> FileNameRepo::id_file |
|
protected |
◆ mut
std::mutex FileNameRepo::mut |
|
protected |
The documentation for this class was generated from the following files:
- /home/nico/joda_tmp/tmp-joda-dirs/JODA-gh/libs/joda/core/modules/misc/include/joda/misc/FileNameRepo.h
- /home/nico/joda_tmp/tmp-joda-dirs/JODA-gh/libs/joda/core/modules/misc/src/FileNameRepo.cpp