Design Pattern Examples
Overview of object-oriented design patterns
Program Class Reference

Contains all the top-level Design Pattern Examples to match C#. More...

Collaboration diagram for Program:
Collaboration graph

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< ExerciseExerciseList
 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.
 

Detailed Description

Contains all the top-level Design Pattern Examples to match C#.

Definition at line 48 of file program.cpp.

Member Typedef Documentation

◆ ExerciseList

typedef std::vector<Exercise> ExerciseList
private

Alias for a list of Exercise instances.

Definition at line 82 of file program.cpp.

Member Function Documentation

◆ Help()

void Help ( ExerciseList  exercises)
inlineprivate

Helper method to show usage information for this program.

Parameters
exercisesList 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().

◆ ParseOptions()

bool ParseOptions ( StringList  args,
ExerciseList  exercises,
Options options 
)
inlineprivate

Helper method to parse the given options and store the results in the given Options structure. Displays help if requested and returns false.

Parameters
argsList of arguments passed on the command line.
exercisesList of Exercise objects to display if help is needed.
optionsAn Options structure to be filled in by command line parameters.
Returns
true if the command lines were valid and help was not asked. Otherwise, a command line option was not valid or help was requested.

Definition at line 150 of file program.cpp.

References Program::Options::exercise_names, exercises, Program::Help(), and Program::ShowVersion().

Referenced by Program::Run().

◆ Run()

◆ ShowVersion()

void ShowVersion ( )
inlineprivate

Helper function to show just the version of the application.

Definition at line 132 of file program.cpp.

Referenced by Program::ParseOptions().


The documentation for this class was generated from the following file: