Design Pattern Examples
Overview of object-oriented design patterns
program.cpp File Reference

Implementation of the main() entry point and the machinery to call all the design pattern example functions. See Main Overview. More...

#include <functional>
#include <iostream>
#include <version.h>
#include "helpers/replace.h"
#include "helpers/stringlist.h"
#include "helpers/enablevtmode.h"
#include "Adapter_Exercise.h"
#include "Bridge_Exercise.h"
#include "Command_Exercise.h"
#include "Composite_Exercise.h"
#include "Decorator_Exercise.h"
#include "Facade_Exercise.h"
#include "Flyweight_Exercise.h"
#include "HandlerChain_Exercise.h"
#include "Interpreter_Exercise.h"
#include "Iterator_Exercise.h"
#include "Mediator_Exercise.h"
#include "Memento_Exercise.h"
#include "NullObject_Exercise.h"
#include "Observer_Exercise.h"
#include "Proxy_Exercise.h"
#include "State_Exercise.h"
#include "Strategy_Exercise.h"
#include "Visitor_Exercise.h"
Include dependency graph for program.cpp:

Go to the source code of this file.

Classes

class  Program
 Contains all the top-level Design Pattern Examples to match C#. More...
 
struct  Program::Exercise
 Represents a single exercise or example for a design pattern. More...
 
struct  Program::Options
 Represents the command line options provided to the program, if any. More...
 

Namespaces

namespace  DesignPatternExamples_cpp
 The namespace containing all Design Pattern Examples implemented in C++.
 

Typedefs

typedef std::function< void()> Action
 Alias for a function pointer, using C# as inspiration for the name.
 

Functions

int main (int argc, char **argv)
 Main entry point into this example program.
 

Detailed Description

Implementation of the main() entry point and the machinery to call all the design pattern example functions. See Main Overview.

Definition in file program.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Main entry point into this example program.

Parameters
argcNumber of command line arguments + 1 (the first argument is the name of the program).
argvPointer to a list of zero-terminated strings containing the command line arguments.

Definition at line 249 of file program.cpp.

References Helpers::enableVTMode(), main(), and Program::Run().

Referenced by main().