pb table to entity table
| 1556 | |
| 1557 | // pb table to entity table |
| 1558 | bool 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 | |
| 1594 | bool AFCKernelModule::DBDataToContainer( |
| 1595 | std::shared_ptr<AFIEntity> pEntity, const std::string& name, const AFMsg::pb_db_container& pb_data) |