MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / THROWS

Function THROWS

src/ObjectModel/ObjectModel.h:374–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372// This saves about 240 bytes of stack space but costs 272 bytes of flash memory.
373inline void ObjectModel::ReportItemAsJson(OutputBuffer *buf, ObjectExplorationContext& context, const ObjectModelClassDescriptor *_ecv_null classDescriptor,
374 const ExpressionValue& val, const char *_ecv_array filter) const THROWS(GCodeException)
375{
376 if (context.WantArrayLength() && *filter == 0)
377 {
378 ReportArrayLengthAsJson(buf, context, val);
379 }
380 else if (val.GetType() == TypeCode::ObjectModel_tc)
381 {
382 if ( (*filter != '.' && *filter != 0) // we should have reached the end of the filter or a '.', error if not
383 || val.omVal == nullptr // OM arrays may contain null entries, so we need to handle them here
384 )
385 {
386 buf->cat("null");
387 }
388 else
389 {
390 if (*filter == '.')
391 {
392 ++filter;
393 }
394 not_null(val.omVal)->ReportAsJson(buf, context, (val.omVal == this) ? classDescriptor : nullptr, val.param, filter);
395 }
396 }
397 else
398 {
399 ReportItemAsJsonFull(buf, context, classDescriptor, val, filter);
400 }
401}
402
403// Function used for compile-time check for the correct number of entries in an object model table
404static inline constexpr size_t ArraySum(const uint8_t *_ecv_array arr, size_t numEntries) noexcept

Callers

nothing calls this directly

Calls 3

WantArrayLengthMethod · 0.80
catMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected