MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / DBDataToTable

Method DBDataToTable

src/plugin/kernel/src/AFCKernelModule.cpp:1558–1592  ·  view source on GitHub ↗

pb table to entity table

Source from the content-addressed store, hash-verified

1556
1557// pb table to entity table
1558bool AFCKernelModule::DBDataToTable(
1559 std::shared_ptr<AFIEntity> pEntity, const std::string& name, const AFMsg::pb_db_table& pb_table)
1560{
1561 auto pTable = pEntity->FindTable(name);
1562 ARK_ASSERT_RET_VAL(pTable != nullptr, false);
1563
1564 auto pCTable = dynamic_cast<AFCTable*>(pTable);
1565 ARK_ASSERT_RET_VAL(pCTable != nullptr, false);
1566
1567 for (auto& iter : pb_table.datas_value())
1568 {
1569 auto row_index = iter.first;
1570 if (row_index == NULL_INT)
1571 {
1572 continue;
1573 }
1574
1575 auto& pb_db_entity_data = iter.second;
1576 auto pRow = pCTable->CreateRow(row_index, AFCDataList());
1577 if (pRow == nullptr)
1578 {
1579 continue;
1580 }
1581
1582 auto pNodeManager = GetNodeManager(pRow);
1583 if (pNodeManager == nullptr)
1584 {
1585 continue;
1586 }
1587
1588 DBDataToNode(pNodeManager, pb_db_entity_data);
1589 }
1590
1591 return true;
1592}
1593
1594bool AFCKernelModule::DBDataToContainer(
1595 std::shared_ptr<AFIEntity> pEntity, const std::string& name, const AFMsg::pb_db_container& pb_data)

Callers

nothing calls this directly

Calls 2

CreateRowMethod · 0.80
FindTableMethod · 0.45

Tested by

no test coverage detected