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

Method getNextBox

Examples/Modules/Chapter 12/Ex12_18/Truckload.cpp:55–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected