| 608 | } |
| 609 | |
| 610 | int AFCKernelModule::OnSyncNode( |
| 611 | const AFGUID& self, const uint32_t index, const ArkDataMask mask_value, const AFIData& data) |
| 612 | { |
| 613 | // find parent entity |
| 614 | auto pEntity = GetEntity(self); |
| 615 | if (pEntity == nullptr) |
| 616 | { |
| 617 | ARK_LOG_ERROR("sync node failed entity do no exist, self={}", self); |
| 618 | return -1; |
| 619 | } |
| 620 | |
| 621 | AFMsg::pb_entity pb_data; |
| 622 | auto entity_id = self; |
| 623 | auto pb_entity = pb_data.mutable_data(); |
| 624 | |
| 625 | auto pParentContainer = pEntity->GetParentContainer(); |
| 626 | if (pParentContainer != nullptr) |
| 627 | { |
| 628 | if (!TryAddContainerPBEntity(pParentContainer, self, *pb_data.mutable_data(), entity_id, pb_entity)) |
| 629 | { |
| 630 | ARK_LOG_ERROR("sync node failed container entity do no exist, self={}", self); |
| 631 | return -1; |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | if (!NodeToPBData(index, data, pb_entity)) |
| 636 | { |
| 637 | ARK_LOG_ERROR("node to pb failed, self={}, index={}", self, index); |
| 638 | return -1; |
| 639 | } |
| 640 | |
| 641 | pb_data.set_id(entity_id); |
| 642 | if (SendSyncMsg(entity_id, mask_value, pb_data) < 0) |
| 643 | { |
| 644 | ARK_LOG_ERROR("send sync msg failed, self={}, index={}", entity_id, index); |
| 645 | return -1; |
| 646 | } |
| 647 | |
| 648 | return 0; |
| 649 | } |
| 650 | |
| 651 | int AFCKernelModule::OnSyncTable( |
| 652 | const AFGUID& self, const TABLE_EVENT_DATA& event, const ArkDataMask mask_value, const AFIData& data) |
nothing calls this directly
no test coverage detected