COP-4338, Programming III Lectures
Note: Links will not be alive until a day or two before class.
- August 30: Administrivia
- Sep 1, Sep 6, Sep 8, Sep 13, Sep 15:
C++ Basics, arrays, strings, files, pointers, reference variables
- Read Chapters 1, 2, 3, and 11.
- Simple C++, and compiling functions
- vector class.
- resizing and push_back
- string class.
- Parameter passing: call by constant reference.
- Pointers
- new and delete
- Reference variables
- C-style arrays and strings
- Sep 20: No class, due to Hurricane Rita
- Sep 22: Invited Lecture
- Sep 27, 29, Oct 4, 6: Classes
- Classes: interfaces, member functions, visibility
- Separation of interface and implementation
- Constructors
- Default parameters
- Accessor/Mutator
- Scope :: operator
- ifndef/endif and separate compilation
- Const and non-const methods
- Implicit type conversions
- Explicit constructors
- Initializer lists
- Static members
- *this
- Operator overloading
- Friends
- The big three: destructor, operator= and copy constructor
- Constant and reference data member
- Linked data structures
- Aliasing and this
- Example: The Rational class
- Reference return types and operator[]
- Example: The String class
- Oct 11 and 13: Inheritance
- Implementing a derived class
- Constructors
- Defaults for the Big Three in the derived class
- Protected members
- Slicing
- Static vs. dynamic binding
- virtual keyword
- The virtual destructor
- Various C++ differences from Java
- Oct 20: Exam #1 C++ up to inheritance
- Oct 25 and 27: Hurricane Wilma
- Nov 1: Templates
- Why templates
- Function templates
- Class templates: interface
- Illustration of the MemoryCell class
- Specifying the requirements of the template type
- Class templates: implementation
- Separate compilation issues
- A Set class (uncommented):
Set.h
Set.cpp
TestSet.cpp
Set_int.cpp
(the last file is for separate compilation of templates).
- An LSet (linked list version) class (uncommented):
LSet.h
LSet.cpp
TestLSet.cpp
LSet_int.cpp
- Function Objects
- Exceptions
- Reference return types
- matrix
- Nov 3 and Nov 8: STL
- Pointer variables and their relation to primitive arrays
- Primitive strings
- STL Basic ideas
- Iterators
- Lists vs Vectors
- The Pair pattern
- Sets and maps
- The concordance example
- String streams
- Nov 10 and 15: Programming in C
- Nov 22: Exam #2: C++ and C... covers everything
- Nov 29, Dec 1: Threads and Synchronization
- PDF slides
- Examples:
- Illustrates basics of getting threads to run:
ThreadDemo.java
- Illustrates threads corrupting data:
NoSync.java
- Series of examples using an Account.
Some threads do deposits, some do withdraws on shared account.
- Two examples with multiple monitors
- Static methods have different monitors than instance methods:
StaticsAndThreads.java
- Dec 6 and 8: Networking
- Dec 13: Threading and Networking Review and Review for Exam
- Dec 15: Exam #3: C/C++, Threading, Networking