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

Method GetStackDepth

src/GCodes/GCodeBuffer/GCodeBuffer.cpp:1010–1018  ·  view source on GitHub ↗

Return the current stack depth

Source from the content-addressed store, hash-verified

1008
1009// Return the current stack depth
1010unsigned int GCodeBuffer::GetStackDepth() const noexcept
1011{
1012 unsigned int depth = 0;
1013 for (const GCodeMachineState *_ecv_null m1 = machineState; m1->GetPrevious() != nullptr; m1 = m1->GetPrevious())
1014 {
1015 ++depth;
1016 }
1017 return depth;
1018}
1019
1020// Push state returning true if successful (i.e. stack not overflowed)
1021bool GCodeBuffer::PushState(bool withinSameFile) noexcept

Callers 2

GCodeBuffer.cppFile · 0.80
IsLaterThanMethod · 0.80

Calls 1

GetPreviousMethod · 0.45

Tested by

no test coverage detected