003-Folien: Standard Template Library und Templates
003-Folien: Standard Template Library und Templates
003-Folien: Standard Template Library und Templates
Erfolgreiche ePaper selbst erstellen
Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.
Automaton: TransitionTable<br />
• Modifikation Automaton.h<br />
#include <br />
class Automaton {<br />
list tt;<br />
Automaton(const State& startState);<br />
void add(const Transition& t);<br />
• Modifikation Implementierung<br />
Automaton::add(const Transition& t) {<br />
tt.push_back(&t); }<br />
Automaton::run() { // [...]<br />
for (const Transition* pt : tt) {<br />
if ( &(pt->start) == pCurrentState ) {<br />
Referenz wird wie<br />
Variable behandelt,<br />
deshalb Adresse<br />
bestimmen<br />
push_back: Element<br />
an Container<br />
anhängen<br />
Über alle Elemente<br />
der Liste<br />
24.04.2013 MRT2 (c) 2013, UR Folie 12