Announcement • Final exam Final Exam Review – Tuesday, May 20 th – 2:45 – 4:45pm – Rm 70-1620 • No makeup exams! Plan for today UML • Everything we learned • Use Case Diagram – Shows scenerios of external interaction with system – In less than 50 minutes! • Sequence Diagrams – Show sequence of method calls for a given use case • Course Evaluations • Class Diagram – Shows classes that make up your system and relationships between them C++ Intro C++ Tour 1 • Variables: • C++ is superset of C – Basic – Designed for memory manipulation – Pointer • Source + Header file – Reference • Compilation & Linking – Interesting operators • & address of • * dereference • -> dereference / access member
C++ Tour 2 Operators • static • Can redefine basic operators on classes • Const – Including the assignment operator – operator# • Functions – Pass by value • Friends • Arrays – Almost equivalent to pointer – New / delete / delete [] Constructors/Destructors Inheritance I • Default constructor • Basic Concepts, Terms, Syntax • Copy constructor • Polymorphism – If you do non-trivial work in constructor • Virtual functions • Should have copy constructor and operator= • Difference between copy & operator= • Abstract functions / classes • Initializer List • Base class in Initializer list (no super) – Preferred way of doing things – Sometimes the ONLY way – Order of initialization • Destructors – If you new, you must delete Inheritance II The we hade Exam 1 • Memory Layout of derived class – Why you must call constructor of base class first • Polymorphism / Slicing
Memory Management Memory Management • How/where data is stored • Memory Woes – Global / Heap / Stack / Code – Memory Leaks • Runtime Stack – Pointer Ownership – Dangling Reference – Stack frame removed when function is done – Overwriting Arrays • Heap – Reference to local variable – new – delete Memory Management IOStreams • Smart Pointers • Formatted vs Unformatted I/O – Takes ownership of pointer • Error states and format flags – auto_ptr • Insertion and Extraction – Smart pointers and STL containers – Manipulators – Override operator= and operator-> IOStreams Software Testing • Error / Fault / Failure • Unit / Integration / System Test • Preconditions / Postconditions • White Box / Black Box Testing • Equivalence Classes • Assertions
Templates Then we had exam 2 • Defining / using templates • Standard Template Library (STL) – Containers – Iterators – Algorithms – Functions Exceptions Exceptions • Throw • Error conditions • Try / catch – Unexpected exception – Uncaught exception – Exception hierarchies • Exceptions and Memory Management – (…) – Stack unwinding • Exceptions vs Assertions • Exception specification – Not required but guarantee if there Function Pointers Ethics • Syntax • Code of ethics • Declaration and Assignment • Free Software – Signature must be the same! • Open Source • Functors • GNU Public License. – Overrides the operator() – Can have state and extra methods
And there you have it! Finally • Any questions? • Course Evaluations. • Thanks to all…
Recommend
More recommend