Initial commit

This commit is contained in:
Matthias
2017-04-11 15:49:55 +02:00
commit 3d8f381bae
106 changed files with 4407 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
sout->if1condOut.setValue(sin->if1cond.getValue());
sout->if1ValueOut.setValue(sin->if1Value.getValue());
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity1
entries=1
entry.0=atomic1.code
+16
View File
@@ -0,0 +1,16 @@
std::cout << "AtomicActivity2:" << std::endl
<< "\tif1cond: " << sin->if1cond.getValue() << std::endl
<< "\tif1value: " << sin->if1Value.getValue() << std::endl;
if (!sin->if1cond.getValue()) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1cond [" << sin->if1cond.getValue() << "] is not true.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if1Value.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1Value [" << sin->if1Value.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->if1ValueOut.setValue(2);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity2
entries=1
entry.0=atomic2.code
+16
View File
@@ -0,0 +1,16 @@
std::cout << "AtomicActivity3:" << std::endl
<< "\tif1cond: " << sin->if1Cond.getValue() << std::endl
<< "\tif1value: " << sin->if1Value.getValue() << std::endl;
if (sin->if1Cond.getValue()) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1cond [" << sin->if1Cond.getValue() << "] is not false.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if1Value.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1Value [" << sin->if1Value.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->if1ValueOut.setValue(3);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity3
entries=1
entry.0=atomic3.code
+16
View File
@@ -0,0 +1,16 @@
std::cout << "AtomicActivity4:" << std::endl
<< "\tif2cond: " << sin->if2cond.getValue() << std::endl
<< "\tif2value: " << sin->if2value.getValue() << std::endl;
if (!sin->if2cond.getValue()) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2cond [" << sin->if2cond.getValue() << "] is not true.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if2value.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2Value [" << sin->if2value.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->if2valueOut.setValue(4);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity4
entries=1
entry.0=atomic4.code
+47
View File
@@ -0,0 +1,47 @@
std::cout << "AtomicActivity5:" << std::endl
<< "\tif1cond: " << sin->if1cond.getValue() << std::endl
<< "\tif2cond: " << sin->if2cond.getValue() << std::endl
<< "\tif3cond: " << sin->if3cond.getValue() << std::endl
<< "\tif4cond: " << sin->if4cond.getValue() << std::endl
<< "\tif1valueOrig: " << sin->if1valueOrig.getValue() << std::endl
<< "\tif1valueOut: " << sin->if1valueOut.getValue() << std::endl
<< "\tif2valueOrig: " << sin->if2valueOrig.getValue() << std::endl
<< "\tif2valueOut: " << sin->if2valueOut.getValue() << std::endl;
if (sin->if1valueOrig.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1valueOrig [" << sin->if1valueOrig.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if2valueOrig.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2valueOrig [" << sin->if2valueOrig.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if1cond.getValue() && sin->if1valueOut.getValue() != 2) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1valueOut [" << sin->if1valueOut.getValue() << "] is not 2.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!sin->if1cond.getValue() && sin->if1valueOut.getValue() != 3) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1valueOut [" << sin->if1valueOut.getValue() << "] is not 3.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if2cond.getValue() && sin->if2valueOut.getValue() != 4) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2valueOut [" << sin->if2valueOut.getValue() << "] is not 4.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!sin->if2cond.getValue() && sin->if2valueOut.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2valueOut [" << sin->if2valueOut.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->if3condOut.setValue(sin->if3cond.getValue());
sout->if4condOut.setValue(sin->if4cond.getValue());
sout->isOk.setValue(true);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity5
entries=1
entry.0=atomic5.code
+16
View File
@@ -0,0 +1,16 @@
std::cout << "AtomicActivity6:" << std::endl
<< "\tif3cond: " << sin->if3cond.getValue() << std::endl
<< "\tif3value: " << sin->if3value.getValue() << std::endl;
if (sin->if3cond.getValue()) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3cond [" << sin->if3cond.getValue() << "] is not false.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if3value.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3Value [" << sin->if3value.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->if3valueOut.setValue(6);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity6
entries=1
entry.0=atomic6.code
+16
View File
@@ -0,0 +1,16 @@
std::cout << "AtomicActivity7:" << std::endl
<< "\tif4cond: " << sin->if4cond.getValue() << std::endl
<< "\tif4value: " << sin->if4value.getValue() << std::endl;
if (!sin->if4cond.getValue()) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4cond [" << sin->if4cond.getValue() << "] is not true.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if4value.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4Value [" << sin->if4value.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->if4valueOut.setValue(7);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity7
entries=1
entry.0=atomic7.code
+42
View File
@@ -0,0 +1,42 @@
std::cout << "AtomicActivity8:" << std::endl
<< "\tif3cond: " << sin->if3cond.getValue() << std::endl
<< "\tif4cond: " << sin->if4cond.getValue() << std::endl
<< "\tif3valueOrig: " << sin->if3valueOrig.getValue() << std::endl
<< "\tif3valueOut: " << sin->if3valueOut.getValue() << std::endl
<< "\tif4valueOrig: " << sin->if4valueOrig.getValue() << std::endl
<< "\tif4valueOut: " << sin->if4ValueOut.getValue() << std::endl;
if (sin->if3valueOrig.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3valueOrig [" << sin->if3valueOrig.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if4valueOrig.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4valueOrig [" << sin->if4valueOrig.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if3cond.getValue() && sin->if3valueOut.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3valueOut [" << sin->if3valueOut.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!sin->if3cond.getValue() && sin->if3valueOut.getValue() != 6) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3valueOut [" << sin->if3valueOut.getValue() << "] is not 6.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (sin->if4cond.getValue() && sin->if4ValueOut.getValue() != 7) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4valueOut [" << sin->if4ValueOut.getValue() << "] is not 7.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!sin->if4cond.getValue() && sin->if4ValueOut.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4valueOut [" << sin->if4ValueOut.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->isOk.setValue(true);
+4
View File
@@ -0,0 +1,4 @@
name=AtomicActivity8
entries=1
entry.0=atomic8.code
+2
View File
@@ -0,0 +1,2 @@
#include <boost/program_options.hpp>
#include <thread>
+47
View File
@@ -0,0 +1,47 @@
bool isHelp = false;
bool if1Cond = true;
bool if2Cond = true;
bool if3Cond = true;
bool if4Cond = true;
boost::program_options::options_description opts("if1 Options");
opts.add_options()
("help", "Print help message.")
("if1", boost::program_options::value<bool>(), "if1 condition")
("if2", boost::program_options::value<bool>(), "if2 condition")
("if3", boost::program_options::value<bool>(), "if3 condition")
("if4", boost::program_options::value<bool>(), "if4 condition");
boost::program_options::variables_map vm;
auto parsed = boost::program_options::command_line_parser(argc, argv).options(opts).allow_unregistered().run();
boost::program_options::store(parsed, vm);
boost::program_options::notify(vm);
if (vm.count("help")) {
std::cerr << opts << std::endl;
isHelp = true;
} else {
if (vm.count("if1")) {
if1Cond = vm["if1"].as<bool>();
}
if (vm.count("if2")) {
if2Cond = vm["if2"].as<bool>();
}
if (vm.count("if3")) {
if3Cond = vm["if3"].as<bool>();
}
if (vm.count("if4")) {
if4Cond = vm["if4"].as<bool>();
}
std::cerr << "if1 = " << if1Cond << std::endl;
std::cerr << "if2 = " << if2Cond << std::endl;
std::cerr << "if3 = " << if3Cond << std::endl;
std::cerr << "if4 = " << if4Cond << std::endl;
}
wfInput.if1cond.setValue(if1Cond);
wfInput.if2cond.setValue(if2Cond);
wfInput.if3cond.setValue(if3Cond);
wfInput.if4cond.setValue(if4Cond);
wfInput.if1Value.setValue(-1);
wfInput.if2Value.setValue(-1);
wfInput.if3Value.setValue(-1);
wfInput.if4Value.setValue(-1);
+63
View File
@@ -0,0 +1,63 @@
std::cout << "wfOutput:" << std::endl
<< "\tisOk1: " << wfOutput.isOk1.getValue() << std::endl
<< "\tisOk2: " << wfOutput.isOk2.getValue() << std::endl
<< "\tif1valueOut: " << wfOutput.if1valueOut.getValue() << std::endl
<< "\tif2valueOut: " << wfOutput.if2ValueOut.getValue() << std::endl
<< "\tif3valueOut: " << wfOutput.if3ValueOut.getValue() << std::endl
<< "\tif4valueOut: " << wfOutput.if4ValueOut.getValue() << std::endl;
if (wfOutput.isOk1.getValue() != true) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: isOk1 [" << wfOutput.isOk1.getValue() << "] is not true.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (wfOutput.isOk2.getValue() != true) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: isOk2 [" << wfOutput.isOk2.getValue() << "] is not true.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (wfInput.if1cond.getValue() && wfOutput.if1valueOut.getValue() != 2) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1valueOut [" << wfOutput.if1valueOut.getValue() << "] is not 2.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!wfInput.if1cond.getValue() && wfOutput.if1valueOut.getValue() != 3) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if1valueOut [" << wfOutput.if1valueOut.getValue() << "] is not 3.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (wfInput.if2cond.getValue() && wfOutput.if2ValueOut.getValue() != 4) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2valueOut [" << wfOutput.if2ValueOut.getValue() << "] is not 4.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!wfInput.if2cond.getValue() && wfOutput.if2ValueOut.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if2valueOut [" << wfOutput.if2ValueOut.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (wfInput.if3cond.getValue() && wfOutput.if3ValueOut.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3valueOut [" << wfOutput.if3ValueOut.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!wfInput.if3cond.getValue() && wfOutput.if3ValueOut.getValue() != 6) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if3valueOut [" << wfOutput.if3ValueOut.getValue() << "] is not 6.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (wfInput.if4cond.getValue() && wfOutput.if4ValueOut.getValue() != 7) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4valueOut [" << wfOutput.if4ValueOut.getValue() << "] is not 7.";
throw wfr::exception::wfr_fatal_error(ss.str());
} else if (!wfInput.if4cond.getValue() && wfOutput.if4ValueOut.getValue() != -1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: if4valueOut [" << wfOutput.if4ValueOut.getValue() << "] is not -1.";
throw wfr::exception::wfr_fatal_error(ss.str());
}