MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / OnSyncTableDelete

Method OnSyncTableDelete

src/plugin/kernel/src/AFCKernelModule.cpp:839–870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839int AFCKernelModule::OnSyncTableDelete(const AFGUID& self, const TABLE_EVENT_DATA& event, const ArkDataMask mask_value)
840{
841 // find parent entity
842 auto pEntity = GetEntity(self);
843 if (pEntity == nullptr)
844 {
845 ARK_LOG_ERROR("sync table failed entity do no exist, self={}", self);
846 return -1;
847 }
848
849 AFMsg::pb_entity_table_delete pb_data;
850 auto entity_id = self;
851 auto pb_entity = pb_data.mutable_data();
852
853 auto pParentContainer = pEntity->GetParentContainer();
854 if (pParentContainer != nullptr)
855 {
856 if (!TryAddContainerPBEntity(pParentContainer, self, *pb_data.mutable_data(), entity_id, pb_entity))
857 {
858 ARK_LOG_ERROR("sync node failed container entity do no exist, self={}", self);
859 return -1;
860 }
861 }
862
863 AFMsg::pb_entity_data pb_row;
864 AFMsg::pb_table pb_table;
865 pb_table.mutable_datas_value()->insert({event.row_, pb_row});
866 pb_entity->mutable_datas_table()->insert({event.table_index_, pb_table});
867
868 SendSyncMsg(entity_id, mask_value, pb_data);
869 return 0;
870}
871
872int AFCKernelModule::OnSyncTableUpdate(
873 const AFGUID& self, const TABLE_EVENT_DATA& event, const ArkDataMask mask_value, const AFIData& data)

Callers

nothing calls this directly

Calls 2

GetParentContainerMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected