1.1 --- a/c++/parameter-lister/CLI.cpp Sun May 03 22:19:03 2015 +0200
1.2 +++ b/c++/parameter-lister/CLI.cpp Sun May 03 23:41:43 2015 +0200
1.3 @@ -3,6 +3,7 @@
1.4 #include <vector>
1.5 #include <algorithm>
1.6 #include <boost/optional.hpp>
1.7 +#include <memory>
1.8
1.9 #include "info/globalcode/parameterLister/terminalCodes/TerminalCodes.h"
1.10 #include "info/globalcode/parameterLister/OutputModule.h"
1.11 @@ -24,6 +25,9 @@
1.12 }
1.13 }
1.14
1.15 +void process(shared_ptr<OutputModule> om) {
1.16 + om->process(cout);
1.17 +}
1.18
1.19 }
1.20 }
1.21 @@ -62,15 +66,16 @@
1.22 cout << "ENV: " << envName << " is missing" << endl;
1.23 }
1.24 }
1.25 -
1.26 +
1.27 {
1.28 - OutputModule om;
1.29 - TerminalOutputModule tom;
1.30 -
1.31 - om.process(cout);
1.32 - tom.process(cout);
1.33 + shared_ptr<OutputModule> om(new OutputModule());
1.34 + shared_ptr<TerminalOutputModule> tom(new TerminalOutputModule());
1.35 + shared_ptr<OutputModule> o(new TerminalOutputModule());
1.36 +
1.37 + process(om);
1.38 + process(tom);
1.39 + process(o);
1.40 }
1.41
1.42 -
1.43 return 0;
1.44 -}
1.45 \ No newline at end of file
1.46 +}