1 #include "otsdaq/ConfigurationInterface/ConfigurationTree.h"
5 #include "otsdaq/ConfigurationInterface/ConfigurationManager.h"
6 #include "otsdaq/Macros/StringMacros.h"
7 #include "otsdaq/TableCore/TableBase.h"
12 #define __MF_SUBJECT__ "ConfigurationTree"
14 const std::string ConfigurationTree::DISCONNECTED_VALUE =
"X";
15 const std::string ConfigurationTree::VALUE_TYPE_DISCONNECTED =
"Disconnected";
16 const std::string ConfigurationTree::VALUE_TYPE_NODE =
"Node";
17 const std::string ConfigurationTree::ROOT_NAME =
"/";
18 time_t ConfigurationTree::LAST_NODE_DUMP_TIME = 0;
30 , disconnectedTargetName_(
"")
31 , disconnectedLinkID_(
"")
67 const std::string& groupId,
69 const std::string& linkColName,
70 const std::string& linkColValue,
71 const unsigned int linkBackRow,
72 const unsigned int linkBackCol,
73 const std::string& disconnectedTargetName,
74 const std::string& disconnectedLinkID,
75 const std::string& childLinkIndex,
76 const unsigned int row,
77 const unsigned int col)
78 : configMgr_(configMgr)
81 , linkParentTable_(linkParentConfig)
82 , linkColName_(linkColName)
83 , linkColValue_(linkColValue)
84 , linkBackRow_(linkBackRow)
85 , linkBackCol_(linkBackCol)
86 , disconnectedTargetName_(disconnectedTargetName)
87 , disconnectedLinkID_(disconnectedLinkID)
88 , childLinkIndex_(childLinkIndex)
95 __SS__ <<
"Invalid empty pointer given to tree!\n"
96 <<
"\n\tconfigMgr_=" << configMgr_ <<
"\n\tconfiguration_=" << table_
97 <<
"\n\tconfigView_=" << tableView_ << __E__;
104 tableView_ = &(table_->getView());
107 if(tableView_ && tableView_->getColumnInfo(tableView_->
getColUID()).getType() !=
110 __SS__ <<
"Missing UID column (must column of type "
112 <<
") in config view : " << tableView_->getTableName() << __E__;
134 recursivePrint(*
this, depth, out,
"\t");
167 out << space <<
"{" << __E__;
169 recursivePrint(c.second, depth - 1, out, space +
" ");
171 out << space <<
"}" << __E__;
177 std::string ConfigurationTree::handleValidateValueForColumn(
185 __SS__ <<
"Null configView" << __E__;
190 __COUT__ <<
"handleValidateValueForColumn<string>" << __E__;
203 if(row_ != TableView::INVALID &&
204 col_ != TableView::INVALID)
211 __COUT__ <<
"Success following path to tree node!" << __E__;
222 __COUT__ <<
"Successful value!" << __E__;
236 tableView_->
getValue(value, row_, col_);
238 else if(row_ == TableView::INVALID &&
239 col_ == TableView::INVALID)
246 value = (groupId_ ==
"") ? table_->
getTableName() : groupId_;
248 else if(row_ == TableView::INVALID)
250 __SS__ <<
"Malformed ConfigurationTree" << __E__;
253 else if(col_ == TableView::INVALID)
257 __SS__ <<
"Impossible." << __E__;
307 void ConfigurationTree::getValueAsBitMap(
310 __COUTS__(2) << row_ <<
" " << col_ <<
" p: " << tableView_ << __E__;
312 if(row_ != TableView::INVALID &&
313 col_ != TableView::INVALID)
315 std::string bitmapString;
316 tableView_->
getValue(bitmapString, row_, col_);
320 __COUTVS__(2, bitmapString);
321 if(bitmapString == TableViewColumnInfo::DATATYPE_STRING_DEFAULT ||
322 bitmapString == TableViewColumnInfo::DATATYPE_STRING_ALT_DEFAULT)
324 bitmap.isDefault_ =
true;
326 for(
unsigned int r = 0; r < bmp.numOfRows_; ++r)
328 bitmap.bitmap_.push_back(std::vector<std::string>());
329 for(
unsigned int c = 0; c < bmp.numOfColumns_; ++c)
330 bitmap.bitmap_[r].push_back(std::string());
335 bitmap.isDefault_ =
false;
339 std::map<std::string, size_t> valueMap;
340 if(bmp.mapsToStrings_)
342 std::vector<std::string> list =
345 for(
size_t i = 0; i < list.size(); ++i)
346 valueMap.emplace(std::make_pair(list[i], i));
352 bitmap.bitmap_.clear();
354 bool openRow =
false;
355 unsigned int startInt = -1;
356 for(
unsigned int i = 0; i < bitmapString.length(); i++)
358 __COUTVS__(2, bitmapString[i]);
360 __COUTVS__(2, openRow);
361 __COUTVS__(2, startInt);
366 if(bitmapString[i] ==
'[')
370 bitmap.bitmap_.push_back(std::vector<std::string>());
372 else if(bitmapString[i] ==
']')
376 else if(bitmapString[i] ==
',')
383 else if(startInt == (
unsigned int)-1)
385 if(bitmapString[i] ==
']')
390 else if((bitmapString[i] ==
'-') || (bitmapString[i] ==
'+') ||
391 (bitmapString[i] >=
'0' &&
392 bitmapString[i] <=
'9') ||
393 (bmp.mapsToStrings_ && bitmapString[i] >=
'a' &&
396 (bmp.mapsToStrings_ && bitmapString[i] >=
'A' &&
397 bitmapString[i] <=
'Z'))
401 else if(bitmapString[i] ==
',')
403 __SS__ <<
"Too many ',' characters in bit map configuration"
414 if(bitmapString[i] ==
421 while(ii - startInt > 2 && (bitmapString[ii - 1] ==
' ' ||
422 bitmapString[ii - 1] ==
'\r' ||
423 bitmapString[ii - 1] ==
'\n' ||
424 bitmapString[ii - 1] ==
'\t' ||
425 bitmapString[ii - 1] ==
'"'))
427 __COUTVS__(2, bitmapString.substr(startInt, ii - startInt));
428 if(bmp.mapsToStrings_)
431 valueMap.at(bitmapString.substr(startInt, ii - startInt));
432 __COUTVS__(2, value);
435 bitmap.bitmap_[row].push_back(
436 bitmapString.substr(startInt, ii - startInt));
440 else if(bitmapString[i] ==
',')
444 while(ii - startInt > 2 && (bitmapString[ii - 1] ==
' ' ||
445 bitmapString[ii - 1] ==
'\r' ||
446 bitmapString[ii - 1] ==
'\n' ||
447 bitmapString[ii - 1] ==
'\t' ||
448 bitmapString[ii - 1] ==
'"'))
450 __COUTVS__(2, bitmapString.substr(startInt, ii - startInt));
451 if(bmp.mapsToStrings_)
454 valueMap.at(bitmapString.substr(startInt, ii - startInt));
455 __COUTVS__(2, value);
458 bitmap.bitmap_[row].push_back(
459 bitmapString.substr(startInt, ii - startInt));
468 for(
unsigned int r = 0; r < bitmap.bitmap_.size(); ++r)
470 for(
unsigned int c = 0; c < bitmap.bitmap_[r].size(); ++c)
472 __COUTT__ << r <<
"," << c <<
" = " << bitmap.bitmap_[r][c]
475 __COUTT__ <<
"================" << __E__;
480 if(bitmap.bitmap_.size() != bmp.numOfRows_ ||
481 (bmp.numOfRows_ && bitmap.bitmap_[0].size() != bmp.numOfColumns_))
484 <<
"Illegal mismatch in number of rows and columns. Extracted data was "
485 << bitmap.bitmap_.size() <<
" x "
486 << (bitmap.bitmap_.size() ? bitmap.bitmap_[0].size() : 0)
487 <<
" and the expected size is " << bmp.numOfRows_ <<
" x "
488 << bmp.numOfColumns_ << __E__;
494 __SS__ <<
"Requesting getValue must be on a value node." << __E__;
508 ConfigurationTree::getValueAsBitMap(value);
517 if(row_ != TableView::INVALID &&
518 col_ != TableView::INVALID)
521 __SS__ <<
"Can not get escaped value except from a value node!"
522 <<
" This node is type '" << getNodeType() <<
"." << __E__;
534 __SS__ <<
"Can not get configuration name of node with no configuration pointer! "
535 <<
"Is there a broken link? " << __E__;
538 ss <<
"Error occurred traversing from " << linkParentTable_->
getTableName()
541 linkBackRow_, linkParentTable_->getView().
getColUID())
542 <<
"' at row " << linkBackRow_ <<
" col '"
543 << linkParentTable_->getView().getColumnInfo(linkBackCol_).getName()
561 __SS__ <<
"Can not get parent table name of node with no parent table pointer! "
562 <<
"Was this node initialized correctly? " << __E__;
571 if(linkParentTable_ && linkBackRow_ != TableView::INVALID)
574 return linkParentTable_->getView()
575 .getDataView()[linkBackRow_][linkParentTable_->getView().
getColUID()];
578 __SS__ <<
"Can not get parent record name of node without the parent table pointer "
579 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
580 <<
")! Was this node initialized correctly? " << __E__;
589 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
590 linkBackCol_ != TableView::INVALID)
593 return linkParentTable_->getView().getColumnInfo(linkBackCol_).getName();
597 <<
"Can not get parent link column name of node without the parent table pointer "
598 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
599 <<
") and col (col = " << linkBackCol_
600 <<
")! Was this node initialized correctly? " << __E__;
609 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
610 linkBackCol_ != TableView::INVALID)
614 std::pair<
unsigned int ,
unsigned int > linkPair;
615 linkParentTable_->getView().
getChildLink(linkBackCol_, isGroup, linkPair);
618 linkParentTable_->getView().
getValue(
619 linkId, linkBackRow_, linkPair.second );
624 __SS__ <<
"Can not get parent link ID of node without the parent table pointer "
625 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
626 <<
") and col (col = " << linkBackCol_
627 <<
")! Was this node initialized correctly? " << __E__;
636 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
637 linkBackCol_ != TableView::INVALID)
640 return linkParentTable_->getView()
641 .getColumnInfo(linkBackCol_)
645 __SS__ <<
"Can not get parent link index of node without the parent table pointer "
646 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
647 <<
") and col (col = " << linkBackCol_
648 <<
")! Was this node initialized correctly? " << __E__;
660 __SS__ <<
"Can only get row from a UID or value node!" << __E__;
663 ss <<
"Error occurred traversing from " << linkParentTable_->
getTableName()
666 linkBackRow_, linkParentTable_->getView().
getColUID())
667 <<
"' at row " << linkBackRow_ <<
" col '"
668 << linkParentTable_->getView().getColumnInfo(linkBackCol_).getName() <<
".'"
688 if(!linkParentTable_)
690 __SS__ <<
"Can not get configuration name of link node field with no parent "
691 "configuration pointer!"
707 return disconnectedTargetName_;
709 __SS__ <<
"Can not get disconnected target name of node unless it is a disconnected "
722 return disconnectedLinkID_;
724 __SS__ <<
"Can not get disconnected target name of node unless it is a disconnected "
738 __SS__ <<
"Can not get configuration version of node with no config view pointer!"
744 return tableView_->getVersion();
753 __SS__ <<
"Can not get configuration creation time of node with no config view "
760 return tableView_->getCreationTime();
770 __SS__ <<
"Can not get set of group IDs of node with value type of '"
771 << getNodeType() <<
".' Node must be a GroupID node." << __E__;
787 if(
getValueType() != TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA &&
790 __SS__ <<
"Can not get fixed choices of node with value type of '"
791 <<
getValueType() <<
".' Node must be a link or a value node with type '"
792 << TableViewColumnInfo::TYPE_BITMAP_DATA <<
"' or '"
793 << TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA <<
".'" << __E__;
799 std::vector<std::string> retVec;
803 if(!linkParentTable_)
806 <<
"Can not get fixed choices of node with no parent config view pointer!"
819 const TableView* parentView = &(linkParentTable_->getView());
820 int c = parentView->
findCol(linkColName_);
822 std::pair<
unsigned int ,
unsigned int > linkPair;
827 std::vector<std::string> choices = parentView->getColumnInfo(c).getDataChoices();
828 for(
const auto& choice : choices)
829 retVec.push_back(choice);
836 __SS__ <<
"Can not get fixed choices of node with no config view pointer!"
845 std::vector<std::string> choices = tableView_->getColumnInfo(col_).getDataChoices();
846 for(
const auto& choice : choices)
847 retVec.push_back(choice);
856 auto commentNode =
getNode(TableViewColumnInfo::COL_NAME_COMMENT);
857 std::string comment = commentNode.getValueAsString();
858 return comment !=
"" && comment != TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT &&
859 comment != TableViewColumnInfo::DATATYPE_COMMENT_OLD_DEFAULT &&
860 comment != commentNode.getColumnInfo().getDefaultValue();
868 ? TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT
893 if(returnLinkTableValue)
894 return linkColValue_;
896 return ConfigurationTree::DISCONNECTED_VALUE;
897 else if(row_ == TableView::INVALID &&
898 col_ == TableView::INVALID)
899 return (groupId_ ==
"") ? table_->
getTableName() : groupId_;
900 else if(col_ == TableView::INVALID)
901 return tableView_->getDataView()[row_][tableView_->
getColUID()];
904 __SS__ <<
"Impossible Link." << __E__;
910 else if(row_ != TableView::INVALID &&
911 col_ != TableView::INVALID)
912 return tableView_->getDataView()[row_][col_];
913 else if(row_ == TableView::INVALID &&
914 col_ == TableView::INVALID)
918 return ConfigurationTree::ROOT_NAME;
920 return (groupId_ ==
"") ? table_->
getTableName() : groupId_;
922 else if(row_ == TableView::INVALID)
924 __SS__ <<
"Malformed ConfigurationTree" << __E__;
929 else if(col_ == TableView::INVALID)
930 return tableView_->getDataView()[row_][tableView_->
getColUID()];
933 __SS__ <<
"Impossible." << __E__;
947 return tableView_->getDataView()[row_][tableView_->
getColUID()];
950 __SS__ <<
"Can not get UID of node with type '" << getNodeType()
951 <<
".' Node type must be '" << ConfigurationTree::NODE_TYPE_VALUE
952 <<
"' or '" << ConfigurationTree::NODE_TYPE_UID_LINK <<
".'" << __E__;
965 return tableView_->getColumnInfo(col_).getDataType();
967 return TableViewColumnInfo::DATATYPE_STRING;
980 if(
getValueType() == TableViewColumnInfo::TYPE_ON_OFF ||
981 getValueType() == TableViewColumnInfo::TYPE_TRUE_FALSE ||
984 TableViewColumnInfo::DATATYPE_BOOL_DEFAULT;
986 else if(
getValueType() == TableViewColumnInfo::TYPE_COMMENT)
987 return getValueAsString() == TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT ||
991 return getValueAsString() == TableViewColumnInfo::DATATYPE_STRING_DEFAULT ||
1010 __SS__ <<
"Can only get default value from a value node! "
1011 <<
"The node type is " << getNodeType() << __E__;
1019 if(
getValueType() == TableViewColumnInfo::TYPE_ON_OFF ||
1020 getValueType() == TableViewColumnInfo::TYPE_TRUE_FALSE ||
1022 return TableViewColumnInfo::DATATYPE_BOOL_DEFAULT;
1024 else if(
getValueType() == TableViewColumnInfo::TYPE_COMMENT)
1025 return TableViewColumnInfo::
1026 DATATYPE_COMMENT_DEFAULT;
1028 return TableViewColumnInfo::DATATYPE_STRING_DEFAULT;
1031 return TableViewColumnInfo::DATATYPE_NUMBER_DEFAULT;
1033 return TableViewColumnInfo::DATATYPE_TIME_DEFAULT;
1036 __SS__ <<
"Can only get default value from a value node! "
1037 <<
"The node type is " << getNodeType() << __E__;
1050 return tableView_->getColumnInfo(col_).getType();
1052 return ConfigurationTree::VALUE_TYPE_DISCONNECTED;
1054 return ConfigurationTree::VALUE_TYPE_NODE;
1063 return tableView_->getColumnInfo(col_);
1066 __SS__ <<
"Can only get column info from a value node! "
1067 <<
"The node type is " << getNodeType() << __E__;
1090 return linkBackRow_;
1104 return linkBackCol_;
1116 __SS__ <<
"Can only get link ID from a link! "
1117 <<
"The node type is " << getNodeType() << __E__;
1122 return childLinkIndex_;
1131 return tableView_->getColumnInfo(col_).getName();
1133 return linkColName_;
1136 __SS__ <<
"Can only get value name of a value node!" << __E__;
1147 const std::string& childPath,
1148 bool doNotThrowOnBrokenUIDLinks,
1149 const std::string& originalNodeString)
1151 __COUTS__(50) << tree.row_ <<
" " << tree.col_ << __E__;
1152 __COUTS__(51) <<
"childPath=" << childPath <<
" " << childPath.length() << __E__;
1153 if(childPath.length() <= 1)
1155 return tree.recursiveGetNode(
1156 childPath, doNotThrowOnBrokenUIDLinks, originalNodeString);
1170 bool doNotThrowOnBrokenUIDLinks)
const
1173 return recursiveGetNode(
1174 nodeString, doNotThrowOnBrokenUIDLinks,
"" );
1177 const std::string& nodeString,
1178 bool doNotThrowOnBrokenUIDLinks,
1179 const std::string& originalNodeString)
const
1181 __COUTS__(51) <<
"nodeString=" << nodeString <<
" len=" << nodeString.length()
1183 __COUTS__(52) <<
"doNotThrowOnBrokenUIDLinks=" << doNotThrowOnBrokenUIDLinks << __E__;
1186 if(nodeString.length() < 1)
1188 __SS__ <<
"Invalid empty node name! Looking for child node '" << nodeString
1189 <<
"' from node '" <<
getValue() <<
"'..." << __E__;
1196 size_t startingIndex = 0;
1197 while(startingIndex < nodeString.length() && nodeString[startingIndex] ==
'/')
1199 size_t endingIndex = nodeString.find(
'/', startingIndex);
1200 if(endingIndex == std::string::npos)
1201 endingIndex = nodeString.length();
1203 std::string nodeName = nodeString.substr(startingIndex, endingIndex - startingIndex);
1204 __COUTS__(51) <<
"nodeName=" << nodeName <<
" len=" << nodeName.length() << __E__;
1207 std::string childPath =
1208 (endingIndex >= nodeString.length() ?
"" : nodeString.substr(endingIndex));
1209 __COUTS__(51) <<
"childPath=" << childPath <<
" len=" << childPath.length()
1210 <<
" endingIndex=" << endingIndex
1211 <<
" nodeString.length()=" << nodeString.length() << __E__;
1217 __COUTS__(50) << row_ <<
" " << col_ <<
" " << groupId_ <<
" " << tableView_
1223 return recurse(configMgr_->
getNode(nodeName),
1225 doNotThrowOnBrokenUIDLinks,
1226 originalNodeString);
1228 else if(row_ == TableView::INVALID && col_ == TableView::INVALID)
1234 __SS__ <<
"Missing configView pointer! Likely attempting to access a "
1235 "child node through a disconnected link node."
1251 TableView::INVALID ,
1252 TableView::INVALID ,
1264 doNotThrowOnBrokenUIDLinks,
1265 originalNodeString);
1267 else if(row_ == TableView::INVALID)
1269 __SS__ <<
"Malformed ConfigurationTree" << __E__;
1274 else if(col_ == TableView::INVALID)
1279 __COUTS__(51) <<
"nodeName=" << nodeName <<
" " << nodeName.length() << __E__;
1289 __SS__ <<
"Missing configView pointer! Likely attempting to access a "
1290 "child node through a disconnected link node."
1297 unsigned int c = tableView_->
findCol(nodeName);
1298 std::pair<
unsigned int ,
unsigned int > linkPair;
1299 bool isGroupLink, isLink;
1300 if((isLink = tableView_->
getChildLink(c, isGroupLink, linkPair)) &&
1303 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1313 tableView_->getDataView()[row_][linkPair.first]);
1314 childConfig->getView();
1316 if(doNotThrowOnBrokenUIDLinks)
1318 childConfig->getView().
findRow(
1320 tableView_->getDataView()[row_][linkPair.second]);
1326 <<
"Found disconnected node! (" << nodeName <<
":"
1327 << tableView_->getDataView()[row_][linkPair.first] <<
")"
1328 <<
" at entry with UID "
1329 << tableView_->getDataView()[row_][tableView_->
getColUID()]
1338 tableView_->getDataView()[row_][c],
1343 tableView_->getDataView()[row_][linkPair.first],
1346 tableView_->getDataView()[row_][linkPair.second],
1359 tableView_->getDataView()[row_][c],
1367 childConfig->getView().
findRow(
1369 tableView_->getDataView()[row_][linkPair.second])),
1371 doNotThrowOnBrokenUIDLinks,
1372 originalNodeString);
1376 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1386 tableView_->getDataView()[row_][linkPair.first]);
1387 childConfig->getView();
1391 if(tableView_->getDataView()[row_][linkPair.first] !=
1392 TableViewColumnInfo::DATATYPE_LINK_DEFAULT)
1394 <<
"Found disconnected node! Failed link target "
1396 << nodeName <<
" to table:id="
1397 << tableView_->getDataView()[row_][linkPair.first] <<
":"
1398 << tableView_->getDataView()[row_][linkPair.second] << __E__;
1404 tableView_->getDataView()[row_][linkPair.second],
1407 tableView_->getDataView()[row_][c],
1412 tableView_->getDataView()[row_][linkPair.first],
1415 tableView_->getDataView()[row_][linkPair.second],
1426 ->getDataView()[row_][linkPair.second],
1429 tableView_->getDataView()[row_][c],
1438 doNotThrowOnBrokenUIDLinks,
1439 originalNodeString);
1443 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1452 TableView::INVALID ,
1453 TableView::INVALID ,
1462 catch(std::runtime_error& e)
1464 __SS__ <<
"\n\nError occurred descending from node '" <<
getValue()
1465 <<
"' in table '" <<
getTableName() <<
"' looking for child '" << nodeName
1468 ss <<
"The original node search string was '" << originalNodeString <<
".'"
1470 ss <<
"--- Additional error detail: \n\n" << e.what() << __E__;
1477 __SS__ <<
"\n\nError occurred descending from node '" <<
getValue()
1478 <<
"' in table '" <<
getTableName() <<
"' looking for child '" << nodeName
1481 ss <<
"The original node search string was '" << originalNodeString <<
".'"
1487 catch(
const std::exception& e)
1489 ss <<
"Exception message: " << e.what();
1500 <<
"\n\nError occurred descending from node '" <<
getValue() <<
"' in table '"
1501 <<
getTableName() <<
"' looking for child '" << nodeName <<
"'\n\n"
1502 <<
"Invalid depth! getNode() called from a value point in the Configuration Tree."
1504 ss <<
"The original node search string was '" << originalNodeString <<
".'" << __E__;
1513 const std::string& nodeString)
const
1515 if(nodeString.length() < 1)
1530 if(!forcePrintout && time(0) - ConfigurationTree::LAST_NODE_DUMP_TIME < 3)
1532 __COUTS__(20) <<
"Blocking cascading node dumps... "
1533 "ConfigurationTree::LAST_NODE_DUMP_TIME = "
1534 << ConfigurationTree::LAST_NODE_DUMP_TIME << __E__;
1537 ConfigurationTree::LAST_NODE_DUMP_TIME = time(0);
1539 __SS__ << __E__ << __E__;
1541 ss <<
"Row=" << (int)row_ <<
", Col=" << (
int)col_ <<
", TablePointer=" << table_
1553 ss <<
"ConfigurationTree::nodeDump() start"
1554 "=====================================\nConfigurationTree::nodeDump():"
1561 <<
"Node dump initiated from node '" <<
getValueAsString() <<
"'..." << __E__;
1569 <<
"Node dump initiated from node '" <<
getValue() <<
"' in table '"
1584 <<
"Here is the list of possible children (count = " << children.size()
1586 for(
auto& child : children)
1587 ss <<
"\t\t" << child << __E__;
1590 ss <<
"\n\nHere is the culprit table printout:\n\n";
1591 tableView_->print(ss);
1597 ss <<
"Is link node." << __E__;
1598 ss <<
"disconnectedTargetName_ = " << disconnectedTargetName_
1599 <<
", disconnectedLinkID_ = " << disconnectedLinkID_ << __E__;
1603 <<
"Here is the list of active tables:" << __E__;
1604 for(
auto& table : tables)
1605 ss <<
"\t\t" << table.first << __E__;
1612 ss <<
"\n\nConfigurationTree::nodeDump() end ====================================="
1620 unsigned int backSteps)
const
1622 for(
unsigned int i = 0; i < backSteps; i++)
1623 nodeName = nodeName.substr(0, nodeName.find_last_of(
'/'));
1630 unsigned int forwardSteps)
const
1635 while(s < nodeName.length() && nodeName[s] ==
'/')
1638 for(
unsigned int i = 0; i < forwardSteps; i++)
1639 s = nodeName.find(
'/', s) + 1;
1641 return getNode(nodeName.substr(0, s));
1649 return (row_ != TableView::INVALID && col_ != TableView::INVALID);
1677 __SS__ <<
"\n\nError occurred testing link connection at node with value '"
1680 ss <<
"This is not a Link node! It is node type '" << getNodeType()
1681 <<
".' Only a Link node can be disconnected." << __E__;
1687 return !table_ || !tableView_;
1699 const std::string ConfigurationTree::NODE_TYPE_TABLE =
"TableNode";
1700 const std::string ConfigurationTree::NODE_TYPE_GROUP_LINK =
"GroupLinkNode";
1701 const std::string ConfigurationTree::NODE_TYPE_UID_LINK =
"UIDLinkNode";
1702 const std::string ConfigurationTree::NODE_TYPE_VALUE =
"ValueNode";
1703 const std::string ConfigurationTree::NODE_TYPE_UID =
"UIDNode";
1704 const std::string ConfigurationTree::NODE_TYPE_ROOT =
"RootNode";
1706 std::string ConfigurationTree::getNodeType(
void)
const
1709 return ConfigurationTree::NODE_TYPE_ROOT;
1710 if(isTableNode() && groupId_ !=
"")
1713 return ConfigurationTree::NODE_TYPE_TABLE;
1715 return ConfigurationTree::NODE_TYPE_GROUP_LINK;
1717 return ConfigurationTree::NODE_TYPE_UID_LINK;
1719 return ConfigurationTree::NODE_TYPE_VALUE;
1720 return ConfigurationTree::NODE_TYPE_UID;
1752 return (row_ != TableView::INVALID && col_ == TableView::INVALID);
1772 const std::vector<std::string /*uid*/>& recordList,
1773 const std::vector<std::string /*relative-path*/>& fieldAcceptList,
1774 const std::vector<std::string /*relative-path*/>& fieldRejectList,
1776 bool autoSelectFilterFields)
const
1779 if(!isRootNode() && !isTableNode())
1781 __SS__ <<
"Can only get getCommonFields from a root or table node! "
1782 <<
"The node type is " << getNodeType() << __E__;
1788 std::vector<ConfigurationTree::RecordField> fieldCandidateList;
1789 std::vector<int> fieldCount;
1833 if(!recordList.size() && tableView_)
1835 const std::vector<TableViewColumnInfo>& colInfo = tableView_->getColumnsInfo();
1837 for(
unsigned int col = 0; col < colInfo.size(); ++col)
1839 __COUTS__(11) <<
"Considering field " << colInfo[col].getName() << __E__;
1842 found = fieldAcceptList.size() ? false :
true;
1844 for(
const auto& fieldFilter : fieldAcceptList)
1856 for(
const auto& fieldFilter : fieldRejectList)
1867 __COUTS__(11) <<
"FOUND field " << colInfo[col].getName() << __E__;
1869 if(colInfo[col].isChildLink())
1872 <<
"isGroupLinkNode " << colInfo[col].getName() << __E__;
1876 std::pair<
unsigned int ,
unsigned int >
1886 tableView_->getColumnInfo(linkPair.first).getName(),
1888 &tableView_->getColumnInfo(linkPair.first)));
1889 fieldCount.push_back(-1);
1894 tableView_->getColumnInfo(linkPair.second).getName(),
1896 &tableView_->getColumnInfo(linkPair.second)));
1897 fieldCount.push_back(-1);
1904 colInfo[col].getName(),
1907 fieldCount.push_back(1);
1913 for(
unsigned int i = 0; i < recordList.size(); ++i)
1915 __COUTS__(11) <<
"Checking " << recordList[i] << __E__;
1918 node.recursiveGetCommonFields(fieldCandidateList,
1929 __COUT__ <<
"======================= check for count = " << (int)recordList.size()
1934 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1936 __COUTS__(11) <<
"Checking " << fieldCandidateList[i].relativePath_
1937 << fieldCandidateList[i].columnName_ <<
" = " << fieldCount[i]
1939 if(recordList.size() != 0 && fieldCount[i] != -1 &&
1940 fieldCount[i] != (
int)recordList.size())
1942 __COUTS__(11) <<
"Erasing " << fieldCandidateList[i].relativePath_
1943 << fieldCandidateList[i].columnName_ << __E__;
1945 fieldCount.erase(fieldCount.begin() + i);
1946 fieldCandidateList.erase(fieldCandidateList.begin() + i);
1951 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1952 __COUTS__(11) <<
"Pre-Final " << fieldCandidateList[i].relativePath_
1953 << fieldCandidateList[i].columnName_ << __E__;
1955 if(autoSelectFilterFields)
1959 std::set<std::pair<
unsigned int ,
unsigned int >>
1962 unsigned int priorityPenalty;
1963 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1965 __COUTS__(11) <<
"Option [" << i <<
"] "
1966 << fieldCandidateList[i].relativePath_
1967 << fieldCandidateList[i].columnName_ <<
" : "
1968 << fieldCandidateList[i].columnInfo_->getType() <<
":"
1969 << fieldCandidateList[i].columnInfo_->getDataType() << __E__;
1971 priorityPenalty = std::count(fieldCandidateList[i].relativePath_.begin(),
1972 fieldCandidateList[i].relativePath_.end(),
1976 if(fieldCandidateList[i].columnInfo_->isBoolType() &&
1977 (fieldCandidateList[i].columnName_ ==
1978 TableViewColumnInfo::COL_NAME_STATUS ||
1979 fieldCandidateList[i].columnName_ ==
1980 TableViewColumnInfo::COL_NAME_ENABLED))
1982 priorityPenalty += 0;
1984 else if(fieldCandidateList[i].columnInfo_->isGroupID())
1986 priorityPenalty += 1;
1988 else if(fieldCandidateList[i].columnInfo_->isBoolType())
1990 priorityPenalty += 3;
1992 else if(fieldCandidateList[i].columnInfo_->getType() ==
1993 TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA)
1995 priorityPenalty += 3;
1997 else if(fieldCandidateList[i].columnInfo_->getType() ==
1998 TableViewColumnInfo::TYPE_DATA)
2000 priorityPenalty += 10;
2004 fieldCandidateList[i].tableName_ =
2008 prioritySet.emplace(
2009 std::make_pair(priorityPenalty , i ));
2010 __COUTS__(11) <<
"Option [" << i <<
"] "
2011 << fieldCandidateList[i].relativePath_
2012 << fieldCandidateList[i].columnName_ <<
" : "
2013 << fieldCandidateList[i].columnInfo_->getType() <<
":"
2014 << fieldCandidateList[i].columnInfo_->getDataType()
2015 <<
"... priority = " << priorityPenalty << __E__;
2024 unsigned int cnt = 0;
2025 for(
const auto& priorityFieldIndex : prioritySet)
2029 << cnt <<
" marking "
2030 << fieldCandidateList[priorityFieldIndex.second].relativePath_
2031 << fieldCandidateList[priorityFieldIndex.second].columnName_
2033 fieldCandidateList[priorityFieldIndex.second].tableName_ =
2038 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
2040 if(fieldCandidateList[i].tableName_ ==
"")
2042 __COUTS__(11) <<
"Erasing " << fieldCandidateList[i].relativePath_
2043 << fieldCandidateList[i].columnName_ << __E__;
2044 fieldCandidateList.erase(fieldCandidateList.begin() + i);
2050 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
2051 __COUT__ <<
"Final " << fieldCandidateList[i].relativePath_
2052 << fieldCandidateList[i].columnName_ << __E__;
2054 return fieldCandidateList;
2064 const std::vector<std::string /*relative-path*/>& recordList,
2065 const std::string& fieldName,
2066 std::string* fieldGroupIDChildLinkIndex )
const
2068 if(fieldGroupIDChildLinkIndex)
2069 *fieldGroupIDChildLinkIndex =
"";
2074 __SS__ <<
"Can only get getCommonFields from a table node! "
2075 <<
"The node type is " << getNodeType() << __E__;
2081 std::set<std::string > uniqueValues;
2089 if(!recordList.size() && tableView_ && fieldGroupIDChildLinkIndex)
2092 tableView_->getColumnInfo(tableView_->
findCol(fieldName));
2099 for(
unsigned int i = 0; i < recordList.size(); ++i)
2119 if(i == 0 && fieldGroupIDChildLinkIndex)
2125 for(
auto& groupID : setOfGroupIDs)
2126 uniqueValues.emplace(groupID);
2133 return uniqueValues;
2139 void ConfigurationTree::recursiveGetCommonFields(
2140 std::vector<ConfigurationTree::RecordField>& fieldCandidateList,
2141 std::vector<int>& fieldCount,
2142 const std::vector<std::string /*relative-path*/>& fieldAcceptList,
2143 const std::vector<std::string /*relative-path*/>& fieldRejectList,
2145 const std::string& relativePathBase,
2146 bool inFirstRecord)
const
2179 for(
const auto& fieldNode : recordChildren)
2185 if(fieldNode.second.isValueNode() || fieldNode.second.isGroupLinkNode())
2188 if(fieldNode.second.isValueNode())
2190 if(fieldNode.second.getColumnInfo().getType() ==
2191 TableViewColumnInfo::TYPE_AUTHOR ||
2192 fieldNode.second.getColumnInfo().getType() ==
2193 TableViewColumnInfo::TYPE_TIMESTAMP)
2206 found = fieldAcceptList.size() ? false :
true;
2208 for(
const auto& fieldFilter : fieldAcceptList)
2209 if(fieldFilter.find(
'/') != std::string::npos)
2213 fieldFilter, relativePathBase + fieldNode.first))
2230 for(
const auto& fieldFilter : fieldRejectList)
2231 if(fieldFilter.find(
'/') != std::string::npos)
2235 fieldFilter, relativePathBase + fieldNode.first))
2254 if(fieldNode.second.isGroupLinkNode())
2260 std::pair<
unsigned int ,
unsigned int >
2264 tableView_->
findCol(fieldNode.first), isGroupLink, linkPair);
2271 tableView_->getColumnInfo(linkPair.first).getName(),
2273 &tableView_->getColumnInfo(linkPair.first)));
2274 fieldCount.push_back(1);
2279 tableView_->getColumnInfo(linkPair.second).getName(),
2281 &tableView_->getColumnInfo(linkPair.second)));
2282 fieldCount.push_back(1);
2291 &fieldNode.second.getColumnInfo()));
2292 fieldCount.push_back(1);
2300 for(j = 0; j < fieldCandidateList.size(); ++j)
2302 if((relativePathBase + fieldNode.first) ==
2303 (fieldCandidateList[j].relativePath_ +
2304 fieldCandidateList[j].columnName_))
2310 if(fieldNode.second.isGroupLinkNode() &&
2311 j + 1 < fieldCandidateList.size())
2312 ++fieldCount[j + 1];
2318 else if(fieldNode.second.isUIDLinkNode())
2327 fieldAcceptList.size() ? false :
true;
2328 for(
const auto& fieldFilter : fieldAcceptList)
2329 if(fieldFilter.find(
'/') != std::string::npos)
2333 fieldFilter, relativePathBase + fieldNode.first))
2350 for(
const auto& fieldFilter : fieldRejectList)
2351 if(fieldFilter.find(
'/') != std::string::npos)
2355 fieldFilter, relativePathBase + fieldNode.first))
2373 std::pair<
unsigned int ,
unsigned int >
2379 tableView_->
findCol(fieldNode.first), isGroupLink, linkPair);
2386 tableView_->getColumnInfo(linkPair.first).getName(),
2388 &tableView_->getColumnInfo(linkPair.first)));
2389 fieldCount.push_back(1);
2394 tableView_->getColumnInfo(linkPair.second).getName(),
2396 &tableView_->getColumnInfo(linkPair.second)));
2397 fieldCount.push_back(1);
2404 for(j = 0; j < fieldCandidateList.size() - 1; ++j)
2406 if((relativePathBase + fieldNode.first) ==
2407 (fieldCandidateList[j].relativePath_ +
2408 fieldCandidateList[j].columnName_))
2414 ++fieldCount[j + 1];
2421 if(depth > 0 && !fieldNode.second.isDisconnected())
2422 fieldNode.second.recursiveGetCommonFields(
2428 (relativePathBase + fieldNode.first) +
"/",
2441 std::vector<std::vector<std::pair<std::string, ConfigurationTree>>>
2443 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2444 bool onlyStatusTrue)
const
2446 std::vector<std::vector<std::pair<std::string, ConfigurationTree>>> retVector;
2450 bool filtering = filterMap.size();
2451 std::string fieldValue;
2453 bool createContainer;
2455 std::vector<std::vector<std::string>> childrenNamesByPriority =
2458 for(
auto& childNamesAtPriority : childrenNamesByPriority)
2460 createContainer =
true;
2462 for(
auto& childName : childNamesAtPriority)
2472 retVector.push_back(
2473 std::vector<std::pair<std::string, ConfigurationTree>>());
2474 createContainer =
false;
2477 retVector[retVector.size() - 1].push_back(
2478 std::pair<std::string, ConfigurationTree>(
2479 childName, this->
getNode(childName,
true)));
2491 const std::string& childName,
2492 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap)
const
2498 for(
const auto& filterPair : filterMap)
2500 std::string filterPath = childName +
"/" + filterPair.first;
2501 __COUTV__(filterPath);
2507 std::vector<std::string> fieldValues;
2509 filterPair.second, fieldValues, std::set<char>({
','}) );
2511 __COUTV__(fieldValues.size());
2515 for(
const auto& fieldValue : fieldValues)
2529 bool groupIdFound =
false;
2532 for(
auto& groupID : setOfGroupIDs)
2534 __COUT__ <<
"\t\tGroupID Check: " << filterPair.first
2535 <<
" == " << fieldValue <<
" => "
2537 <<
" ??? " << groupID << __E__;
2543 __COUT__ <<
"Found match" << __E__;
2544 groupIdFound =
true;
2552 __COUT__ <<
"Found break match" << __E__;
2559 __COUT__ <<
"\t\tCheck: " << filterPair.first <<
" == " << fieldValue
2576 __SS__ <<
"Failed to access filter path '" << filterPath <<
"' - aborting."
2600 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2602 bool onlyStatusTrue)
const
2604 std::vector<std::pair<std::string, ConfigurationTree>> retVector;
2608 bool filtering = filterMap.size();
2610 std::string fieldValue;
2612 std::vector<std::string> childrenNames =
getChildrenNames(byPriority, onlyStatusTrue);
2614 for(
auto& childName : childrenNames)
2620 retVector.push_back(std::pair<std::string, ConfigurationTree>(
2621 childName, this->
getNode(childName,
true)));
2624 __COUTS__(2) <<
"Done w/Children of node: " <<
getValueAsString() << __E__;
2633 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2634 bool onlyStatusTrue)
const
2636 std::map<std::string, ConfigurationTree> retMap;
2638 bool filtering = filterMap.size();
2641 std::vector<std::string> childrenNames =
2643 for(
auto& childName : childrenNames)
2651 retMap.insert(std::pair<std::string, ConfigurationTree>(
2652 childName, this->
getNode(childName)));
2666 <<
".' Can only check the status of a UID/Record node!" << __E__;
2671 bool tmpStatus =
true;
2676 catch(
const std::runtime_error& e)
2685 bool ConfigurationTree::isStatusNode(
void)
const
2697 bool onlyStatusTrue)
const
2699 std::vector<std::vector<std::string >> retVector;
2704 <<
"' with null configuration view pointer!" << __E__;
2713 if(row_ == TableView::INVALID && col_ == TableView::INVALID)
2720 std::vector<std::vector<
unsigned int >> groupRowsByPriority =
2723 ? TableView::INVALID
2730 for(
const auto& priorityChildRowVector : groupRowsByPriority)
2732 retVector.push_back(std::vector<std::string /*child name*/>());
2733 for(
const auto& priorityChildRow : priorityChildRowVector)
2734 retVector[retVector.size() - 1].push_back(
2735 tableView_->getDataView()[priorityChildRow][tableView_->
getColUID()]);
2738 else if(row_ == TableView::INVALID)
2740 __SS__ <<
"Malformed ConfigurationTree" << __E__;
2745 else if(col_ == TableView::INVALID)
2750 for(
unsigned int c = 0; c < tableView_->getNumberOfColumns(); ++c)
2758 retVector.push_back(std::vector<std::string /*child name*/>());
2759 retVector[retVector.size() - 1].push_back(
2760 tableView_->getColumnInfo(c).getName());
2766 __SS__ <<
"\n\nError occurred looking for children of nodeName=" <<
getValueName()
2768 <<
"Invalid depth! getChildrenValues() called from a value point in the "
2769 "Configuration Tree."
2783 bool byPriority ,
bool onlyStatusTrue )
const
2785 std::vector<std::string > retVector;
2793 retVector.push_back(configPair.first);
2800 __SS__ <<
"Can not get children names of '" <<
getFieldName() <<
":"
2809 if(row_ == TableView::INVALID && col_ == TableView::INVALID)
2813 std::vector<
unsigned int > groupRows = tableView_->
getGroupRows(
2815 ? TableView::INVALID
2823 for(
const auto& groupRow : groupRows)
2824 retVector.push_back(
2825 tableView_->getDataView()[groupRow][tableView_->
getColUID()]);
2892 else if(row_ == TableView::INVALID)
2894 __SS__ <<
"Malformed ConfigurationTree" << __E__;
2899 else if(col_ == TableView::INVALID)
2904 for(
unsigned int c = 0; c < tableView_->getNumberOfColumns(); ++c)
2911 retVector.push_back(tableView_->getColumnInfo(c).getName());
2916 __SS__ <<
"\n\nError occurred looking for children of nodeName=" <<
getValueName()
2918 <<
"Invalid depth! getChildrenValues() called from a value point in the "
2919 "Configuration Tree."
2940 __SS__ <<
"Invalid node for get value." << __E__;
2944 std::string valueString =
2947 if(valueString.size() && valueString[0] ==
'/')
2954 __COUT__ <<
"Found a valid tree path in value!" << __E__;
2959 __SS__ <<
"Invalid tree path." << __E__;
2965 __SS__ <<
"Invalid value string '" << valueString
2966 <<
"' - must start with a '/' character." << __E__;
std::map< std::string, TableVersion > getActiveVersions(void) const
getActiveVersions
ConfigurationTree getNode(const std::string &nodeString, bool doNotThrowOnBrokenUIDLinks=false) const
"root/parent/parent/"
const TableBase * getTableByName(const std::string &configurationName) const
const unsigned int & getRow(void) const
getRow
const std::string & getValueDataType(void) const
bool isUIDNode(void) const
std::map< std::string, ConfigurationTree > getNodes(const std::string &nodeString) const
getNodes
const TableVersion & getTableVersion(void) const
getTableVersion
bool isDisconnected(void) const
const std::string & getAuthor(void) const
getAuthor
const std::string & getComment(void) const
getComment
std::vector< std::string > getChildrenNames(bool byPriority=false, bool onlyStatusTrue=false) const
bool isEnabled(void) const
same as status()
static const std::string NODE_TYPE_GROUP_TABLE
bool isValueNumberDataType(void) const
ConfigurationTree getNode(const std::string &nodeName, bool doNotThrowOnBrokenUIDLinks=false) const
navigating between nodes
const std::string & getTableName(void) const
getTableName
T getValueWithDefault(const T &defaultValue) const
const unsigned int & getFieldRow(void) const
std::map< std::string, ConfigurationTree > getChildrenMap(std::map< std::string, std::string > filterMap=std::map< std::string, std::string >(), bool onlyStatusTrue=false) const
std::string nodeDump(bool forcePrintout=false) const
used for debugging (when throwing exception)
const std::string & getValueName(void) const
const std::string & getValueAsString(bool returnLinkTableValue=false) const
const ConfigurationManager * getConfigurationManager(void) const
extracting information from node
const std::string & getChildLinkIndex(void) const
getChildLinkIndex
void print(const unsigned int &depth=-1, std::ostream &out=std::cout) const
bool isGroupIDNode(void) const
const std::string & getDisconnectedTableName(void) const
getDisconnectedTableName
bool isValueBoolType(void) const
std::vector< std::pair< std::string, ConfigurationTree > > getChildren(std::map< std::string, std::string > filterMap=std::map< std::string, std::string >(), bool byPriority=false, bool onlyStatusTrue=false) const
std::vector< std::string > getFixedChoices(void) const
bool hasComment(void) const
hasComment
bool isLinkNode(void) const
const std::string & getDefaultValue(void) const
const time_t & getTableCreationTime(void) const
getTableCreationTime
std::string getParentLinkIndex(void) const
getParentLinkIndex
const std::string & getUIDAsString(void) const
std::vector< ConfigurationTree::RecordField > getCommonFields(const std::vector< std::string > &recordList, const std::vector< std::string > &fieldAcceptList, const std::vector< std::string > &fieldRejectList, unsigned int depth=-1, bool autoSelectFilterFields=false) const
const unsigned int & getNodeRow(void) const
getNodeRow
std::set< std::string > getSetOfGroupIDs(void) const
bool isValueNode(void) const
const std::string & getFieldName(void) const
alias for getValueName
std::vector< std::vector< std::string > > getChildrenNamesByPriority(bool onlyStatusTrue=false) const
std::set< std::string > getUniqueValuesForField(const std::vector< std::string > &recordList, const std::string &fieldName, std::string *fieldGroupIDChildLinkIndex=0) const
const std::string & getValueType(void) const
bool passFilterMap(const std::string &childName, std::map< std::string, std::string > filterMap) const
~ConfigurationTree(void)
destructor
bool isGroupLinkNode(void) const
std::string getParentLinkID(void) const
getParentLinkID
const std::string & getFieldTableName(void) const
const unsigned int & getColumn(void) const
getColumn
const std::string & getDisconnectedLinkID(void) const
getDisconnectedLinkID
const std::string & getParentTableName(void) const
getParentTableName
bool isUIDLinkNode(void) const
const std::string & getParentRecordName(void) const
getParentRecordName
std::string getEscapedValue(void) const
const TableViewColumnInfo & getColumnInfo(void) const
bool isDefaultValue(void) const
boolean info
std::vector< std::vector< std::pair< std::string, ConfigurationTree > > > getChildrenByPriority(std::map< std::string, std::string > filterMap=std::map< std::string, std::string >(), bool onlyStatusTrue=false) const
const std::string & getParentLinkColumnName(void) const
getParentLinkColumnName
T getValue(void) const
defined in included .icc source
const unsigned int & getFieldColumn(void) const
const std::string & getTableName(void) const
Getters.
bool isChildLinkUID(void) const
static const std::string DATATYPE_NUMBER
std::string getChildLinkIndex(void) const
getChildLinkIndex
bool isGroupID(void) const
static const std::string TYPE_UID
NOTE: Do NOT put '-' in static const TYPEs because it will mess up javascript handling in the web gui...
const BitMapInfo & getBitMapInfo(void) const
uses dataChoices CSV fields if type is TYPE_BITMAP_DATA
bool isBoolType(void) const
TODO check if min and max values need a function called getallminmaxforgui or something like that for...
bool isNumberDataType(void) const
isNumberDataType
bool isChildLinkGroupID(void) const
const std::string & getDefaultValue(void) const
returns the configued default value value for this particular column
unsigned int findRow(unsigned int col, const T &value, unsigned int offsetRow=0, bool doNotThrow=false) const
< in included .icc source
std::string getEscapedValueAsString(unsigned int row, unsigned int col, bool convertEnvironmentVariables=true, bool quotesToDoubleQuotes=false) const
std::vector< std::vector< unsigned int > > getGroupRowsByPriority(const unsigned int groupIdCol, const std::string &groupID, bool onlyStatusTrue=false) const
T validateValueForColumn(const std::string &value, unsigned int col, bool doConvertEnvironmentVariables=true) const
< in included .icc source
unsigned int getColStatus(void) const
unsigned int getLinkGroupIDColumn(const std::string &childLinkIndex) const
bool getChildLink(const unsigned int &col, bool &isGroup, std::pair< unsigned int, unsigned int > &linkPair) const
std::string getValueAsString(unsigned int row, unsigned int col, bool convertEnvironmentVariables=true) const
std::vector< unsigned int > getGroupRows(const unsigned int groupIdCol, const std::string &groupID, bool onlyStatusTrue=false, bool orderedByPriority=false) const
std::set< std::string > getSetOfGroupIDs(const std::string &childLinkIndex, unsigned int row=-1) const
void getValue(T &value, unsigned int row, unsigned int col, bool doConvertEnvironmentVariables=true) const
< in included .icc source
unsigned int getColUID(void) const
unsigned int findCol(const std::string &name) const
unsigned int findRowInGroup(unsigned int col, const T &value, const std::string &groupId, const std::string &childLinkIndex, unsigned int offsetRow=0) const
< in included .icc source
defines used also by OtsConfigurationWizardSupervisor
extracting information from a list of records
static void getVectorFromString(const std::string &inputString, std::vector< std::string > &listToReturn, const std::set< char > &delimiter={',', '|', '&'}, const std::set< char > &whitespace={' ', '\t', '\n', '\r'}, std::vector< char > *listOfDelimiters=0, bool decodeURIComponents=false)
static std::string setToString(const std::set< T > &setToReturn, const std::string &delimeter=", ")
setToString ~
static std::string vectorToString(const std::vector< T > &setToReturn, const std::string &delimeter=", ")
vectorToString ~
static std::string mapToString(const std::map< std::string, T > &mapToReturn, const std::string &primaryDelimeter=", ", const std::string &secondaryDelimeter=": ")
static bool wildCardMatch(const std::string &needle, const std::string &haystack, unsigned int *priorityIndex=0)
static std::string decodeURIComponent(const std::string &data)
static std::string stackTrace(void)