| 85 | } |
| 86 | |
| 87 | void StorageInterface::asyncOpenTable(std::string_view tableName, |
| 88 | std::function<void(Error::UniquePtr, std::optional<Table>)> callback) |
| 89 | { |
| 90 | asyncGetTableInfo(tableName, [this, callback = std::move(callback)]( |
| 91 | Error::UniquePtr error, TableInfo::ConstPtr tableInfo) { |
| 92 | if (error) |
| 93 | { |
| 94 | callback(std::move(error), std::nullopt); |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | if (tableInfo) |
| 99 | { |
| 100 | callback(nullptr, Table(this, tableInfo)); |
| 101 | } |
| 102 | else |
| 103 | { |
| 104 | callback(nullptr, std::nullopt); |
| 105 | } |
| 106 | }); |
| 107 | } |
| 108 | |
| 109 | void StorageInterface::asyncGetTableInfo( |
| 110 | std::string_view tableName, std::function<void(Error::UniquePtr, TableInfo::ConstPtr)> callback) |