|
|
|
|
|
|
|
Figure 15-5
Shared Access to a Specification File |
|
|
|
 |
|
|
|
|
This implementation file demonstrates several important points. |
|
|
|
|
|
|
|
|
1. The file begins with the preprocessor directive |
|
|
|
 |
|
|
|
|
Both the implementation file and the client code must #include the specification file. Figure 15-5 pictures this shared access to the specification file. This sharing guarantees that all declarations related to an abstraction are consistent. That is, both client.cpp and timetype.cpp must reference the same declaration of the TimeType class located in timetype.h. |
|
|
|
|
|
|
|
|
2. Near the top of the implementation file we have included a comment that restates the private members of the TimeType class. |
|
|
|
|
|
|
|
|
// Private members of class:
// int hrs;
// int mins;
// int secs; |
|
|
|
|
|