Cleanup examples

This commit is contained in:
Alexey Rybalchenko
2016-05-12 09:15:35 +02:00
parent 6c88e75ed7
commit 1d2d409bfd
18 changed files with 98 additions and 199 deletions

View File

@@ -15,24 +15,21 @@
#include <iostream>
#include "FairMQLogger.h"
#include "FairMQParser.h"
#include "FairMQProgOptions.h"
#include "FairMQExample4Sampler.h"
int main(int argc, char** argv)
{
FairMQExample4Sampler sampler;
sampler.CatchSignals();
FairMQProgOptions config;
try
{
FairMQProgOptions config;
if (config.ParseAll(argc, argv))
{
return 0;
}
FairMQExample4Sampler sampler;
sampler.CatchSignals();
sampler.SetConfig(config);
sampler.ChangeState("INIT_DEVICE");
@@ -46,9 +43,8 @@ int main(int argc, char** argv)
}
catch (std::exception& e)
{
LOG(ERROR) << e.what();
LOG(INFO) << "Command line options are the following: ";
config.PrintHelp();
LOG(ERROR) << "Unhandled Exception reached the top of main: "
<< e.what() << ", application will now exit";
return 1;
}

View File

@@ -15,24 +15,21 @@
#include <iostream>
#include "FairMQLogger.h"
#include "FairMQParser.h"
#include "FairMQProgOptions.h"
#include "FairMQExample4Sink.h"
int main(int argc, char** argv)
{
FairMQExample4Sink sink;
sink.CatchSignals();
FairMQProgOptions config;
try
{
FairMQProgOptions config;
if (config.ParseAll(argc, argv))
{
return 0;
}
FairMQExample4Sink sink;
sink.CatchSignals();
sink.SetConfig(config);
sink.ChangeState("INIT_DEVICE");
@@ -46,9 +43,8 @@ int main(int argc, char** argv)
}
catch (std::exception& e)
{
LOG(ERROR) << e.what();
LOG(INFO) << "Command line options are the following: ";
config.PrintHelp();
LOG(ERROR) << "Unhandled Exception reached the top of main: "
<< e.what() << ", application will now exit";
return 1;
}