MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / getNextBox

Method getNextBox

Examples/Modules/Chapter 12/Ex12_17/Truckload.cpp:56–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56SharedBox Truckload::getNextBox()
57{
58 if (!m_current) // If there's no current...
59 return getFirstBox(); // ...return the 1st Box
60
61 m_current = m_current->getNext(); // Move to the next package
62
63 return m_current? m_current->getBox() : nullptr; // Return its box (or nullptr...).
64}
65
66void Truckload::addBox(SharedBox box)
67{

Callers 1

mainFunction · 0.45

Calls 2

getNextMethod · 0.45
getBoxMethod · 0.45

Tested by

no test coverage detected