MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetFieldInfo

Method GetFieldInfo

lib/base/type.cpp:240–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240Field TypeType::GetFieldInfo(int id) const
241{
242 int real_id = id - GetBaseType()->GetFieldCount();
243 if (real_id < 0)
244 return GetBaseType()->GetFieldInfo(id);
245
246 if (real_id == 0)
247 return {0, "String", "name", "", nullptr, 0, 0};
248 else if (real_id == 1)
249 return Field(1, "Object", "prototype", "", nullptr, 0, 0);
250 else if (real_id == 2)
251 return Field(2, "Type", "base", "", nullptr, 0, 0);
252
253 throw std::runtime_error("Invalid field ID.");
254}
255
256int TypeType::GetFieldCount() const
257{

Callers 13

AddSuggestionsFunction · 0.45
EvaluateFilterMethod · 0.45
SerializeObjectAttrsMethod · 0.45
HandleRequestMethod · 0.45
HandleRequestMethod · 0.45
CreateObjectConfigMethod · 0.45
SerializeObjectFunction · 0.45
DeserializeObjectFunction · 0.45
GetFieldByNameMethod · 0.45
SetFieldByNameMethod · 0.45
ModifyAttributeMethod · 0.45

Calls 2

FieldClass · 0.70
GetFieldCountMethod · 0.45

Tested by

no test coverage detected