500 likes | 663 Views
ADT's, a review. We've learned that it is often necessary to develop new data types for our programming, and we develop ADT's.In C , an ADT is constructed using the class construct.Classes contain public and private information, and can have sections so labeled.. ADT's, a review. The public sect
E N D
1. ADT's and C++: A Review
2. ADT's, a review We've learned that it is often necessary to develop new data types for our programming, and we develop ADT's.
In C++, an ADT is constructed using the class construct.
Classes contain public and private information, and can have sections so labeled.
3. ADT's, a review The public section contains the interface to the ADT. It consists of a set of functions called methods.
Two special types of methods exist and should always be declared: constructors and destructors.
Other methods provide the basic ability to examine and manipulate objects of the new Abstract Data Type.
4. ADT's, a review The private section contains the basis for the implementation the ADT. It usually contains variables, constants and structures necessary for the implementation.
This private information is only visible to and accessible by the ADT itself; applications using the ADT can't see this information or refer to it in any way.
5. ADT's, a review The class definition is placed in a header file which we call the ADT definition header.
The ADT definition header should be included by any source or header file that needs to use the ADT in question.
The ADT definition header should also be included by the ADT definition source file, which implements all of the methods of the ADT.
6. ADT's, a review When creating a project that uses the ADT, the ADT definition header should be placed in the list of project header files. The ADT definition source file should be placed in the list of project source files.
7. ADT's, a review Putting all of this together, we arrive at the following two files: IntStack.h and IntStack.cpp.
8. ADT's, a review