| 1999 | } |
| 2000 | |
| 2001 | bool AFCKernelModule::EntityContainerToPBData( |
| 2002 | std::shared_ptr<AFIEntity> pEntity, AFMsg::pb_entity_data* pb_data, const ArkMaskType mask) |
| 2003 | { |
| 2004 | ARK_ASSERT_RET_VAL(pEntity != nullptr && pb_data != nullptr, false); |
| 2005 | |
| 2006 | auto pContainerManager = GetContainerManager(pEntity); |
| 2007 | ARK_ASSERT_RET_VAL(pContainerManager != nullptr, false); |
| 2008 | |
| 2009 | auto& container_list = pContainerManager->GetContainerList(); |
| 2010 | for (auto& iter : container_list) |
| 2011 | { |
| 2012 | auto pContainer = iter.second; |
| 2013 | if (!pContainer) |
| 2014 | { |
| 2015 | continue; |
| 2016 | } |
| 2017 | |
| 2018 | if (!mask.none()) |
| 2019 | { |
| 2020 | auto result = (pContainer->GetMask() & mask); |
| 2021 | if (!result.any()) |
| 2022 | { |
| 2023 | continue; |
| 2024 | } |
| 2025 | } |
| 2026 | |
| 2027 | AFMsg::pb_container pb_container; |
| 2028 | if (!ContainerToPBData(pContainer, &pb_container)) |
| 2029 | { |
| 2030 | continue; |
| 2031 | } |
| 2032 | |
| 2033 | pb_data->mutable_datas_container()->insert({iter.first, pb_container}); |
| 2034 | } |
| 2035 | |
| 2036 | return true; |
| 2037 | } |
| 2038 | |
| 2039 | //node all to pb data |
| 2040 | bool AFCKernelModule::EntityNodeToPBData( |