| 39 | } |
| 40 | |
| 41 | void AFNodeManager::InitData(const AFIDataList& args) |
| 42 | { |
| 43 | size_t count = args.GetCount(); |
| 44 | ARK_ASSERT_RET_NONE(count % 2 == 0); |
| 45 | |
| 46 | for (size_t i = 0; i < count; i += 2) |
| 47 | { |
| 48 | auto data_type = args.GetType(i); |
| 49 | auto index = args.UInt(i + 1); |
| 50 | switch (data_type) |
| 51 | { |
| 52 | case ark::ArkDataType::DT_BOOLEAN: |
| 53 | { |
| 54 | AFINode* pNode = FindData(index); |
| 55 | if (pNode != nullptr) |
| 56 | { |
| 57 | pNode->SetBool(args.Bool(i)); |
| 58 | } |
| 59 | } |
| 60 | break; |
| 61 | case ark::ArkDataType::DT_INT32: |
| 62 | { |
| 63 | AFINode* pNode = FindData(index); |
| 64 | if (pNode != nullptr) |
| 65 | { |
| 66 | pNode->SetInt32(args.Int(i)); |
| 67 | } |
| 68 | } |
| 69 | break; |
| 70 | case ark::ArkDataType::DT_UINT32: |
| 71 | { |
| 72 | AFINode* pNode = FindData(index); |
| 73 | if (pNode != nullptr) |
| 74 | { |
| 75 | pNode->SetUInt32(args.UInt(i)); |
| 76 | } |
| 77 | } |
| 78 | break; |
| 79 | case ark::ArkDataType::DT_INT64: |
| 80 | { |
| 81 | AFINode* pNode = FindData(index); |
| 82 | if (pNode != nullptr) |
| 83 | { |
| 84 | pNode->SetInt64(args.Int64(i)); |
| 85 | } |
| 86 | } |
| 87 | break; |
| 88 | case ark::ArkDataType::DT_UINT64: |
| 89 | { |
| 90 | AFINode* pNode = FindData(index); |
| 91 | if (pNode != nullptr) |
| 92 | { |
| 93 | pNode->SetUInt64(args.UInt64(i)); |
| 94 | } |
| 95 | } |
| 96 | break; |
| 97 | case ark::ArkDataType::DT_FLOAT: |
| 98 | { |
nothing calls this directly
no test coverage detected