This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Structural Patterns - Bridge | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <string.h> | |
| using namespace std; | |
| class TimeImp { | |
| public: | |
| TimeImp(int hr, int min) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Structural Patterns - Adapter | |
| #include <iostream> | |
| using namespace std; | |
| typedef int Coordinate; | |
| typedef int Dimension; | |
| // Desired interface | |
| class Rectangle | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <stdlib.h> | |
| using namespace std; | |
| class Number | |
| { | |
| public: | |
| // 2. Define a public static accessor func | |
| static Number *instance(); |
NewerOlder