| 2070 | } |
| 2071 | |
| 2072 | bool AFCKernelModule::EntityTableToPBData( |
| 2073 | std::shared_ptr<AFIEntity> pEntity, AFMsg::pb_entity_data* pb_data, const ArkMaskType mask /* = 0*/) |
| 2074 | { |
| 2075 | ARK_ASSERT_RET_VAL(pEntity != nullptr && pb_data != nullptr, false); |
| 2076 | |
| 2077 | auto pTableManager = GetTableManager(pEntity); |
| 2078 | ARK_ASSERT_RET_VAL(pTableManager != nullptr, false); |
| 2079 | |
| 2080 | auto& data_list = pTableManager->GetTableList(); |
| 2081 | for (auto& iter : data_list) |
| 2082 | { |
| 2083 | auto pTable = iter.second; |
| 2084 | if (!pTable) |
| 2085 | { |
| 2086 | continue; |
| 2087 | } |
| 2088 | |
| 2089 | if (!mask.none()) |
| 2090 | { |
| 2091 | auto result = (pTable->GetMask() & mask); |
| 2092 | if (!result.any()) |
| 2093 | { |
| 2094 | continue; |
| 2095 | } |
| 2096 | } |
| 2097 | |
| 2098 | const auto index = pTable->GetIndex(); |
| 2099 | |
| 2100 | AFMsg::pb_table table_data; |
| 2101 | if (!TableToPBData(pTable, index, &table_data)) |
| 2102 | { |
| 2103 | continue; |
| 2104 | } |
| 2105 | |
| 2106 | pb_data->mutable_datas_table()->insert({index, table_data}); |
| 2107 | } |
| 2108 | |
| 2109 | return true; |
| 2110 | } |
| 2111 | |
| 2112 | // -----------get entity manager-------------- |
| 2113 | std::shared_ptr<AFNodeManager> AFCKernelModule::GetNodeManager(std::shared_ptr<AFIStaticEntity> pStaticEntity) const |
no test coverage detected