MCPcopy Create free account
hub / github.com/FISCO-BCOS/FISCO-BCOS / asyncOpenTable

Method asyncOpenTable

bcos-table/src/StorageInterface.cpp:87–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void 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
109void StorageInterface::asyncGetTableInfo(
110 std::string_view tableName, std::function<void(Error::UniquePtr, TableInfo::ConstPtr)> callback)

Calls 1

TableClass · 0.50

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36