Contains all the top-level Design Pattern Examples to match C#. More...
Classes | |
struct | Exercise |
Represents a single exercise or example for a design pattern. More... | |
struct | Options |
Represents the command line options provided to the program, if any. More... | |
Public Member Functions | |
void | Run (StringList args) |
Run the specified examples. | |
Private Types | |
typedef std::vector< Exercise > | ExerciseList |
Alias for a list of Exercise instances. | |
Private Member Functions | |
void | Help (ExerciseList exercises) |
Helper method to show usage information for this program. | |
void | ShowVersion () |
Helper function to show just the version of the application. | |
bool | ParseOptions (StringList args, ExerciseList exercises, Options &options) |
Helper method to parse the given options and store the results in the given Options structure. Displays help if requested and returns false. | |
Contains all the top-level Design Pattern Examples to match C#.
Definition at line 48 of file program.cpp.
|
private |
Alias for a list of Exercise instances.
Definition at line 82 of file program.cpp.
|
inlineprivate |
Helper method to show usage information for this program.
exercises | List of Exercise objects for which to show the names. |
Definition at line 102 of file program.cpp.
References exercises, and Helpers::Replace().
Referenced by Program::ParseOptions().
|
inlineprivate |
Helper method to parse the given options and store the results in the given Options structure. Displays help if requested and returns false.
args | List of arguments passed on the command line. |
exercises | List of Exercise objects to display if help is needed. |
options | An Options structure to be filled in by command line parameters. |
Definition at line 150 of file program.cpp.
References Program::Options::exercise_names, exercises, Program::Help(), and Program::ShowVersion().
Referenced by Program::Run().
|
inline |
Run the specified examples.
args | Command line arguments. |
Definition at line 186 of file program.cpp.
References DesignPatternExamples_cpp::Adapter_Exercise(), DesignPatternExamples_cpp::Bridge_Exercise(), DesignPatternExamples_cpp::Command_Exercise(), DesignPatternExamples_cpp::Composite_Exercise(), DesignPatternExamples_cpp::Decorator_Exercise(), Program::Options::exercise_names, exercises, DesignPatternExamples_cpp::Facade_Exercise(), DesignPatternExamples_cpp::Flyweight_Exercise(), DesignPatternExamples_cpp::HandlerChain_Exercise(), DesignPatternExamples_cpp::Interpreter_Exercise(), DesignPatternExamples_cpp::Iterator_Exercise(), DesignPatternExamples_cpp::Mediator_Exercise(), DesignPatternExamples_cpp::Memento_Exercise(), DesignPatternExamples_cpp::NullObject_Exercise(), DesignPatternExamples_cpp::Observer_Exercise(), Program::ParseOptions(), DesignPatternExamples_cpp::Proxy_Exercise(), DesignPatternExamples_cpp::State_Exercise(), DesignPatternExamples_cpp::Strategy_Exercise(), and DesignPatternExamples_cpp::Visitor_Exercise().
Referenced by main().
|
inlineprivate |
Helper function to show just the version of the application.
Definition at line 132 of file program.cpp.
Referenced by Program::ParseOptions().