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

Method NodeToDBData

src/plugin/kernel/src/AFCKernelModule.cpp:1747–1784  ·  view source on GitHub ↗

-----------------------------

Source from the content-addressed store, hash-verified

1745
1746//-----------------------------
1747bool AFCKernelModule::NodeToDBData(AFINode* pNode, AFMsg::pb_db_entity_data& pb_data)
1748{
1749 ARK_ASSERT_RET_VAL(pNode != nullptr, false);
1750
1751 auto& name = pNode->GetName();
1752 switch (pNode->GetType())
1753 {
1754 case ArkDataType::DT_BOOLEAN:
1755 pb_data.mutable_datas_bool()->insert({name, pNode->GetBool()});
1756 break;
1757 case ArkDataType::DT_INT32:
1758 pb_data.mutable_datas_int32()->insert({name, pNode->GetInt32()});
1759 break;
1760 case ArkDataType::DT_UINT32:
1761 pb_data.mutable_datas_uint32()->insert({name, pNode->GetUInt32()});
1762 break;
1763 case ArkDataType::DT_INT64:
1764 pb_data.mutable_datas_int64()->insert({name, pNode->GetInt64()});
1765 break;
1766 case ArkDataType::DT_UINT64:
1767 pb_data.mutable_datas_uint64()->insert({name, pNode->GetUInt64()});
1768 break;
1769 case ArkDataType::DT_FLOAT:
1770 pb_data.mutable_datas_float()->insert({name, pNode->GetFloat()});
1771 break;
1772 case ArkDataType::DT_DOUBLE:
1773 pb_data.mutable_datas_double()->insert({name, pNode->GetDouble()});
1774 break;
1775 case ArkDataType::DT_STRING:
1776 pb_data.mutable_datas_string()->insert({name, pNode->GetString()});
1777 break;
1778 default:
1779 ARK_ASSERT_RET_VAL(0, false);
1780 break;
1781 }
1782
1783 return true;
1784}
1785
1786bool AFCKernelModule::TableToDBData(AFITable* pTable, AFMsg::pb_db_table& pb_data)
1787{

Callers

nothing calls this directly

Calls 10

GetTypeMethod · 0.45
insertMethod · 0.45
GetBoolMethod · 0.45
GetInt32Method · 0.45
GetUInt32Method · 0.45
GetInt64Method · 0.45
GetUInt64Method · 0.45
GetFloatMethod · 0.45
GetDoubleMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected