| 96 | } |
| 97 | |
| 98 | bool AFCKernelModule::CopyData(std::shared_ptr<AFIEntity> pEntity, std::shared_ptr<AFIStaticEntity> pStaticEntity) |
| 99 | { |
| 100 | if (pEntity == nullptr || nullptr == pStaticEntity) |
| 101 | { |
| 102 | return false; |
| 103 | } |
| 104 | |
| 105 | // static node manager must be not empty |
| 106 | auto pStaticNodeManager = GetNodeManager(pStaticEntity); |
| 107 | if (pStaticNodeManager == nullptr || pStaticNodeManager->IsEmpty()) |
| 108 | { |
| 109 | return false; |
| 110 | } |
| 111 | |
| 112 | // node manager must be empty |
| 113 | auto pNodeManager = GetNodeManager(pEntity); |
| 114 | if (pNodeManager == nullptr || !pNodeManager->IsEmpty()) |
| 115 | { |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | // copy data |
| 120 | auto& data_list = pStaticNodeManager->GetDataList(); |
| 121 | for (auto& iter : data_list) |
| 122 | { |
| 123 | auto pData = iter.second; |
| 124 | pNodeManager->CreateData(pData); |
| 125 | } |
| 126 | |
| 127 | return true; |
| 128 | } |
| 129 | |
| 130 | std::shared_ptr<AFIEntity> AFCKernelModule::CreateEntity(const AFGUID& self, const int map_id, |
| 131 | const int map_instance_id, const std::string& class_name, const ID_TYPE config_id, const AFIDataList& args) |
nothing calls this directly
no test coverage detected