data operation
| 134 | |
| 135 | // data operation |
| 136 | AFINode* AFNodeManager::CreateData(std::shared_ptr<AFNodeMeta> pDataMeta) |
| 137 | { |
| 138 | ARK_ASSERT_RET_VAL(pDataMeta != nullptr, nullptr); |
| 139 | |
| 140 | // has exist |
| 141 | auto index = pDataMeta->GetIndex(); |
| 142 | ARK_ASSERT_RET_VAL(index > 0, nullptr); |
| 143 | ARK_ASSERT_RET_VAL(data_list_.find_value(index) == nullptr, nullptr); |
| 144 | |
| 145 | auto pData = CreateDataByMeta(pDataMeta); |
| 146 | ARK_ASSERT_RET_VAL(pData != nullptr, nullptr); |
| 147 | |
| 148 | if (!data_list_.insert(index, pData).second) |
| 149 | { |
| 150 | ARK_DELETE(pData); |
| 151 | return nullptr; |
| 152 | } |
| 153 | |
| 154 | return pData; |
| 155 | } |
| 156 | |
| 157 | // this is only called when create new entity so do no need check whether node exist |
| 158 | bool AFNodeManager::CreateData(AFINode* pData) |
no test coverage detected