mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Cleanup examples
This commit is contained in:
parent
6c88e75ed7
commit
1d2d409bfd
|
@ -12,12 +12,9 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "boost/program_options.hpp"
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample1Sampler.h"
|
#include "FairMQExample1Sampler.h"
|
||||||
|
|
||||||
|
@ -25,11 +22,6 @@ using namespace boost::program_options;
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample1Sampler sampler;
|
|
||||||
sampler.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::string text;
|
std::string text;
|
||||||
|
@ -38,13 +30,15 @@ int main(int argc, char** argv)
|
||||||
samplerOptions.add_options()
|
samplerOptions.add_options()
|
||||||
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
||||||
|
|
||||||
|
FairMQProgOptions config;
|
||||||
config.AddToCmdLineOptions(samplerOptions);
|
config.AddToCmdLineOptions(samplerOptions);
|
||||||
|
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample1Sampler sampler;
|
||||||
|
sampler.CatchSignals();
|
||||||
sampler.SetConfig(config);
|
sampler.SetConfig(config);
|
||||||
sampler.SetProperty(FairMQExample1Sampler::Text, text);
|
sampler.SetProperty(FairMQExample1Sampler::Text, text);
|
||||||
|
|
||||||
|
@ -59,9 +53,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,24 +15,21 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample1Sink.h"
|
#include "FairMQExample1Sink.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample1Sink sink;
|
|
||||||
sink.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample1Sink sink;
|
||||||
|
sink.CatchSignals();
|
||||||
sink.SetConfig(config);
|
sink.SetConfig(config);
|
||||||
|
|
||||||
sink.ChangeState("INIT_DEVICE");
|
sink.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +43,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,27 +12,23 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample2Processor.h"
|
#include "FairMQExample2Processor.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample2Processor processor;
|
|
||||||
processor.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample2Processor processor;
|
||||||
|
processor.CatchSignals();
|
||||||
processor.SetConfig(config);
|
processor.SetConfig(config);
|
||||||
|
|
||||||
processor.ChangeState("INIT_DEVICE");
|
processor.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +42,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,10 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "boost/program_options.hpp"
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample2Sampler.h"
|
#include "FairMQExample2Sampler.h"
|
||||||
|
|
||||||
|
@ -25,11 +23,6 @@ using namespace boost::program_options;
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample2Sampler sampler;
|
|
||||||
sampler.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::string text;
|
std::string text;
|
||||||
|
@ -38,13 +31,15 @@ int main(int argc, char** argv)
|
||||||
samplerOptions.add_options()
|
samplerOptions.add_options()
|
||||||
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
||||||
|
|
||||||
|
FairMQProgOptions config;
|
||||||
config.AddToCmdLineOptions(samplerOptions);
|
config.AddToCmdLineOptions(samplerOptions);
|
||||||
|
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample2Sampler sampler;
|
||||||
|
sampler.CatchSignals();
|
||||||
sampler.SetConfig(config);
|
sampler.SetConfig(config);
|
||||||
sampler.SetProperty(FairMQExample2Sampler::Text, text);
|
sampler.SetProperty(FairMQExample2Sampler::Text, text);
|
||||||
|
|
||||||
|
@ -59,9 +54,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,27 +12,23 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample2Sink.h"
|
#include "FairMQExample2Sink.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample2Sink sink;
|
|
||||||
sink.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample2Sink sink;
|
||||||
|
sink.CatchSignals();
|
||||||
sink.SetConfig(config);
|
sink.SetConfig(config);
|
||||||
|
|
||||||
sink.ChangeState("INIT_DEVICE");
|
sink.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +42,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
# source setup.sh
|
# source setup.sh
|
||||||
@bash_end@
|
@bash_end@
|
||||||
|
|
||||||
sampler, username@localhost, , /path/to/dds-work-dir/, 1
|
sampler, orybalch@localhost, , /home/orybalch/dds-work/, 1
|
||||||
processor, username@localhost, , /path/to/dds-work-dir/, 10
|
processor, orybalch@localhost, , /home/orybalch/dds-work/, 10
|
||||||
sink, username@localhost, , /path/to/dds-work-dir/, 1
|
sink, orybalch@localhost, , /home/orybalch/dds-work/, 1
|
||||||
|
|
|
@ -17,23 +17,18 @@
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample3Processor.h"
|
#include "FairMQExample3Processor.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost::program_options;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample3Processor processor;
|
|
||||||
processor.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample3Processor processor;
|
||||||
|
processor.CatchSignals();
|
||||||
processor.SetConfig(config);
|
processor.SetConfig(config);
|
||||||
|
|
||||||
processor.ChangeState("INIT_DEVICE");
|
processor.ChangeState("INIT_DEVICE");
|
||||||
|
@ -45,11 +40,10 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
runDDSStateHandler(processor);
|
runDDSStateHandler(processor);
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,23 +17,18 @@
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample3Sampler.h"
|
#include "FairMQExample3Sampler.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost::program_options;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample3Sampler sampler;
|
|
||||||
sampler.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample3Sampler sampler;
|
||||||
|
sampler.CatchSignals();
|
||||||
sampler.SetConfig(config);
|
sampler.SetConfig(config);
|
||||||
|
|
||||||
sampler.ChangeState("INIT_DEVICE");
|
sampler.ChangeState("INIT_DEVICE");
|
||||||
|
@ -45,11 +40,10 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
runDDSStateHandler(sampler);
|
runDDSStateHandler(sampler);
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,23 +17,18 @@
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample3Sink.h"
|
#include "FairMQExample3Sink.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost::program_options;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample3Sink sink;
|
|
||||||
sink.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample3Sink sink;
|
||||||
|
sink.CatchSignals();
|
||||||
sink.SetConfig(config);
|
sink.SetConfig(config);
|
||||||
|
|
||||||
sink.ChangeState("INIT_DEVICE");
|
sink.ChangeState("INIT_DEVICE");
|
||||||
|
@ -45,11 +40,10 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
runDDSStateHandler(sink);
|
runDDSStateHandler(sink);
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,24 +15,21 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample4Sampler.h"
|
#include "FairMQExample4Sampler.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample4Sampler sampler;
|
|
||||||
sampler.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample4Sampler sampler;
|
||||||
|
sampler.CatchSignals();
|
||||||
sampler.SetConfig(config);
|
sampler.SetConfig(config);
|
||||||
|
|
||||||
sampler.ChangeState("INIT_DEVICE");
|
sampler.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +43,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,24 +15,21 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample4Sink.h"
|
#include "FairMQExample4Sink.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample4Sink sink;
|
|
||||||
sink.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample4Sink sink;
|
||||||
|
sink.CatchSignals();
|
||||||
sink.SetConfig(config);
|
sink.SetConfig(config);
|
||||||
|
|
||||||
sink.ChangeState("INIT_DEVICE");
|
sink.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +43,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,33 +12,25 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "boost/program_options.hpp"
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample5Client.h"
|
#include "FairMQExample5Client.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost::program_options;
|
using namespace boost::program_options;
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample5Client client;
|
|
||||||
client.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string text;
|
std::string text;
|
||||||
|
|
||||||
options_description clientOptions("Client options");
|
options_description clientOptions("Client options");
|
||||||
clientOptions.add_options()
|
clientOptions.add_options()
|
||||||
("text", value<string>(&text)->default_value("Hello"), "Text to send out");
|
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
||||||
|
|
||||||
|
FairMQProgOptions config;
|
||||||
config.AddToCmdLineOptions(clientOptions);
|
config.AddToCmdLineOptions(clientOptions);
|
||||||
|
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
|
@ -46,6 +38,8 @@ int main(int argc, char** argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample5Client client;
|
||||||
|
client.CatchSignals();
|
||||||
client.SetConfig(config);
|
client.SetConfig(config);
|
||||||
client.SetProperty(FairMQExample5Client::Text, text);
|
client.SetProperty(FairMQExample5Client::Text, text);
|
||||||
|
|
||||||
|
@ -58,11 +52,10 @@ int main(int argc, char** argv)
|
||||||
client.ChangeState("RUN");
|
client.ChangeState("RUN");
|
||||||
client.InteractiveStateLoop();
|
client.InteractiveStateLoop();
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,26 +15,21 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample5Server.h"
|
#include "FairMQExample5Server.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample5Server server;
|
|
||||||
server.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample5Server server;
|
||||||
|
server.CatchSignals();
|
||||||
server.SetConfig(config);
|
server.SetConfig(config);
|
||||||
|
|
||||||
server.ChangeState("INIT_DEVICE");
|
server.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,11 +41,10 @@ int main(int argc, char** argv)
|
||||||
server.ChangeState("RUN");
|
server.ChangeState("RUN");
|
||||||
server.InteractiveStateLoop();
|
server.InteractiveStateLoop();
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,27 +12,22 @@
|
||||||
* @author A. Rybalchenko
|
* @author A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample6Broadcaster.h"
|
#include "FairMQExample6Broadcaster.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample6Broadcaster broadcaster;
|
|
||||||
broadcaster.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample6Broadcaster broadcaster;
|
||||||
|
broadcaster.CatchSignals();
|
||||||
broadcaster.SetConfig(config);
|
broadcaster.SetConfig(config);
|
||||||
|
|
||||||
broadcaster.ChangeState("INIT_DEVICE");
|
broadcaster.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +41,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,9 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "boost/program_options.hpp"
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample6Sampler.h"
|
#include "FairMQExample6Sampler.h"
|
||||||
|
|
||||||
|
@ -25,11 +22,6 @@ using namespace boost::program_options;
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample6Sampler sampler;
|
|
||||||
sampler.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::string text;
|
std::string text;
|
||||||
|
@ -38,13 +30,15 @@ int main(int argc, char** argv)
|
||||||
samplerOptions.add_options()
|
samplerOptions.add_options()
|
||||||
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
("text", value<std::string>(&text)->default_value("Hello"), "Text to send out");
|
||||||
|
|
||||||
|
FairMQProgOptions config;
|
||||||
config.AddToCmdLineOptions(samplerOptions);
|
config.AddToCmdLineOptions(samplerOptions);
|
||||||
|
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample6Sampler sampler;
|
||||||
|
sampler.CatchSignals();
|
||||||
sampler.SetConfig(config);
|
sampler.SetConfig(config);
|
||||||
sampler.SetProperty(FairMQExample6Sampler::Text, text);
|
sampler.SetProperty(FairMQExample6Sampler::Text, text);
|
||||||
|
|
||||||
|
@ -59,9 +53,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,31 +12,22 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "boost/program_options.hpp"
|
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample6Sink.h"
|
#include "FairMQExample6Sink.h"
|
||||||
|
|
||||||
using namespace boost::program_options;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample6Sink sink;
|
|
||||||
sink.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample6Sink sink;
|
||||||
|
sink.CatchSignals();
|
||||||
sink.SetConfig(config);
|
sink.SetConfig(config);
|
||||||
|
|
||||||
sink.ChangeState("INIT_DEVICE");
|
sink.ChangeState("INIT_DEVICE");
|
||||||
|
@ -50,9 +41,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,27 +12,22 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample8Sampler.h"
|
#include "FairMQExample8Sampler.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample8Sampler sampler;
|
|
||||||
sampler.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample8Sampler sampler;
|
||||||
|
sampler.CatchSignals();
|
||||||
sampler.SetConfig(config);
|
sampler.SetConfig(config);
|
||||||
|
|
||||||
sampler.ChangeState("INIT_DEVICE");
|
sampler.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +41,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,27 +12,22 @@
|
||||||
* @author D. Klein, A. Rybalchenko
|
* @author D. Klein, A. Rybalchenko
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQParser.h"
|
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
#include "FairMQExample8Sink.h"
|
#include "FairMQExample8Sink.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FairMQExample8Sink sink;
|
|
||||||
sink.CatchSignals();
|
|
||||||
|
|
||||||
FairMQProgOptions config;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
FairMQProgOptions config;
|
||||||
if (config.ParseAll(argc, argv))
|
if (config.ParseAll(argc, argv))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQExample8Sink sink;
|
||||||
|
sink.CatchSignals();
|
||||||
sink.SetConfig(config);
|
sink.SetConfig(config);
|
||||||
|
|
||||||
sink.ChangeState("INIT_DEVICE");
|
sink.ChangeState("INIT_DEVICE");
|
||||||
|
@ -46,9 +41,8 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
LOG(ERROR) << e.what();
|
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||||
LOG(INFO) << "Command line options are the following: ";
|
<< e.what() << ", application will now exit";
|
||||||
config.PrintHelp();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user