| 1906 | } |
| 1907 | |
| 1908 | bool AFCKernelModule::ContainerToPBData(std::shared_ptr<AFIContainer> pContainer, AFMsg::pb_container* pb_data) |
| 1909 | { |
| 1910 | ARK_ASSERT_RET_VAL(pContainer != nullptr && pb_data != nullptr, false); |
| 1911 | |
| 1912 | for (auto index = pContainer->First(); index > 0; index = pContainer->Next()) |
| 1913 | { |
| 1914 | auto pEntity = pContainer->Find(index); |
| 1915 | if (nullptr == pEntity) |
| 1916 | { |
| 1917 | continue; |
| 1918 | } |
| 1919 | |
| 1920 | AFMsg::pb_entity pb_entity; |
| 1921 | if (!EntityToPBData(pEntity, &pb_entity)) |
| 1922 | { |
| 1923 | continue; |
| 1924 | } |
| 1925 | |
| 1926 | pb_data->mutable_datas_value()->insert({index, pb_entity}); |
| 1927 | } |
| 1928 | |
| 1929 | return true; |
| 1930 | } |
| 1931 | |
| 1932 | bool AFCKernelModule::RowToPBData(AFIRow* pRow, const uint32_t index, AFMsg::pb_entity_data* pb_data) |
| 1933 | { |