Design Patterns in c++