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

Method CreateData

src/plugin/kernel/src/AFNodeManager.cpp:136–155  ·  view source on GitHub ↗

data operation

Source from the content-addressed store, hash-verified

134
135// data operation
136AFINode* 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
158bool AFNodeManager::CreateData(AFINode* pData)

Callers 3

LoadConfigMethod · 0.80
CopyDataMethod · 0.80
DBDataToNodeMethod · 0.80

Calls 5

CreateDataByMetaFunction · 0.85
GetIndexMethod · 0.45
find_valueMethod · 0.45
insertMethod · 0.45
CopyFromMethod · 0.45

Tested by

no test coverage detected