----------entity to pb client data---------------
| 1811 | |
| 1812 | //----------entity to pb client data--------------- |
| 1813 | bool AFCKernelModule::NodeToPBData(AFINode* pNode, AFMsg::pb_entity_data* pb_data) |
| 1814 | { |
| 1815 | ARK_ASSERT_RET_VAL(pNode != nullptr && pb_data != nullptr, false); |
| 1816 | |
| 1817 | auto index = pNode->GetIndex(); |
| 1818 | switch (pNode->GetType()) |
| 1819 | { |
| 1820 | case ArkDataType::DT_BOOLEAN: |
| 1821 | pb_data->mutable_datas_bool()->insert({index, pNode->GetBool()}); |
| 1822 | break; |
| 1823 | case ArkDataType::DT_INT32: |
| 1824 | pb_data->mutable_datas_int32()->insert({index, pNode->GetInt32()}); |
| 1825 | break; |
| 1826 | case ArkDataType::DT_UINT32: |
| 1827 | pb_data->mutable_datas_uint32()->insert({index, pNode->GetUInt32()}); |
| 1828 | break; |
| 1829 | case ArkDataType::DT_INT64: |
| 1830 | pb_data->mutable_datas_int64()->insert({index, pNode->GetInt64()}); |
| 1831 | break; |
| 1832 | case ArkDataType::DT_UINT64: |
| 1833 | pb_data->mutable_datas_uint64()->insert({index, pNode->GetUInt64()}); |
| 1834 | break; |
| 1835 | case ArkDataType::DT_FLOAT: |
| 1836 | pb_data->mutable_datas_float()->insert({index, pNode->GetFloat()}); |
| 1837 | break; |
| 1838 | case ArkDataType::DT_DOUBLE: |
| 1839 | pb_data->mutable_datas_double()->insert({index, pNode->GetDouble()}); |
| 1840 | break; |
| 1841 | case ArkDataType::DT_STRING: |
| 1842 | pb_data->mutable_datas_string()->insert({index, pNode->GetString()}); |
| 1843 | break; |
| 1844 | default: |
| 1845 | ARK_ASSERT_RET_VAL(0, false); |
| 1846 | break; |
| 1847 | } |
| 1848 | |
| 1849 | return true; |
| 1850 | } |
| 1851 | |
| 1852 | bool AFCKernelModule::NodeToPBData(const uint32_t index, const AFIData& data, AFMsg::pb_entity_data* pb_data) |
| 1853 | { |
nothing calls this directly
no test coverage detected