MCPcopy Create free account
hub / github.com/OAID/Tengine / NodeAddParamGeneric

Function NodeAddParamGeneric

core/lib/node.cpp:135–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133/* code for attr get/set/add */
134
135int NodeAddParamGeneric(void* node, const char* param_name, const char* type_name, int param_size)
136{
137 Node* real_node = ( Node* )node;
138
139 if(!real_node->ExistAttr(ATTR_CUSTOM_ATTR))
140 {
141 node_custom_attr_map_t dummy_map;
142 real_node->SetAttr(ATTR_CUSTOM_ATTR, dummy_map);
143 }
144
145 node_custom_attr_map_t* attr_map = any_cast<node_custom_attr_map_t>(&real_node->GetAttr(ATTR_CUSTOM_ATTR));
146
147 assert(attr_map->count(param_name) == 0);
148
149 CustomNodeAttr attr_entry;
150
151 attr_entry.type_name = type_name;
152 attr_entry.attr_size = param_size;
153
154 (*attr_map)[param_name] = attr_entry;
155
156 return 0;
157}
158
159int NodeGetParamGeneric(void* node, const char* param_name, const char* type_name, void* param_val, int size)
160{

Callers 2

node_add_attrFunction · 0.85
LoadNodeMethod · 0.85

Calls 3

ExistAttrMethod · 0.45
SetAttrMethod · 0.45
GetAttrMethod · 0.45

Tested by

no test coverage detected