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

Method getNextBox

Examples/NoModules/Chapter 12/Ex12_18/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->m_next; // Move to the next package
62
63 return m_current? m_current->m_box : nullptr; // Return its box (or nullptr...).
64}
65
66void Truckload::addBox(SharedBox box)
67{

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected