| 1257 | // Get the value of an object |
| 1258 | ExpressionValue ObjectModel::GetObjectValueUsingTableNumber(ObjectExplorationContext& context, const ObjectModelClassDescriptor * null classDescriptor, const char *_ecv_array idString, uint8_t tableNumber) const THROWS(GCodeException) |
| 1259 | decrease(strlen(idString)) // recursion variant |
| 1260 | { |
| 1261 | if (classDescriptor == nullptr) |
| 1262 | { |
| 1263 | classDescriptor = GetObjectModelClassDescriptor(); |
| 1264 | } |
| 1265 | |
| 1266 | // Loop through this class and its ancestors |
| 1267 | while (classDescriptor != nullptr) |
| 1268 | { |
| 1269 | const ObjectModelTableEntry *_ecv_null const e = FindObjectModelTableEntry(classDescriptor, tableNumber, idString); |
| 1270 | if (e != nullptr) |
| 1271 | { |
| 1272 | if (e->IsObsolete()) |
| 1273 | { |
| 1274 | context.SetObsoleteFieldQueried(); |
| 1275 | } |
| 1276 | idString = GetNextElement(idString); |
| 1277 | const ExpressionValue val = e->func(this, context); |
| 1278 | context.CheckStack(StackUsage::GetObjectValue_noTable); |
| 1279 | ReadLocker lock(GetObjectLock(tableNumber)); |
| 1280 | return GetObjectValue(context, classDescriptor, val, idString); |
| 1281 | } |
| 1282 | if (tableNumber != 0) |
| 1283 | { |
| 1284 | break; |
| 1285 | } |
| 1286 | classDescriptor = classDescriptor->parent; // search parent class object model too |
| 1287 | } |
| 1288 | |
| 1289 | if (context.WantExists()) |
| 1290 | { |
| 1291 | return ExpressionValue(false); |
| 1292 | } |
| 1293 | |
| 1294 | throw context.ConstructParseException("unknown value '%s'", idString); |
| 1295 | } |
| 1296 | |
| 1297 | ExpressionValue ObjectModel::GetObjectValue(ObjectExplorationContext& context, const ObjectModelClassDescriptor *classDescriptor, const ExpressionValue& val, const char *_ecv_array idString) const THROWS(GCodeException) |
| 1298 | decrease(strlen(idString)) // recursion variant |
no test coverage detected