Synopsis:
Today we focus on help for Project #1 and then implementing Abstract Data Types using the C++ Programming Language.
Glossary of Terms
-
Abstract Data Type (ADT):
An abstract Data Type is a user defined class that is used to create instances behaving very like built-in primitive types. That means that instances can be created in static, stack, or heap memory, copied and assigned, and destroyed when the thread of program execution leaves the scope in which the ADT instance was declared. They can be passed to functions by value or by reference, and arrays of instances can be created with the same syntax used for primitive types.
Lecture Content:
-
Help with Projects:
-
Project #1
Single-user Test Harness. When starting an implementation you think about:- Tasks
- Processing flow
- Communication
- Sharing
-
Project #2
Local Test Harness -
Project #3
Server Process Pools -
Project #4
Remote Multi-User Test Harness
-
Project #1
-
Synchronous Discussion:
- Look carefully at the ADT presentation. Be prepared to discuss differences between copy and move construction.
-
Abstract Data Types:
Abstract Data Types Presentation, pptx
What does it take to make objects of your class behave like built in types? STR class
This is the code used as the primary example in the presentation, above. It is a good example of an ADT. However, you should prefer the std::string class for all your development work. C++ Operators pptx vector3D
An example of an Abstract Data Type that is rich in operators. Shows the accepted style for building ADT classes with mathematical operations. Design Principles
Principles that guide Object Oriented Design. -
Looking ahead, getting to know templates:
Quick overview Templates Presentation, pptx
Templates are one of the terrific features of the C++ language. Almost all of the Standard Template Library (STL) is implemented with templates, and they are very useful in day-to-day programming. fully functional C++ Properties, courtesy of templates
This project demonstrates how easy it is to extend the C++ language. C++ doesn't natively support properties but it's not hard to provide them. First template demo
Provides a simple type to string conversion facility. Template Code Examples
Basic and some more advanced template examples. STL Container examples
This code contains a simple example of the new Variadic Template functionality in the "inserter" project. Survey of STL Container Classes
Simple demos of almost all of the STL containers. STL Template-based Functors and Algorithms
Another set of template code examples, including functors, algorithms, and several other things you need to know. Functor examples Excellent template Q&A
This is a good place to find information to supplement class texts and notes. -
Lecture Take-away:
The most important things covered today were:- Discussion about getting started with Project #1
Next week, in Wk 3a, we will begin discussing C++ Templates, using the resources listed above, so please review this weekend.
- Both Workflowy and gliffy are Google tools, available without charge, from Google play store. It works best to install them from the chrome browser.