|
LLVM 22.0.0git
|
Encapsulate a database file, which: More...
#include "CAS/DatabaseFile.h"
Classes | |
| struct | Header |
Public Member Functions | |
| const Header & | getHeader () |
| MappedFileRegionArena & | getAlloc () |
| MappedFileRegion & | getRegion () |
| Error | addTable (TableHandle Table) |
| Add a table. | |
| std::optional< TableHandle > | findTable (StringRef Name) |
| Find a table. May return null. | |
| size_t | size () const |
Static Public Member Functions | |
| static constexpr uint32_t | getMagic () |
| static constexpr uint32_t | getVersion () |
| static Expected< DatabaseFile > | create (const Twine &Path, uint64_t Capacity, function_ref< Error(DatabaseFile &)> NewDBConstructor) |
| Create the DatabaseFile at Path with Capacity. | |
Encapsulate a database file, which:
Top-level layout:
Definition at line 95 of file DatabaseFile.h.
| Error DatabaseFile::addTable | ( | TableHandle | Table | ) |
Add a table.
This is currently not thread safe and should be called inside NewDBConstructor.
Definition at line 61 of file DatabaseFile.cpp.
References assert(), llvm::createStringError(), llvm::sys::fs::mapped_file_region::data(), llvm::cas::ondisk::TableHandle::getHeader(), llvm::cas::ondisk::TableHandle::getName(), getRegion(), llvm::cas::ondisk::TableHandle::getRegion(), llvm::make_error_code(), and llvm::Error::success().
|
static |
Create the DatabaseFile at Path with Capacity.
Definition at line 36 of file DatabaseFile.cpp.
References llvm::cas::MappedFileRegionArena::create(), llvm::cas::ondisk::createTableConfigError(), getMagic(), and getVersion().
| std::optional< TableHandle > DatabaseFile::findTable | ( | StringRef | Name | ) |
Find a table. May return null.
Definition at line 89 of file DatabaseFile.cpp.
References llvm::cas::ondisk::TableHandle::getName(), and getRegion().
|
inline |
Definition at line 106 of file DatabaseFile.h.
Definition at line 105 of file DatabaseFile.h.
|
inlinestaticconstexpr |
Definition at line 97 of file DatabaseFile.h.
Referenced by create().
|
inline |
Definition at line 107 of file DatabaseFile.h.
Referenced by addTable(), and findTable().
|
inlinestaticconstexpr |
Definition at line 98 of file DatabaseFile.h.
Referenced by create().
|
inline |
Definition at line 121 of file DatabaseFile.h.