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 __COUTV__(bitmapString);
321 if(bitmapString == TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
323 bitmap.isDefault_ =
true;
325 for(
unsigned int r = 0; r < bmp.numOfRows_; ++r)
327 bitmap.bitmap_.push_back(std::vector<std::string>());
328 for(
unsigned int c = 0; c < bmp.numOfColumns_; ++c)
329 bitmap.bitmap_[r].push_back(std::string());
334 bitmap.isDefault_ =
false;
338 std::map<std::string, size_t> valueMap;
339 if(bmp.mapsToStrings_)
341 std::vector<std::string> list =
344 for(
size_t i = 0; i < list.size(); ++i)
345 valueMap.emplace(std::make_pair(list[i], i));
351 bitmap.bitmap_.clear();
353 bool openRow =
false;
354 unsigned int startInt = -1;
355 for(
unsigned int i = 0; i < bitmapString.length(); i++)
357 __COUTVS__(2, bitmapString[i]);
359 __COUTVS__(2, openRow);
360 __COUTVS__(2, startInt);
365 if(bitmapString[i] ==
'[')
369 bitmap.bitmap_.push_back(std::vector<std::string>());
371 else if(bitmapString[i] ==
']')
375 else if(bitmapString[i] ==
',')
382 else if(startInt == (
unsigned int)-1)
384 if(bitmapString[i] ==
']')
389 else if((bitmapString[i] >=
'0' &&
390 bitmapString[i] <=
'9') ||
391 (bmp.mapsToStrings_ && bitmapString[i] >=
'a' &&
394 (bmp.mapsToStrings_ && bitmapString[i] >=
'A' &&
395 bitmapString[i] <=
'Z'))
399 else if(bitmapString[i] ==
',')
401 __SS__ <<
"Too many ',' characters in bit map configuration"
412 if(bitmapString[i] ==
419 while(ii - startInt > 2 && (bitmapString[ii - 1] ==
' ' ||
420 bitmapString[ii - 1] ==
'\r' ||
421 bitmapString[ii - 1] ==
'\n' ||
422 bitmapString[ii - 1] ==
'\t' ||
423 bitmapString[ii - 1] ==
'"'))
425 __COUTVS__(2, bitmapString.substr(startInt, ii - startInt));
426 if(bmp.mapsToStrings_)
429 valueMap.at(bitmapString.substr(startInt, ii - startInt));
430 __COUTVS__(2, value);
433 bitmap.bitmap_[row].push_back(
434 bitmapString.substr(startInt, ii - startInt));
438 else if(bitmapString[i] ==
',')
442 while(ii - startInt > 2 && (bitmapString[ii - 1] ==
' ' ||
443 bitmapString[ii - 1] ==
'\r' ||
444 bitmapString[ii - 1] ==
'\n' ||
445 bitmapString[ii - 1] ==
'\t' ||
446 bitmapString[ii - 1] ==
'"'))
448 __COUTVS__(2, bitmapString.substr(startInt, ii - startInt));
449 if(bmp.mapsToStrings_)
452 valueMap.at(bitmapString.substr(startInt, ii - startInt));
453 __COUTVS__(2, value);
456 bitmap.bitmap_[row].push_back(
457 bitmapString.substr(startInt, ii - startInt));
466 for(
unsigned int r = 0; r < bitmap.bitmap_.size(); ++r)
468 for(
unsigned int c = 0; c < bitmap.bitmap_[r].size(); ++c)
470 __COUTT__ << r <<
"," << c <<
" = " << bitmap.bitmap_[r][c]
473 __COUTT__ <<
"================" << __E__;
478 if(bitmap.bitmap_.size() != bmp.numOfRows_ ||
479 (bmp.numOfRows_ && bitmap.bitmap_[0].size() != bmp.numOfColumns_))
482 <<
"Illegal mismatch in number of rows and columns. Extracted data was "
483 << bitmap.bitmap_.size() <<
" x "
484 << (bitmap.bitmap_.size() ? bitmap.bitmap_[0].size() : 0)
485 <<
" and the expected size is " << bmp.numOfRows_ <<
" x "
486 << bmp.numOfColumns_ << __E__;
492 __SS__ <<
"Requesting getValue must be on a value node." << __E__;
506 ConfigurationTree::getValueAsBitMap(value);
515 if(row_ != TableView::INVALID &&
516 col_ != TableView::INVALID)
519 __SS__ <<
"Can not get escaped value except from a value node!"
520 <<
" This node is type '" << getNodeType() <<
"." << __E__;
532 __SS__ <<
"Can not get configuration name of node with no configuration pointer! "
533 <<
"Is there a broken link? " << __E__;
536 ss <<
"Error occurred traversing from " << linkParentTable_->
getTableName()
539 linkBackRow_, linkParentTable_->getView().
getColUID())
540 <<
"' at row " << linkBackRow_ <<
" col '"
541 << linkParentTable_->getView().getColumnInfo(linkBackCol_).getName()
559 __SS__ <<
"Can not get parent table name of node with no parent table pointer! "
560 <<
"Was this node initialized correctly? " << __E__;
569 if(linkParentTable_ && linkBackRow_ != TableView::INVALID)
572 return linkParentTable_->getView()
573 .getDataView()[linkBackRow_][linkParentTable_->getView().
getColUID()];
576 __SS__ <<
"Can not get parent record name of node without the parent table pointer "
577 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
578 <<
")! Was this node initialized correctly? " << __E__;
587 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
588 linkBackCol_ != TableView::INVALID)
591 return linkParentTable_->getView().getColumnInfo(linkBackCol_).getName();
595 <<
"Can not get parent link column name of node without the parent table pointer "
596 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
597 <<
") and col (col = " << linkBackCol_
598 <<
")! Was this node initialized correctly? " << __E__;
607 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
608 linkBackCol_ != TableView::INVALID)
612 std::pair<
unsigned int ,
unsigned int > linkPair;
613 linkParentTable_->getView().
getChildLink(linkBackCol_, isGroup, linkPair);
616 linkParentTable_->getView().
getValue(
617 linkId, linkBackRow_, linkPair.second );
622 __SS__ <<
"Can not get parent link ID of node without the parent table pointer "
623 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
624 <<
") and col (col = " << linkBackCol_
625 <<
")! Was this node initialized correctly? " << __E__;
634 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
635 linkBackCol_ != TableView::INVALID)
638 return linkParentTable_->getView()
639 .getColumnInfo(linkBackCol_)
643 __SS__ <<
"Can not get parent link index of node without the parent table pointer "
644 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
645 <<
") and col (col = " << linkBackCol_
646 <<
")! Was this node initialized correctly? " << __E__;
658 __SS__ <<
"Can only get row from a UID or value node!" << __E__;
661 ss <<
"Error occurred traversing from " << linkParentTable_->
getTableName()
664 linkBackRow_, linkParentTable_->getView().
getColUID())
665 <<
"' at row " << linkBackRow_ <<
" col '"
666 << linkParentTable_->getView().getColumnInfo(linkBackCol_).getName() <<
".'"
686 if(!linkParentTable_)
688 __SS__ <<
"Can not get configuration name of link node field with no parent "
689 "configuration pointer!"
705 return disconnectedTargetName_;
707 __SS__ <<
"Can not get disconnected target name of node unless it is a disconnected "
720 return disconnectedLinkID_;
722 __SS__ <<
"Can not get disconnected target name of node unless it is a disconnected "
736 __SS__ <<
"Can not get configuration version of node with no config view pointer!"
742 return tableView_->getVersion();
751 __SS__ <<
"Can not get configuration creation time of node with no config view "
758 return tableView_->getCreationTime();
768 __SS__ <<
"Can not get set of group IDs of node with value type of '"
769 << getNodeType() <<
".' Node must be a GroupID node." << __E__;
785 if(
getValueType() != TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA &&
788 __SS__ <<
"Can not get fixed choices of node with value type of '"
789 <<
getValueType() <<
".' Node must be a link or a value node with type '"
790 << TableViewColumnInfo::TYPE_BITMAP_DATA <<
"' or '"
791 << TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA <<
".'" << __E__;
797 std::vector<std::string> retVec;
801 if(!linkParentTable_)
804 <<
"Can not get fixed choices of node with no parent config view pointer!"
817 const TableView* parentView = &(linkParentTable_->getView());
818 int c = parentView->
findCol(linkColName_);
820 std::pair<
unsigned int ,
unsigned int > linkPair;
825 std::vector<std::string> choices = parentView->getColumnInfo(c).getDataChoices();
826 for(
const auto& choice : choices)
827 retVec.push_back(choice);
834 __SS__ <<
"Can not get fixed choices of node with no config view pointer!"
843 std::vector<std::string> choices = tableView_->getColumnInfo(col_).getDataChoices();
844 for(
const auto& choice : choices)
845 retVec.push_back(choice);
854 auto commentNode =
getNode(TableViewColumnInfo::COL_NAME_COMMENT);
855 std::string comment = commentNode.getValueAsString();
856 return comment !=
"" && comment != TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT &&
857 comment != TableViewColumnInfo::DATATYPE_COMMENT_OLD_DEFAULT &&
858 comment != commentNode.getColumnInfo().getDefaultValue();
866 ? TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT
891 if(returnLinkTableValue)
892 return linkColValue_;
894 return ConfigurationTree::DISCONNECTED_VALUE;
895 else if(row_ == TableView::INVALID &&
896 col_ == TableView::INVALID)
897 return (groupId_ ==
"") ? table_->
getTableName() : groupId_;
898 else if(col_ == TableView::INVALID)
899 return tableView_->getDataView()[row_][tableView_->
getColUID()];
902 __SS__ <<
"Impossible Link." << __E__;
908 else if(row_ != TableView::INVALID &&
909 col_ != TableView::INVALID)
910 return tableView_->getDataView()[row_][col_];
911 else if(row_ == TableView::INVALID &&
912 col_ == TableView::INVALID)
916 return ConfigurationTree::ROOT_NAME;
918 return (groupId_ ==
"") ? table_->
getTableName() : groupId_;
920 else if(row_ == TableView::INVALID)
922 __SS__ <<
"Malformed ConfigurationTree" << __E__;
927 else if(col_ == TableView::INVALID)
928 return tableView_->getDataView()[row_][tableView_->
getColUID()];
931 __SS__ <<
"Impossible." << __E__;
945 return tableView_->getDataView()[row_][tableView_->
getColUID()];
948 __SS__ <<
"Can not get UID of node with type '" << getNodeType()
949 <<
".' Node type must be '" << ConfigurationTree::NODE_TYPE_VALUE
950 <<
"' or '" << ConfigurationTree::NODE_TYPE_UID_LINK <<
".'" << __E__;
963 return tableView_->getColumnInfo(col_).getDataType();
965 return TableViewColumnInfo::DATATYPE_STRING;
978 if(
getValueType() == TableViewColumnInfo::TYPE_ON_OFF ||
979 getValueType() == TableViewColumnInfo::TYPE_TRUE_FALSE ||
982 TableViewColumnInfo::DATATYPE_BOOL_DEFAULT;
984 else if(
getValueType() == TableViewColumnInfo::TYPE_COMMENT)
985 return getValueAsString() == TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT ||
1007 __SS__ <<
"Can only get default value from a value node! "
1008 <<
"The node type is " << getNodeType() << __E__;
1016 if(
getValueType() == TableViewColumnInfo::TYPE_ON_OFF ||
1017 getValueType() == TableViewColumnInfo::TYPE_TRUE_FALSE ||
1019 return TableViewColumnInfo::DATATYPE_BOOL_DEFAULT;
1021 else if(
getValueType() == TableViewColumnInfo::TYPE_COMMENT)
1022 return TableViewColumnInfo::
1023 DATATYPE_COMMENT_DEFAULT;
1025 return TableViewColumnInfo::DATATYPE_STRING_DEFAULT;
1028 return TableViewColumnInfo::DATATYPE_NUMBER_DEFAULT;
1030 return TableViewColumnInfo::DATATYPE_TIME_DEFAULT;
1033 __SS__ <<
"Can only get default value from a value node! "
1034 <<
"The node type is " << getNodeType() << __E__;
1047 return tableView_->getColumnInfo(col_).getType();
1049 return ConfigurationTree::VALUE_TYPE_DISCONNECTED;
1051 return ConfigurationTree::VALUE_TYPE_NODE;
1060 return tableView_->getColumnInfo(col_);
1063 __SS__ <<
"Can only get column info from a value node! "
1064 <<
"The node type is " << getNodeType() << __E__;
1087 return linkBackRow_;
1101 return linkBackCol_;
1113 __SS__ <<
"Can only get link ID from a link! "
1114 <<
"The node type is " << getNodeType() << __E__;
1119 return childLinkIndex_;
1128 return tableView_->getColumnInfo(col_).getName();
1130 return linkColName_;
1133 __SS__ <<
"Can only get value name of a value node!" << __E__;
1144 const std::string& childPath,
1145 bool doNotThrowOnBrokenUIDLinks,
1146 const std::string& originalNodeString)
1148 __COUTS__(50) << tree.row_ <<
" " << tree.col_ << __E__;
1149 __COUTS__(51) <<
"childPath=" << childPath <<
" " << childPath.length() << __E__;
1150 if(childPath.length() <= 1)
1152 return tree.recursiveGetNode(
1153 childPath, doNotThrowOnBrokenUIDLinks, originalNodeString);
1167 bool doNotThrowOnBrokenUIDLinks)
const
1170 return recursiveGetNode(
1171 nodeString, doNotThrowOnBrokenUIDLinks,
"" );
1174 const std::string& nodeString,
1175 bool doNotThrowOnBrokenUIDLinks,
1176 const std::string& originalNodeString)
const
1178 __COUTS__(51) <<
"nodeString=" << nodeString <<
" len=" << nodeString.length()
1180 __COUTS__(52) <<
"doNotThrowOnBrokenUIDLinks=" << doNotThrowOnBrokenUIDLinks << __E__;
1183 if(nodeString.length() < 1)
1185 __SS__ <<
"Invalid empty node name! Looking for child node '" << nodeString
1186 <<
"' from node '" <<
getValue() <<
"'..." << __E__;
1193 size_t startingIndex = 0;
1194 while(startingIndex < nodeString.length() && nodeString[startingIndex] ==
'/')
1196 size_t endingIndex = nodeString.find(
'/', startingIndex);
1197 if(endingIndex == std::string::npos)
1198 endingIndex = nodeString.length();
1200 std::string nodeName = nodeString.substr(startingIndex, endingIndex - startingIndex);
1201 __COUTS__(51) <<
"nodeName=" << nodeName <<
" len=" << nodeName.length() << __E__;
1204 std::string childPath =
1205 (endingIndex >= nodeString.length() ?
"" : nodeString.substr(endingIndex));
1206 __COUTS__(51) <<
"childPath=" << childPath <<
" len=" << childPath.length()
1207 <<
" endingIndex=" << endingIndex
1208 <<
" nodeString.length()=" << nodeString.length() << __E__;
1214 __COUTS__(50) << row_ <<
" " << col_ <<
" " << groupId_ <<
" " << tableView_
1220 return recurse(configMgr_->
getNode(nodeName),
1222 doNotThrowOnBrokenUIDLinks,
1223 originalNodeString);
1225 else if(row_ == TableView::INVALID && col_ == TableView::INVALID)
1231 __SS__ <<
"Missing configView pointer! Likely attempting to access a "
1232 "child node through a disconnected link node."
1248 TableView::INVALID ,
1249 TableView::INVALID ,
1261 doNotThrowOnBrokenUIDLinks,
1262 originalNodeString);
1264 else if(row_ == TableView::INVALID)
1266 __SS__ <<
"Malformed ConfigurationTree" << __E__;
1271 else if(col_ == TableView::INVALID)
1276 __COUTS__(51) <<
"nodeName=" << nodeName <<
" " << nodeName.length() << __E__;
1286 __SS__ <<
"Missing configView pointer! Likely attempting to access a "
1287 "child node through a disconnected link node."
1294 unsigned int c = tableView_->
findCol(nodeName);
1295 std::pair<
unsigned int ,
unsigned int > linkPair;
1296 bool isGroupLink, isLink;
1297 if((isLink = tableView_->
getChildLink(c, isGroupLink, linkPair)) &&
1300 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1310 tableView_->getDataView()[row_][linkPair.first]);
1311 childConfig->getView();
1313 if(doNotThrowOnBrokenUIDLinks)
1315 childConfig->getView().
findRow(
1317 tableView_->getDataView()[row_][linkPair.second]);
1323 <<
"Found disconnected node! (" << nodeName <<
":"
1324 << tableView_->getDataView()[row_][linkPair.first] <<
")"
1325 <<
" at entry with UID "
1326 << tableView_->getDataView()[row_][tableView_->
getColUID()]
1335 tableView_->getDataView()[row_][c],
1340 tableView_->getDataView()[row_][linkPair.first],
1343 tableView_->getDataView()[row_][linkPair.second],
1356 tableView_->getDataView()[row_][c],
1364 childConfig->getView().
findRow(
1366 tableView_->getDataView()[row_][linkPair.second])),
1368 doNotThrowOnBrokenUIDLinks,
1369 originalNodeString);
1373 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1383 tableView_->getDataView()[row_][linkPair.first]);
1384 childConfig->getView();
1388 if(tableView_->getDataView()[row_][linkPair.first] !=
1389 TableViewColumnInfo::DATATYPE_LINK_DEFAULT)
1391 <<
"Found disconnected node! Failed link target "
1393 << nodeName <<
" to table:id="
1394 << tableView_->getDataView()[row_][linkPair.first] <<
":"
1395 << tableView_->getDataView()[row_][linkPair.second] << __E__;
1401 tableView_->getDataView()[row_][linkPair.second],
1404 tableView_->getDataView()[row_][c],
1409 tableView_->getDataView()[row_][linkPair.first],
1412 tableView_->getDataView()[row_][linkPair.second],
1423 ->getDataView()[row_][linkPair.second],
1426 tableView_->getDataView()[row_][c],
1435 doNotThrowOnBrokenUIDLinks,
1436 originalNodeString);
1440 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1449 TableView::INVALID ,
1450 TableView::INVALID ,
1459 catch(std::runtime_error& e)
1461 __SS__ <<
"\n\nError occurred descending from node '" <<
getValue()
1462 <<
"' in table '" <<
getTableName() <<
"' looking for child '" << nodeName
1465 ss <<
"The original node search string was '" << originalNodeString <<
".'"
1467 ss <<
"--- Additional error detail: \n\n" << e.what() << __E__;
1474 __SS__ <<
"\n\nError occurred descending from node '" <<
getValue()
1475 <<
"' in table '" <<
getTableName() <<
"' looking for child '" << nodeName
1478 ss <<
"The original node search string was '" << originalNodeString <<
".'"
1484 catch(
const std::exception& e)
1486 ss <<
"Exception message: " << e.what();
1497 <<
"\n\nError occurred descending from node '" <<
getValue() <<
"' in table '"
1498 <<
getTableName() <<
"' looking for child '" << nodeName <<
"'\n\n"
1499 <<
"Invalid depth! getNode() called from a value point in the Configuration Tree."
1501 ss <<
"The original node search string was '" << originalNodeString <<
".'" << __E__;
1510 const std::string& nodeString)
const
1512 if(nodeString.length() < 1)
1527 if(!forcePrintout && time(0) - ConfigurationTree::LAST_NODE_DUMP_TIME < 3)
1529 __COUTS__(20) <<
"Blocking cascading node dumps... "
1530 "ConfigurationTree::LAST_NODE_DUMP_TIME = "
1531 << ConfigurationTree::LAST_NODE_DUMP_TIME << __E__;
1534 ConfigurationTree::LAST_NODE_DUMP_TIME = time(0);
1536 __SS__ << __E__ << __E__;
1538 ss <<
"Row=" << (int)row_ <<
", Col=" << (
int)col_ <<
", TablePointer=" << table_
1550 ss <<
"ConfigurationTree::nodeDump() start"
1551 "=====================================\nConfigurationTree::nodeDump():"
1558 <<
"Node dump initiated from node '" <<
getValueAsString() <<
"'..." << __E__;
1566 <<
"Node dump initiated from node '" <<
getValue() <<
"' in table '"
1581 <<
"Here is the list of possible children (count = " << children.size()
1583 for(
auto& child : children)
1584 ss <<
"\t\t" << child << __E__;
1587 ss <<
"\n\nHere is the culprit table printout:\n\n";
1588 tableView_->print(ss);
1594 ss <<
"Is link node." << __E__;
1595 ss <<
"disconnectedTargetName_ = " << disconnectedTargetName_
1596 <<
", disconnectedLinkID_ = " << disconnectedLinkID_ << __E__;
1600 <<
"Here is the list of active tables:" << __E__;
1601 for(
auto& table : tables)
1602 ss <<
"\t\t" << table.first << __E__;
1609 ss <<
"\n\nConfigurationTree::nodeDump() end ====================================="
1617 unsigned int backSteps)
const
1619 for(
unsigned int i = 0; i < backSteps; i++)
1620 nodeName = nodeName.substr(0, nodeName.find_last_of(
'/'));
1627 unsigned int forwardSteps)
const
1632 while(s < nodeName.length() && nodeName[s] ==
'/')
1635 for(
unsigned int i = 0; i < forwardSteps; i++)
1636 s = nodeName.find(
'/', s) + 1;
1638 return getNode(nodeName.substr(0, s));
1646 return (row_ != TableView::INVALID && col_ != TableView::INVALID);
1674 __SS__ <<
"\n\nError occurred testing link connection at node with value '"
1677 ss <<
"This is not a Link node! It is node type '" << getNodeType()
1678 <<
".' Only a Link node can be disconnected." << __E__;
1684 return !table_ || !tableView_;
1696 const std::string ConfigurationTree::NODE_TYPE_TABLE =
"TableNode";
1697 const std::string ConfigurationTree::NODE_TYPE_GROUP_LINK =
"GroupLinkNode";
1698 const std::string ConfigurationTree::NODE_TYPE_UID_LINK =
"UIDLinkNode";
1699 const std::string ConfigurationTree::NODE_TYPE_VALUE =
"ValueNode";
1700 const std::string ConfigurationTree::NODE_TYPE_UID =
"UIDNode";
1701 const std::string ConfigurationTree::NODE_TYPE_ROOT =
"RootNode";
1703 std::string ConfigurationTree::getNodeType(
void)
const
1706 return ConfigurationTree::NODE_TYPE_ROOT;
1707 if(isTableNode() && groupId_ !=
"")
1710 return ConfigurationTree::NODE_TYPE_TABLE;
1712 return ConfigurationTree::NODE_TYPE_GROUP_LINK;
1714 return ConfigurationTree::NODE_TYPE_UID_LINK;
1716 return ConfigurationTree::NODE_TYPE_VALUE;
1717 return ConfigurationTree::NODE_TYPE_UID;
1749 return (row_ != TableView::INVALID && col_ == TableView::INVALID);
1769 const std::vector<std::string /*uid*/>& recordList,
1770 const std::vector<std::string /*relative-path*/>& fieldAcceptList,
1771 const std::vector<std::string /*relative-path*/>& fieldRejectList,
1773 bool autoSelectFilterFields)
const
1776 if(!isRootNode() && !isTableNode())
1778 __SS__ <<
"Can only get getCommonFields from a root or table node! "
1779 <<
"The node type is " << getNodeType() << __E__;
1785 std::vector<ConfigurationTree::RecordField> fieldCandidateList;
1786 std::vector<int> fieldCount;
1830 if(!recordList.size() && tableView_)
1832 const std::vector<TableViewColumnInfo>& colInfo = tableView_->getColumnsInfo();
1834 for(
unsigned int col = 0; col < colInfo.size(); ++col)
1836 __COUTS__(11) <<
"Considering field " << colInfo[col].getName() << __E__;
1839 found = fieldAcceptList.size() ? false :
true;
1841 for(
const auto& fieldFilter : fieldAcceptList)
1853 for(
const auto& fieldFilter : fieldRejectList)
1864 __COUTS__(11) <<
"FOUND field " << colInfo[col].getName() << __E__;
1866 if(colInfo[col].isChildLink())
1869 <<
"isGroupLinkNode " << colInfo[col].getName() << __E__;
1873 std::pair<
unsigned int ,
unsigned int >
1883 tableView_->getColumnInfo(linkPair.first).getName(),
1885 &tableView_->getColumnInfo(linkPair.first)));
1886 fieldCount.push_back(-1);
1891 tableView_->getColumnInfo(linkPair.second).getName(),
1893 &tableView_->getColumnInfo(linkPair.second)));
1894 fieldCount.push_back(-1);
1901 colInfo[col].getName(),
1904 fieldCount.push_back(1);
1910 for(
unsigned int i = 0; i < recordList.size(); ++i)
1912 __COUTS__(11) <<
"Checking " << recordList[i] << __E__;
1915 node.recursiveGetCommonFields(fieldCandidateList,
1926 __COUT__ <<
"======================= check for count = " << (int)recordList.size()
1931 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1933 __COUTS__(11) <<
"Checking " << fieldCandidateList[i].relativePath_
1934 << fieldCandidateList[i].columnName_ <<
" = " << fieldCount[i]
1936 if(recordList.size() != 0 && fieldCount[i] != -1 &&
1937 fieldCount[i] != (
int)recordList.size())
1939 __COUTS__(11) <<
"Erasing " << fieldCandidateList[i].relativePath_
1940 << fieldCandidateList[i].columnName_ << __E__;
1942 fieldCount.erase(fieldCount.begin() + i);
1943 fieldCandidateList.erase(fieldCandidateList.begin() + i);
1948 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1949 __COUTS__(11) <<
"Pre-Final " << fieldCandidateList[i].relativePath_
1950 << fieldCandidateList[i].columnName_ << __E__;
1952 if(autoSelectFilterFields)
1956 std::set<std::pair<
unsigned int ,
unsigned int >>
1959 unsigned int priorityPenalty;
1960 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1962 __COUTS__(11) <<
"Option [" << i <<
"] "
1963 << fieldCandidateList[i].relativePath_
1964 << fieldCandidateList[i].columnName_ <<
" : "
1965 << fieldCandidateList[i].columnInfo_->getType() <<
":"
1966 << fieldCandidateList[i].columnInfo_->getDataType() << __E__;
1968 priorityPenalty = std::count(fieldCandidateList[i].relativePath_.begin(),
1969 fieldCandidateList[i].relativePath_.end(),
1973 if(fieldCandidateList[i].columnInfo_->isBoolType() &&
1974 (fieldCandidateList[i].columnName_ ==
1975 TableViewColumnInfo::COL_NAME_STATUS ||
1976 fieldCandidateList[i].columnName_ ==
1977 TableViewColumnInfo::COL_NAME_ENABLED))
1979 priorityPenalty += 0;
1981 else if(fieldCandidateList[i].columnInfo_->isGroupID())
1983 priorityPenalty += 1;
1985 else if(fieldCandidateList[i].columnInfo_->isBoolType())
1987 priorityPenalty += 3;
1989 else if(fieldCandidateList[i].columnInfo_->getType() ==
1990 TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA)
1992 priorityPenalty += 3;
1994 else if(fieldCandidateList[i].columnInfo_->getType() ==
1995 TableViewColumnInfo::TYPE_DATA)
1997 priorityPenalty += 10;
2001 fieldCandidateList[i].tableName_ =
2005 prioritySet.emplace(
2006 std::make_pair(priorityPenalty , i ));
2007 __COUTS__(11) <<
"Option [" << i <<
"] "
2008 << fieldCandidateList[i].relativePath_
2009 << fieldCandidateList[i].columnName_ <<
" : "
2010 << fieldCandidateList[i].columnInfo_->getType() <<
":"
2011 << fieldCandidateList[i].columnInfo_->getDataType()
2012 <<
"... priority = " << priorityPenalty << __E__;
2021 unsigned int cnt = 0;
2022 for(
const auto& priorityFieldIndex : prioritySet)
2026 << cnt <<
" marking "
2027 << fieldCandidateList[priorityFieldIndex.second].relativePath_
2028 << fieldCandidateList[priorityFieldIndex.second].columnName_
2030 fieldCandidateList[priorityFieldIndex.second].tableName_ =
2035 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
2037 if(fieldCandidateList[i].tableName_ ==
"")
2039 __COUTS__(11) <<
"Erasing " << fieldCandidateList[i].relativePath_
2040 << fieldCandidateList[i].columnName_ << __E__;
2041 fieldCandidateList.erase(fieldCandidateList.begin() + i);
2047 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
2048 __COUT__ <<
"Final " << fieldCandidateList[i].relativePath_
2049 << fieldCandidateList[i].columnName_ << __E__;
2051 return fieldCandidateList;
2061 const std::vector<std::string /*relative-path*/>& recordList,
2062 const std::string& fieldName,
2063 std::string* fieldGroupIDChildLinkIndex )
const
2065 if(fieldGroupIDChildLinkIndex)
2066 *fieldGroupIDChildLinkIndex =
"";
2071 __SS__ <<
"Can only get getCommonFields from a table node! "
2072 <<
"The node type is " << getNodeType() << __E__;
2078 std::set<std::string > uniqueValues;
2086 if(!recordList.size() && tableView_ && fieldGroupIDChildLinkIndex)
2089 tableView_->getColumnInfo(tableView_->
findCol(fieldName));
2096 for(
unsigned int i = 0; i < recordList.size(); ++i)
2116 if(i == 0 && fieldGroupIDChildLinkIndex)
2122 for(
auto& groupID : setOfGroupIDs)
2123 uniqueValues.emplace(groupID);
2130 return uniqueValues;
2136 void ConfigurationTree::recursiveGetCommonFields(
2137 std::vector<ConfigurationTree::RecordField>& fieldCandidateList,
2138 std::vector<int>& fieldCount,
2139 const std::vector<std::string /*relative-path*/>& fieldAcceptList,
2140 const std::vector<std::string /*relative-path*/>& fieldRejectList,
2142 const std::string& relativePathBase,
2143 bool inFirstRecord)
const
2176 for(
const auto& fieldNode : recordChildren)
2182 if(fieldNode.second.isValueNode() || fieldNode.second.isGroupLinkNode())
2185 if(fieldNode.second.isValueNode())
2187 if(fieldNode.second.getColumnInfo().getType() ==
2188 TableViewColumnInfo::TYPE_AUTHOR ||
2189 fieldNode.second.getColumnInfo().getType() ==
2190 TableViewColumnInfo::TYPE_TIMESTAMP)
2203 found = fieldAcceptList.size() ? false :
true;
2205 for(
const auto& fieldFilter : fieldAcceptList)
2206 if(fieldFilter.find(
'/') != std::string::npos)
2210 fieldFilter, relativePathBase + fieldNode.first))
2227 for(
const auto& fieldFilter : fieldRejectList)
2228 if(fieldFilter.find(
'/') != std::string::npos)
2232 fieldFilter, relativePathBase + fieldNode.first))
2251 if(fieldNode.second.isGroupLinkNode())
2257 std::pair<
unsigned int ,
unsigned int >
2261 tableView_->
findCol(fieldNode.first), isGroupLink, linkPair);
2268 tableView_->getColumnInfo(linkPair.first).getName(),
2270 &tableView_->getColumnInfo(linkPair.first)));
2271 fieldCount.push_back(1);
2276 tableView_->getColumnInfo(linkPair.second).getName(),
2278 &tableView_->getColumnInfo(linkPair.second)));
2279 fieldCount.push_back(1);
2288 &fieldNode.second.getColumnInfo()));
2289 fieldCount.push_back(1);
2297 for(j = 0; j < fieldCandidateList.size(); ++j)
2299 if((relativePathBase + fieldNode.first) ==
2300 (fieldCandidateList[j].relativePath_ +
2301 fieldCandidateList[j].columnName_))
2307 if(fieldNode.second.isGroupLinkNode() &&
2308 j + 1 < fieldCandidateList.size())
2309 ++fieldCount[j + 1];
2315 else if(fieldNode.second.isUIDLinkNode())
2324 fieldAcceptList.size() ? false :
true;
2325 for(
const auto& fieldFilter : fieldAcceptList)
2326 if(fieldFilter.find(
'/') != std::string::npos)
2330 fieldFilter, relativePathBase + fieldNode.first))
2347 for(
const auto& fieldFilter : fieldRejectList)
2348 if(fieldFilter.find(
'/') != std::string::npos)
2352 fieldFilter, relativePathBase + fieldNode.first))
2370 std::pair<
unsigned int ,
unsigned int >
2376 tableView_->
findCol(fieldNode.first), isGroupLink, linkPair);
2383 tableView_->getColumnInfo(linkPair.first).getName(),
2385 &tableView_->getColumnInfo(linkPair.first)));
2386 fieldCount.push_back(1);
2391 tableView_->getColumnInfo(linkPair.second).getName(),
2393 &tableView_->getColumnInfo(linkPair.second)));
2394 fieldCount.push_back(1);
2401 for(j = 0; j < fieldCandidateList.size() - 1; ++j)
2403 if((relativePathBase + fieldNode.first) ==
2404 (fieldCandidateList[j].relativePath_ +
2405 fieldCandidateList[j].columnName_))
2411 ++fieldCount[j + 1];
2418 if(depth > 0 && !fieldNode.second.isDisconnected())
2419 fieldNode.second.recursiveGetCommonFields(
2425 (relativePathBase + fieldNode.first) +
"/",
2438 std::vector<std::vector<std::pair<std::string, ConfigurationTree>>>
2440 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2441 bool onlyStatusTrue)
const
2443 std::vector<std::vector<std::pair<std::string, ConfigurationTree>>> retVector;
2447 bool filtering = filterMap.size();
2448 std::string fieldValue;
2450 bool createContainer;
2452 std::vector<std::vector<std::string>> childrenNamesByPriority =
2455 for(
auto& childNamesAtPriority : childrenNamesByPriority)
2457 createContainer =
true;
2459 for(
auto& childName : childNamesAtPriority)
2469 retVector.push_back(
2470 std::vector<std::pair<std::string, ConfigurationTree>>());
2471 createContainer =
false;
2474 retVector[retVector.size() - 1].push_back(
2475 std::pair<std::string, ConfigurationTree>(
2476 childName, this->
getNode(childName,
true)));
2488 const std::string& childName,
2489 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap)
const
2495 for(
const auto& filterPair : filterMap)
2497 std::string filterPath = childName +
"/" + filterPair.first;
2498 __COUTV__(filterPath);
2504 std::vector<std::string> fieldValues;
2506 filterPair.second, fieldValues, std::set<char>({
','}) );
2508 __COUTV__(fieldValues.size());
2512 for(
const auto& fieldValue : fieldValues)
2526 bool groupIdFound =
false;
2529 for(
auto& groupID : setOfGroupIDs)
2531 __COUT__ <<
"\t\tGroupID Check: " << filterPair.first
2532 <<
" == " << fieldValue <<
" => "
2534 <<
" ??? " << groupID << __E__;
2540 __COUT__ <<
"Found match" << __E__;
2541 groupIdFound =
true;
2549 __COUT__ <<
"Found break match" << __E__;
2556 __COUT__ <<
"\t\tCheck: " << filterPair.first <<
" == " << fieldValue
2573 __SS__ <<
"Failed to access filter path '" << filterPath <<
"' - aborting."
2597 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2599 bool onlyStatusTrue)
const
2601 std::vector<std::pair<std::string, ConfigurationTree>> retVector;
2605 bool filtering = filterMap.size();
2607 std::string fieldValue;
2609 std::vector<std::string> childrenNames =
getChildrenNames(byPriority, onlyStatusTrue);
2610 for(
auto& childName : childrenNames)
2616 retVector.push_back(std::pair<std::string, ConfigurationTree>(
2617 childName, this->
getNode(childName,
true)));
2629 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2630 bool onlyStatusTrue)
const
2632 std::map<std::string, ConfigurationTree> retMap;
2634 bool filtering = filterMap.size();
2637 std::vector<std::string> childrenNames =
2639 for(
auto& childName : childrenNames)
2647 retMap.insert(std::pair<std::string, ConfigurationTree>(
2648 childName, this->
getNode(childName)));
2662 <<
".' Can only check the status of a UID/Record node!" << __E__;
2667 bool tmpStatus =
true;
2672 catch(
const std::runtime_error& e)
2681 bool ConfigurationTree::isStatusNode(
void)
const
2693 bool onlyStatusTrue)
const
2695 std::vector<std::vector<std::string >> retVector;
2700 <<
"' with null configuration view pointer!" << __E__;
2709 if(row_ == TableView::INVALID && col_ == TableView::INVALID)
2716 std::vector<std::vector<
unsigned int >> groupRowsByPriority =
2719 ? TableView::INVALID
2726 for(
const auto& priorityChildRowVector : groupRowsByPriority)
2728 retVector.push_back(std::vector<std::string /*child name*/>());
2729 for(
const auto& priorityChildRow : priorityChildRowVector)
2730 retVector[retVector.size() - 1].push_back(
2731 tableView_->getDataView()[priorityChildRow][tableView_->
getColUID()]);
2734 else if(row_ == TableView::INVALID)
2736 __SS__ <<
"Malformed ConfigurationTree" << __E__;
2741 else if(col_ == TableView::INVALID)
2746 for(
unsigned int c = 0; c < tableView_->getNumberOfColumns(); ++c)
2754 retVector.push_back(std::vector<std::string /*child name*/>());
2755 retVector[retVector.size() - 1].push_back(
2756 tableView_->getColumnInfo(c).getName());
2762 __SS__ <<
"\n\nError occurred looking for children of nodeName=" <<
getValueName()
2764 <<
"Invalid depth! getChildrenValues() called from a value point in the "
2765 "Configuration Tree."
2779 bool onlyStatusTrue)
const
2781 std::vector<std::string > retVector;
2789 retVector.push_back(configPair.first);
2796 __SS__ <<
"Can not get children names of '" <<
getFieldName() <<
":"
2805 if(row_ == TableView::INVALID && col_ == TableView::INVALID)
2809 std::vector<
unsigned int > groupRows = tableView_->
getGroupRows(
2811 ? TableView::INVALID
2819 for(
const auto& groupRow : groupRows)
2820 retVector.push_back(
2821 tableView_->getDataView()[groupRow][tableView_->
getColUID()]);
2888 else if(row_ == TableView::INVALID)
2890 __SS__ <<
"Malformed ConfigurationTree" << __E__;
2895 else if(col_ == TableView::INVALID)
2900 for(
unsigned int c = 0; c < tableView_->getNumberOfColumns(); ++c)
2907 retVector.push_back(tableView_->getColumnInfo(c).getName());
2912 __SS__ <<
"\n\nError occurred looking for children of nodeName=" <<
getValueName()
2914 <<
"Invalid depth! getChildrenValues() called from a value point in the "
2915 "Configuration Tree."
2936 __SS__ <<
"Invalid node for get value." << __E__;
2940 std::string valueString =
2943 if(valueString.size() && valueString[0] ==
'/')
2950 __COUT__ <<
"Found a valid tree path in value!" << __E__;
2955 __SS__ <<
"Invalid tree path." << __E__;
2961 __SS__ <<
"Invalid value string '" << valueString
2962 <<
"' - 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
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)