42 #include "FGDistributor.h"
59 if (type_string ==
"inclusive") Type = eInclusive;
60 else if (type_string ==
"exclusive") Type = eExclusive;
62 throw(
"Not a known Distributor type, "+type_string);
66 while (case_element) {
67 Case* current_case =
new Case;
69 if (test_element) current_case->SetTest(
new FGCondition(test_element, PropertyManager));
71 while (prop_val_element) {
73 string property_string = prop_val_element->
GetDataLine();
74 current_case->AddPropValPair(
new PropValPair(property_string, value_string, PropertyManager));
77 Cases.push_back(current_case);
88 for (
auto Case: Cases)
delete Case;
96 bool completed =
false;
97 for (
auto Case: Cases) {
98 if (Case->HasTest()) {
99 if (Case->GetTestResult() && !((Type == eExclusive) && completed)) {
100 Case->SetPropValPairs();
104 Case->SetPropValPairs();
130 void FGDistributor::Debug(
int from)
132 if (debug_lvl <= 0)
return;
137 for (
auto Case: Cases) {
138 std::cout <<
" Case: " << ctr << endl;
139 if (Case->HasTest()) {
140 Case->GetTest()->PrintCondition(
" ");
142 std::cout <<
" Set these properties by default: " << std::endl;
144 std::cout << std::endl;
145 for (
auto propVal = Case->IterPropValPairs(); propVal != Case->EndPropValPairs(); ++propVal) {
146 std::cout <<
" Set property " << (*propVal)->GetPropName();
147 if ((*propVal)->GetLateBoundProp()) std::cout <<
" (late bound)";
148 std::cout <<
" to " << (*propVal)->GetValString();
149 if ((*propVal)->GetLateBoundValue()) std::cout <<
" (late bound)";
150 std::cout << std::endl;
156 if (debug_lvl & 2 ) {
157 if (from == 0) cout <<
"Instantiated: FGDistributor" << endl;
158 if (from == 1) cout <<
"Destroyed: FGDistributor" << endl;
160 if (debug_lvl & 4 ) {
162 if (debug_lvl & 8 ) {
164 if (debug_lvl & 16) {
166 if (debug_lvl & 64) {