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] >=
'0' &&
391 bitmapString[i] <=
'9') ||
392 (bmp.mapsToStrings_ && bitmapString[i] >=
'a' &&
395 (bmp.mapsToStrings_ && bitmapString[i] >=
'A' &&
396 bitmapString[i] <=
'Z'))
400 else if(bitmapString[i] ==
',')
402 __SS__ <<
"Too many ',' characters in bit map configuration"
413 if(bitmapString[i] ==
420 while(ii - startInt > 2 && (bitmapString[ii - 1] ==
' ' ||
421 bitmapString[ii - 1] ==
'\r' ||
422 bitmapString[ii - 1] ==
'\n' ||
423 bitmapString[ii - 1] ==
'\t' ||
424 bitmapString[ii - 1] ==
'"'))
426 __COUTVS__(2, bitmapString.substr(startInt, ii - startInt));
427 if(bmp.mapsToStrings_)
430 valueMap.at(bitmapString.substr(startInt, ii - startInt));
431 __COUTVS__(2, value);
434 bitmap.bitmap_[row].push_back(
435 bitmapString.substr(startInt, ii - startInt));
439 else if(bitmapString[i] ==
',')
443 while(ii - startInt > 2 && (bitmapString[ii - 1] ==
' ' ||
444 bitmapString[ii - 1] ==
'\r' ||
445 bitmapString[ii - 1] ==
'\n' ||
446 bitmapString[ii - 1] ==
'\t' ||
447 bitmapString[ii - 1] ==
'"'))
449 __COUTVS__(2, bitmapString.substr(startInt, ii - startInt));
450 if(bmp.mapsToStrings_)
453 valueMap.at(bitmapString.substr(startInt, ii - startInt));
454 __COUTVS__(2, value);
457 bitmap.bitmap_[row].push_back(
458 bitmapString.substr(startInt, ii - startInt));
467 for(
unsigned int r = 0; r < bitmap.bitmap_.size(); ++r)
469 for(
unsigned int c = 0; c < bitmap.bitmap_[r].size(); ++c)
471 __COUTT__ << r <<
"," << c <<
" = " << bitmap.bitmap_[r][c]
474 __COUTT__ <<
"================" << __E__;
479 if(bitmap.bitmap_.size() != bmp.numOfRows_ ||
480 (bmp.numOfRows_ && bitmap.bitmap_[0].size() != bmp.numOfColumns_))
483 <<
"Illegal mismatch in number of rows and columns. Extracted data was "
484 << bitmap.bitmap_.size() <<
" x "
485 << (bitmap.bitmap_.size() ? bitmap.bitmap_[0].size() : 0)
486 <<
" and the expected size is " << bmp.numOfRows_ <<
" x "
487 << bmp.numOfColumns_ << __E__;
493 __SS__ <<
"Requesting getValue must be on a value node." << __E__;
507 ConfigurationTree::getValueAsBitMap(value);
516 if(row_ != TableView::INVALID &&
517 col_ != TableView::INVALID)
520 __SS__ <<
"Can not get escaped value except from a value node!"
521 <<
" This node is type '" << getNodeType() <<
"." << __E__;
533 __SS__ <<
"Can not get configuration name of node with no configuration pointer! "
534 <<
"Is there a broken link? " << __E__;
537 ss <<
"Error occurred traversing from " << linkParentTable_->
getTableName()
540 linkBackRow_, linkParentTable_->getView().
getColUID())
541 <<
"' at row " << linkBackRow_ <<
" col '"
542 << linkParentTable_->getView().getColumnInfo(linkBackCol_).getName()
560 __SS__ <<
"Can not get parent table name of node with no parent table pointer! "
561 <<
"Was this node initialized correctly? " << __E__;
570 if(linkParentTable_ && linkBackRow_ != TableView::INVALID)
573 return linkParentTable_->getView()
574 .getDataView()[linkBackRow_][linkParentTable_->getView().
getColUID()];
577 __SS__ <<
"Can not get parent record name of node without the parent table pointer "
578 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
579 <<
")! Was this node initialized correctly? " << __E__;
588 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
589 linkBackCol_ != TableView::INVALID)
592 return linkParentTable_->getView().getColumnInfo(linkBackCol_).getName();
596 <<
"Can not get parent link column name of node without the parent table pointer "
597 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
598 <<
") and col (col = " << linkBackCol_
599 <<
")! Was this node initialized correctly? " << __E__;
608 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
609 linkBackCol_ != TableView::INVALID)
613 std::pair<
unsigned int ,
unsigned int > linkPair;
614 linkParentTable_->getView().
getChildLink(linkBackCol_, isGroup, linkPair);
617 linkParentTable_->getView().
getValue(
618 linkId, linkBackRow_, linkPair.second );
623 __SS__ <<
"Can not get parent link ID of node without the parent table pointer "
624 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
625 <<
") and col (col = " << linkBackCol_
626 <<
")! Was this node initialized correctly? " << __E__;
635 if(linkParentTable_ && linkBackRow_ != TableView::INVALID &&
636 linkBackCol_ != TableView::INVALID)
639 return linkParentTable_->getView()
640 .getColumnInfo(linkBackCol_)
644 __SS__ <<
"Can not get parent link index of node without the parent table pointer "
645 << (linkParentTable_ ?
"" :
"= null ") <<
"and row (row = " << linkBackRow_
646 <<
") and col (col = " << linkBackCol_
647 <<
")! Was this node initialized correctly? " << __E__;
659 __SS__ <<
"Can only get row from a UID or value node!" << __E__;
662 ss <<
"Error occurred traversing from " << linkParentTable_->
getTableName()
665 linkBackRow_, linkParentTable_->getView().
getColUID())
666 <<
"' at row " << linkBackRow_ <<
" col '"
667 << linkParentTable_->getView().getColumnInfo(linkBackCol_).getName() <<
".'"
687 if(!linkParentTable_)
689 __SS__ <<
"Can not get configuration name of link node field with no parent "
690 "configuration pointer!"
706 return disconnectedTargetName_;
708 __SS__ <<
"Can not get disconnected target name of node unless it is a disconnected "
721 return disconnectedLinkID_;
723 __SS__ <<
"Can not get disconnected target name of node unless it is a disconnected "
737 __SS__ <<
"Can not get configuration version of node with no config view pointer!"
743 return tableView_->getVersion();
752 __SS__ <<
"Can not get configuration creation time of node with no config view "
759 return tableView_->getCreationTime();
769 __SS__ <<
"Can not get set of group IDs of node with value type of '"
770 << getNodeType() <<
".' Node must be a GroupID node." << __E__;
786 if(
getValueType() != TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA &&
789 __SS__ <<
"Can not get fixed choices of node with value type of '"
790 <<
getValueType() <<
".' Node must be a link or a value node with type '"
791 << TableViewColumnInfo::TYPE_BITMAP_DATA <<
"' or '"
792 << TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA <<
".'" << __E__;
798 std::vector<std::string> retVec;
802 if(!linkParentTable_)
805 <<
"Can not get fixed choices of node with no parent config view pointer!"
818 const TableView* parentView = &(linkParentTable_->getView());
819 int c = parentView->
findCol(linkColName_);
821 std::pair<
unsigned int ,
unsigned int > linkPair;
826 std::vector<std::string> choices = parentView->getColumnInfo(c).getDataChoices();
827 for(
const auto& choice : choices)
828 retVec.push_back(choice);
835 __SS__ <<
"Can not get fixed choices of node with no config view pointer!"
844 std::vector<std::string> choices = tableView_->getColumnInfo(col_).getDataChoices();
845 for(
const auto& choice : choices)
846 retVec.push_back(choice);
855 auto commentNode =
getNode(TableViewColumnInfo::COL_NAME_COMMENT);
856 std::string comment = commentNode.getValueAsString();
857 return comment !=
"" && comment != TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT &&
858 comment != TableViewColumnInfo::DATATYPE_COMMENT_OLD_DEFAULT &&
859 comment != commentNode.getColumnInfo().getDefaultValue();
867 ? TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT
892 if(returnLinkTableValue)
893 return linkColValue_;
895 return ConfigurationTree::DISCONNECTED_VALUE;
896 else if(row_ == TableView::INVALID &&
897 col_ == TableView::INVALID)
898 return (groupId_ ==
"") ? table_->
getTableName() : groupId_;
899 else if(col_ == TableView::INVALID)
900 return tableView_->getDataView()[row_][tableView_->
getColUID()];
903 __SS__ <<
"Impossible Link." << __E__;
909 else if(row_ != TableView::INVALID &&
910 col_ != TableView::INVALID)
911 return tableView_->getDataView()[row_][col_];
912 else if(row_ == TableView::INVALID &&
913 col_ == TableView::INVALID)
917 return ConfigurationTree::ROOT_NAME;
919 return (groupId_ ==
"") ? table_->
getTableName() : groupId_;
921 else if(row_ == TableView::INVALID)
923 __SS__ <<
"Malformed ConfigurationTree" << __E__;
928 else if(col_ == TableView::INVALID)
929 return tableView_->getDataView()[row_][tableView_->
getColUID()];
932 __SS__ <<
"Impossible." << __E__;
946 return tableView_->getDataView()[row_][tableView_->
getColUID()];
949 __SS__ <<
"Can not get UID of node with type '" << getNodeType()
950 <<
".' Node type must be '" << ConfigurationTree::NODE_TYPE_VALUE
951 <<
"' or '" << ConfigurationTree::NODE_TYPE_UID_LINK <<
".'" << __E__;
964 return tableView_->getColumnInfo(col_).getDataType();
966 return TableViewColumnInfo::DATATYPE_STRING;
979 if(
getValueType() == TableViewColumnInfo::TYPE_ON_OFF ||
980 getValueType() == TableViewColumnInfo::TYPE_TRUE_FALSE ||
983 TableViewColumnInfo::DATATYPE_BOOL_DEFAULT;
985 else if(
getValueType() == TableViewColumnInfo::TYPE_COMMENT)
986 return getValueAsString() == TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT ||
990 return getValueAsString() == TableViewColumnInfo::DATATYPE_STRING_DEFAULT ||
1009 __SS__ <<
"Can only get default value from a value node! "
1010 <<
"The node type is " << getNodeType() << __E__;
1018 if(
getValueType() == TableViewColumnInfo::TYPE_ON_OFF ||
1019 getValueType() == TableViewColumnInfo::TYPE_TRUE_FALSE ||
1021 return TableViewColumnInfo::DATATYPE_BOOL_DEFAULT;
1023 else if(
getValueType() == TableViewColumnInfo::TYPE_COMMENT)
1024 return TableViewColumnInfo::
1025 DATATYPE_COMMENT_DEFAULT;
1027 return TableViewColumnInfo::DATATYPE_STRING_DEFAULT;
1030 return TableViewColumnInfo::DATATYPE_NUMBER_DEFAULT;
1032 return TableViewColumnInfo::DATATYPE_TIME_DEFAULT;
1035 __SS__ <<
"Can only get default value from a value node! "
1036 <<
"The node type is " << getNodeType() << __E__;
1049 return tableView_->getColumnInfo(col_).getType();
1051 return ConfigurationTree::VALUE_TYPE_DISCONNECTED;
1053 return ConfigurationTree::VALUE_TYPE_NODE;
1062 return tableView_->getColumnInfo(col_);
1065 __SS__ <<
"Can only get column info from a value node! "
1066 <<
"The node type is " << getNodeType() << __E__;
1089 return linkBackRow_;
1103 return linkBackCol_;
1115 __SS__ <<
"Can only get link ID from a link! "
1116 <<
"The node type is " << getNodeType() << __E__;
1121 return childLinkIndex_;
1130 return tableView_->getColumnInfo(col_).getName();
1132 return linkColName_;
1135 __SS__ <<
"Can only get value name of a value node!" << __E__;
1146 const std::string& childPath,
1147 bool doNotThrowOnBrokenUIDLinks,
1148 const std::string& originalNodeString)
1150 __COUTS__(50) << tree.row_ <<
" " << tree.col_ << __E__;
1151 __COUTS__(51) <<
"childPath=" << childPath <<
" " << childPath.length() << __E__;
1152 if(childPath.length() <= 1)
1154 return tree.recursiveGetNode(
1155 childPath, doNotThrowOnBrokenUIDLinks, originalNodeString);
1169 bool doNotThrowOnBrokenUIDLinks)
const
1172 return recursiveGetNode(
1173 nodeString, doNotThrowOnBrokenUIDLinks,
"" );
1176 const std::string& nodeString,
1177 bool doNotThrowOnBrokenUIDLinks,
1178 const std::string& originalNodeString)
const
1180 __COUTS__(51) <<
"nodeString=" << nodeString <<
" len=" << nodeString.length()
1182 __COUTS__(52) <<
"doNotThrowOnBrokenUIDLinks=" << doNotThrowOnBrokenUIDLinks << __E__;
1185 if(nodeString.length() < 1)
1187 __SS__ <<
"Invalid empty node name! Looking for child node '" << nodeString
1188 <<
"' from node '" <<
getValue() <<
"'..." << __E__;
1195 size_t startingIndex = 0;
1196 while(startingIndex < nodeString.length() && nodeString[startingIndex] ==
'/')
1198 size_t endingIndex = nodeString.find(
'/', startingIndex);
1199 if(endingIndex == std::string::npos)
1200 endingIndex = nodeString.length();
1202 std::string nodeName = nodeString.substr(startingIndex, endingIndex - startingIndex);
1203 __COUTS__(51) <<
"nodeName=" << nodeName <<
" len=" << nodeName.length() << __E__;
1206 std::string childPath =
1207 (endingIndex >= nodeString.length() ?
"" : nodeString.substr(endingIndex));
1208 __COUTS__(51) <<
"childPath=" << childPath <<
" len=" << childPath.length()
1209 <<
" endingIndex=" << endingIndex
1210 <<
" nodeString.length()=" << nodeString.length() << __E__;
1216 __COUTS__(50) << row_ <<
" " << col_ <<
" " << groupId_ <<
" " << tableView_
1222 return recurse(configMgr_->
getNode(nodeName),
1224 doNotThrowOnBrokenUIDLinks,
1225 originalNodeString);
1227 else if(row_ == TableView::INVALID && col_ == TableView::INVALID)
1233 __SS__ <<
"Missing configView pointer! Likely attempting to access a "
1234 "child node through a disconnected link node."
1250 TableView::INVALID ,
1251 TableView::INVALID ,
1263 doNotThrowOnBrokenUIDLinks,
1264 originalNodeString);
1266 else if(row_ == TableView::INVALID)
1268 __SS__ <<
"Malformed ConfigurationTree" << __E__;
1273 else if(col_ == TableView::INVALID)
1278 __COUTS__(51) <<
"nodeName=" << nodeName <<
" " << nodeName.length() << __E__;
1288 __SS__ <<
"Missing configView pointer! Likely attempting to access a "
1289 "child node through a disconnected link node."
1296 unsigned int c = tableView_->
findCol(nodeName);
1297 std::pair<
unsigned int ,
unsigned int > linkPair;
1298 bool isGroupLink, isLink;
1299 if((isLink = tableView_->
getChildLink(c, isGroupLink, linkPair)) &&
1302 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1312 tableView_->getDataView()[row_][linkPair.first]);
1313 childConfig->getView();
1315 if(doNotThrowOnBrokenUIDLinks)
1317 childConfig->getView().
findRow(
1319 tableView_->getDataView()[row_][linkPair.second]);
1325 <<
"Found disconnected node! (" << nodeName <<
":"
1326 << tableView_->getDataView()[row_][linkPair.first] <<
")"
1327 <<
" at entry with UID "
1328 << tableView_->getDataView()[row_][tableView_->
getColUID()]
1337 tableView_->getDataView()[row_][c],
1342 tableView_->getDataView()[row_][linkPair.first],
1345 tableView_->getDataView()[row_][linkPair.second],
1358 tableView_->getDataView()[row_][c],
1366 childConfig->getView().
findRow(
1368 tableView_->getDataView()[row_][linkPair.second])),
1370 doNotThrowOnBrokenUIDLinks,
1371 originalNodeString);
1375 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1385 tableView_->getDataView()[row_][linkPair.first]);
1386 childConfig->getView();
1390 if(tableView_->getDataView()[row_][linkPair.first] !=
1391 TableViewColumnInfo::DATATYPE_LINK_DEFAULT)
1393 <<
"Found disconnected node! Failed link target "
1395 << nodeName <<
" to table:id="
1396 << tableView_->getDataView()[row_][linkPair.first] <<
":"
1397 << tableView_->getDataView()[row_][linkPair.second] << __E__;
1403 tableView_->getDataView()[row_][linkPair.second],
1406 tableView_->getDataView()[row_][c],
1411 tableView_->getDataView()[row_][linkPair.first],
1414 tableView_->getDataView()[row_][linkPair.second],
1425 ->getDataView()[row_][linkPair.second],
1428 tableView_->getDataView()[row_][c],
1437 doNotThrowOnBrokenUIDLinks,
1438 originalNodeString);
1442 __COUTS__(50) <<
"nodeName=" << nodeName <<
" " << nodeName.length()
1451 TableView::INVALID ,
1452 TableView::INVALID ,
1461 catch(std::runtime_error& e)
1463 __SS__ <<
"\n\nError occurred descending from node '" <<
getValue()
1464 <<
"' in table '" <<
getTableName() <<
"' looking for child '" << nodeName
1467 ss <<
"The original node search string was '" << originalNodeString <<
".'"
1469 ss <<
"--- Additional error detail: \n\n" << e.what() << __E__;
1476 __SS__ <<
"\n\nError occurred descending from node '" <<
getValue()
1477 <<
"' in table '" <<
getTableName() <<
"' looking for child '" << nodeName
1480 ss <<
"The original node search string was '" << originalNodeString <<
".'"
1486 catch(
const std::exception& e)
1488 ss <<
"Exception message: " << e.what();
1499 <<
"\n\nError occurred descending from node '" <<
getValue() <<
"' in table '"
1500 <<
getTableName() <<
"' looking for child '" << nodeName <<
"'\n\n"
1501 <<
"Invalid depth! getNode() called from a value point in the Configuration Tree."
1503 ss <<
"The original node search string was '" << originalNodeString <<
".'" << __E__;
1512 const std::string& nodeString)
const
1514 if(nodeString.length() < 1)
1529 if(!forcePrintout && time(0) - ConfigurationTree::LAST_NODE_DUMP_TIME < 3)
1531 __COUTS__(20) <<
"Blocking cascading node dumps... "
1532 "ConfigurationTree::LAST_NODE_DUMP_TIME = "
1533 << ConfigurationTree::LAST_NODE_DUMP_TIME << __E__;
1536 ConfigurationTree::LAST_NODE_DUMP_TIME = time(0);
1538 __SS__ << __E__ << __E__;
1540 ss <<
"Row=" << (int)row_ <<
", Col=" << (
int)col_ <<
", TablePointer=" << table_
1552 ss <<
"ConfigurationTree::nodeDump() start"
1553 "=====================================\nConfigurationTree::nodeDump():"
1560 <<
"Node dump initiated from node '" <<
getValueAsString() <<
"'..." << __E__;
1568 <<
"Node dump initiated from node '" <<
getValue() <<
"' in table '"
1583 <<
"Here is the list of possible children (count = " << children.size()
1585 for(
auto& child : children)
1586 ss <<
"\t\t" << child << __E__;
1589 ss <<
"\n\nHere is the culprit table printout:\n\n";
1590 tableView_->print(ss);
1596 ss <<
"Is link node." << __E__;
1597 ss <<
"disconnectedTargetName_ = " << disconnectedTargetName_
1598 <<
", disconnectedLinkID_ = " << disconnectedLinkID_ << __E__;
1602 <<
"Here is the list of active tables:" << __E__;
1603 for(
auto& table : tables)
1604 ss <<
"\t\t" << table.first << __E__;
1611 ss <<
"\n\nConfigurationTree::nodeDump() end ====================================="
1619 unsigned int backSteps)
const
1621 for(
unsigned int i = 0; i < backSteps; i++)
1622 nodeName = nodeName.substr(0, nodeName.find_last_of(
'/'));
1629 unsigned int forwardSteps)
const
1634 while(s < nodeName.length() && nodeName[s] ==
'/')
1637 for(
unsigned int i = 0; i < forwardSteps; i++)
1638 s = nodeName.find(
'/', s) + 1;
1640 return getNode(nodeName.substr(0, s));
1648 return (row_ != TableView::INVALID && col_ != TableView::INVALID);
1676 __SS__ <<
"\n\nError occurred testing link connection at node with value '"
1679 ss <<
"This is not a Link node! It is node type '" << getNodeType()
1680 <<
".' Only a Link node can be disconnected." << __E__;
1686 return !table_ || !tableView_;
1698 const std::string ConfigurationTree::NODE_TYPE_TABLE =
"TableNode";
1699 const std::string ConfigurationTree::NODE_TYPE_GROUP_LINK =
"GroupLinkNode";
1700 const std::string ConfigurationTree::NODE_TYPE_UID_LINK =
"UIDLinkNode";
1701 const std::string ConfigurationTree::NODE_TYPE_VALUE =
"ValueNode";
1702 const std::string ConfigurationTree::NODE_TYPE_UID =
"UIDNode";
1703 const std::string ConfigurationTree::NODE_TYPE_ROOT =
"RootNode";
1705 std::string ConfigurationTree::getNodeType(
void)
const
1708 return ConfigurationTree::NODE_TYPE_ROOT;
1709 if(isTableNode() && groupId_ !=
"")
1712 return ConfigurationTree::NODE_TYPE_TABLE;
1714 return ConfigurationTree::NODE_TYPE_GROUP_LINK;
1716 return ConfigurationTree::NODE_TYPE_UID_LINK;
1718 return ConfigurationTree::NODE_TYPE_VALUE;
1719 return ConfigurationTree::NODE_TYPE_UID;
1751 return (row_ != TableView::INVALID && col_ == TableView::INVALID);
1771 const std::vector<std::string /*uid*/>& recordList,
1772 const std::vector<std::string /*relative-path*/>& fieldAcceptList,
1773 const std::vector<std::string /*relative-path*/>& fieldRejectList,
1775 bool autoSelectFilterFields)
const
1778 if(!isRootNode() && !isTableNode())
1780 __SS__ <<
"Can only get getCommonFields from a root or table node! "
1781 <<
"The node type is " << getNodeType() << __E__;
1787 std::vector<ConfigurationTree::RecordField> fieldCandidateList;
1788 std::vector<int> fieldCount;
1832 if(!recordList.size() && tableView_)
1834 const std::vector<TableViewColumnInfo>& colInfo = tableView_->getColumnsInfo();
1836 for(
unsigned int col = 0; col < colInfo.size(); ++col)
1838 __COUTS__(11) <<
"Considering field " << colInfo[col].getName() << __E__;
1841 found = fieldAcceptList.size() ? false :
true;
1843 for(
const auto& fieldFilter : fieldAcceptList)
1855 for(
const auto& fieldFilter : fieldRejectList)
1866 __COUTS__(11) <<
"FOUND field " << colInfo[col].getName() << __E__;
1868 if(colInfo[col].isChildLink())
1871 <<
"isGroupLinkNode " << colInfo[col].getName() << __E__;
1875 std::pair<
unsigned int ,
unsigned int >
1885 tableView_->getColumnInfo(linkPair.first).getName(),
1887 &tableView_->getColumnInfo(linkPair.first)));
1888 fieldCount.push_back(-1);
1893 tableView_->getColumnInfo(linkPair.second).getName(),
1895 &tableView_->getColumnInfo(linkPair.second)));
1896 fieldCount.push_back(-1);
1903 colInfo[col].getName(),
1906 fieldCount.push_back(1);
1912 for(
unsigned int i = 0; i < recordList.size(); ++i)
1914 __COUTS__(11) <<
"Checking " << recordList[i] << __E__;
1917 node.recursiveGetCommonFields(fieldCandidateList,
1928 __COUT__ <<
"======================= check for count = " << (int)recordList.size()
1933 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1935 __COUTS__(11) <<
"Checking " << fieldCandidateList[i].relativePath_
1936 << fieldCandidateList[i].columnName_ <<
" = " << fieldCount[i]
1938 if(recordList.size() != 0 && fieldCount[i] != -1 &&
1939 fieldCount[i] != (
int)recordList.size())
1941 __COUTS__(11) <<
"Erasing " << fieldCandidateList[i].relativePath_
1942 << fieldCandidateList[i].columnName_ << __E__;
1944 fieldCount.erase(fieldCount.begin() + i);
1945 fieldCandidateList.erase(fieldCandidateList.begin() + i);
1950 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1951 __COUTS__(11) <<
"Pre-Final " << fieldCandidateList[i].relativePath_
1952 << fieldCandidateList[i].columnName_ << __E__;
1954 if(autoSelectFilterFields)
1958 std::set<std::pair<
unsigned int ,
unsigned int >>
1961 unsigned int priorityPenalty;
1962 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
1964 __COUTS__(11) <<
"Option [" << i <<
"] "
1965 << fieldCandidateList[i].relativePath_
1966 << fieldCandidateList[i].columnName_ <<
" : "
1967 << fieldCandidateList[i].columnInfo_->getType() <<
":"
1968 << fieldCandidateList[i].columnInfo_->getDataType() << __E__;
1970 priorityPenalty = std::count(fieldCandidateList[i].relativePath_.begin(),
1971 fieldCandidateList[i].relativePath_.end(),
1975 if(fieldCandidateList[i].columnInfo_->isBoolType() &&
1976 (fieldCandidateList[i].columnName_ ==
1977 TableViewColumnInfo::COL_NAME_STATUS ||
1978 fieldCandidateList[i].columnName_ ==
1979 TableViewColumnInfo::COL_NAME_ENABLED))
1981 priorityPenalty += 0;
1983 else if(fieldCandidateList[i].columnInfo_->isGroupID())
1985 priorityPenalty += 1;
1987 else if(fieldCandidateList[i].columnInfo_->isBoolType())
1989 priorityPenalty += 3;
1991 else if(fieldCandidateList[i].columnInfo_->getType() ==
1992 TableViewColumnInfo::TYPE_FIXED_CHOICE_DATA)
1994 priorityPenalty += 3;
1996 else if(fieldCandidateList[i].columnInfo_->getType() ==
1997 TableViewColumnInfo::TYPE_DATA)
1999 priorityPenalty += 10;
2003 fieldCandidateList[i].tableName_ =
2007 prioritySet.emplace(
2008 std::make_pair(priorityPenalty , i ));
2009 __COUTS__(11) <<
"Option [" << i <<
"] "
2010 << fieldCandidateList[i].relativePath_
2011 << fieldCandidateList[i].columnName_ <<
" : "
2012 << fieldCandidateList[i].columnInfo_->getType() <<
":"
2013 << fieldCandidateList[i].columnInfo_->getDataType()
2014 <<
"... priority = " << priorityPenalty << __E__;
2023 unsigned int cnt = 0;
2024 for(
const auto& priorityFieldIndex : prioritySet)
2028 << cnt <<
" marking "
2029 << fieldCandidateList[priorityFieldIndex.second].relativePath_
2030 << fieldCandidateList[priorityFieldIndex.second].columnName_
2032 fieldCandidateList[priorityFieldIndex.second].tableName_ =
2037 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
2039 if(fieldCandidateList[i].tableName_ ==
"")
2041 __COUTS__(11) <<
"Erasing " << fieldCandidateList[i].relativePath_
2042 << fieldCandidateList[i].columnName_ << __E__;
2043 fieldCandidateList.erase(fieldCandidateList.begin() + i);
2049 for(
unsigned int i = 0; i < fieldCandidateList.size(); ++i)
2050 __COUT__ <<
"Final " << fieldCandidateList[i].relativePath_
2051 << fieldCandidateList[i].columnName_ << __E__;
2053 return fieldCandidateList;
2063 const std::vector<std::string /*relative-path*/>& recordList,
2064 const std::string& fieldName,
2065 std::string* fieldGroupIDChildLinkIndex )
const
2067 if(fieldGroupIDChildLinkIndex)
2068 *fieldGroupIDChildLinkIndex =
"";
2073 __SS__ <<
"Can only get getCommonFields from a table node! "
2074 <<
"The node type is " << getNodeType() << __E__;
2080 std::set<std::string > uniqueValues;
2088 if(!recordList.size() && tableView_ && fieldGroupIDChildLinkIndex)
2091 tableView_->getColumnInfo(tableView_->
findCol(fieldName));
2098 for(
unsigned int i = 0; i < recordList.size(); ++i)
2118 if(i == 0 && fieldGroupIDChildLinkIndex)
2124 for(
auto& groupID : setOfGroupIDs)
2125 uniqueValues.emplace(groupID);
2132 return uniqueValues;
2138 void ConfigurationTree::recursiveGetCommonFields(
2139 std::vector<ConfigurationTree::RecordField>& fieldCandidateList,
2140 std::vector<int>& fieldCount,
2141 const std::vector<std::string /*relative-path*/>& fieldAcceptList,
2142 const std::vector<std::string /*relative-path*/>& fieldRejectList,
2144 const std::string& relativePathBase,
2145 bool inFirstRecord)
const
2178 for(
const auto& fieldNode : recordChildren)
2184 if(fieldNode.second.isValueNode() || fieldNode.second.isGroupLinkNode())
2187 if(fieldNode.second.isValueNode())
2189 if(fieldNode.second.getColumnInfo().getType() ==
2190 TableViewColumnInfo::TYPE_AUTHOR ||
2191 fieldNode.second.getColumnInfo().getType() ==
2192 TableViewColumnInfo::TYPE_TIMESTAMP)
2205 found = fieldAcceptList.size() ? false :
true;
2207 for(
const auto& fieldFilter : fieldAcceptList)
2208 if(fieldFilter.find(
'/') != std::string::npos)
2212 fieldFilter, relativePathBase + fieldNode.first))
2229 for(
const auto& fieldFilter : fieldRejectList)
2230 if(fieldFilter.find(
'/') != std::string::npos)
2234 fieldFilter, relativePathBase + fieldNode.first))
2253 if(fieldNode.second.isGroupLinkNode())
2259 std::pair<
unsigned int ,
unsigned int >
2263 tableView_->
findCol(fieldNode.first), isGroupLink, linkPair);
2270 tableView_->getColumnInfo(linkPair.first).getName(),
2272 &tableView_->getColumnInfo(linkPair.first)));
2273 fieldCount.push_back(1);
2278 tableView_->getColumnInfo(linkPair.second).getName(),
2280 &tableView_->getColumnInfo(linkPair.second)));
2281 fieldCount.push_back(1);
2290 &fieldNode.second.getColumnInfo()));
2291 fieldCount.push_back(1);
2299 for(j = 0; j < fieldCandidateList.size(); ++j)
2301 if((relativePathBase + fieldNode.first) ==
2302 (fieldCandidateList[j].relativePath_ +
2303 fieldCandidateList[j].columnName_))
2309 if(fieldNode.second.isGroupLinkNode() &&
2310 j + 1 < fieldCandidateList.size())
2311 ++fieldCount[j + 1];
2317 else if(fieldNode.second.isUIDLinkNode())
2326 fieldAcceptList.size() ? false :
true;
2327 for(
const auto& fieldFilter : fieldAcceptList)
2328 if(fieldFilter.find(
'/') != std::string::npos)
2332 fieldFilter, relativePathBase + fieldNode.first))
2349 for(
const auto& fieldFilter : fieldRejectList)
2350 if(fieldFilter.find(
'/') != std::string::npos)
2354 fieldFilter, relativePathBase + fieldNode.first))
2372 std::pair<
unsigned int ,
unsigned int >
2378 tableView_->
findCol(fieldNode.first), isGroupLink, linkPair);
2385 tableView_->getColumnInfo(linkPair.first).getName(),
2387 &tableView_->getColumnInfo(linkPair.first)));
2388 fieldCount.push_back(1);
2393 tableView_->getColumnInfo(linkPair.second).getName(),
2395 &tableView_->getColumnInfo(linkPair.second)));
2396 fieldCount.push_back(1);
2403 for(j = 0; j < fieldCandidateList.size() - 1; ++j)
2405 if((relativePathBase + fieldNode.first) ==
2406 (fieldCandidateList[j].relativePath_ +
2407 fieldCandidateList[j].columnName_))
2413 ++fieldCount[j + 1];
2420 if(depth > 0 && !fieldNode.second.isDisconnected())
2421 fieldNode.second.recursiveGetCommonFields(
2427 (relativePathBase + fieldNode.first) +
"/",
2440 std::vector<std::vector<std::pair<std::string, ConfigurationTree>>>
2442 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2443 bool onlyStatusTrue)
const
2445 std::vector<std::vector<std::pair<std::string, ConfigurationTree>>> retVector;
2449 bool filtering = filterMap.size();
2450 std::string fieldValue;
2452 bool createContainer;
2454 std::vector<std::vector<std::string>> childrenNamesByPriority =
2457 for(
auto& childNamesAtPriority : childrenNamesByPriority)
2459 createContainer =
true;
2461 for(
auto& childName : childNamesAtPriority)
2471 retVector.push_back(
2472 std::vector<std::pair<std::string, ConfigurationTree>>());
2473 createContainer =
false;
2476 retVector[retVector.size() - 1].push_back(
2477 std::pair<std::string, ConfigurationTree>(
2478 childName, this->
getNode(childName,
true)));
2490 const std::string& childName,
2491 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap)
const
2497 for(
const auto& filterPair : filterMap)
2499 std::string filterPath = childName +
"/" + filterPair.first;
2500 __COUTV__(filterPath);
2506 std::vector<std::string> fieldValues;
2508 filterPair.second, fieldValues, std::set<char>({
','}) );
2510 __COUTV__(fieldValues.size());
2514 for(
const auto& fieldValue : fieldValues)
2528 bool groupIdFound =
false;
2531 for(
auto& groupID : setOfGroupIDs)
2533 __COUT__ <<
"\t\tGroupID Check: " << filterPair.first
2534 <<
" == " << fieldValue <<
" => "
2536 <<
" ??? " << groupID << __E__;
2542 __COUT__ <<
"Found match" << __E__;
2543 groupIdFound =
true;
2551 __COUT__ <<
"Found break match" << __E__;
2558 __COUT__ <<
"\t\tCheck: " << filterPair.first <<
" == " << fieldValue
2575 __SS__ <<
"Failed to access filter path '" << filterPath <<
"' - aborting."
2599 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2601 bool onlyStatusTrue)
const
2603 std::vector<std::pair<std::string, ConfigurationTree>> retVector;
2607 bool filtering = filterMap.size();
2609 std::string fieldValue;
2611 std::vector<std::string> childrenNames =
getChildrenNames(byPriority, onlyStatusTrue);
2613 for(
auto& childName : childrenNames)
2619 retVector.push_back(std::pair<std::string, ConfigurationTree>(
2620 childName, this->
getNode(childName,
true)));
2623 __COUTS__(2) <<
"Done w/Children of node: " <<
getValueAsString() << __E__;
2632 std::map<std::string /*relative-path*/, std::string /*value*/> filterMap,
2633 bool onlyStatusTrue)
const
2635 std::map<std::string, ConfigurationTree> retMap;
2637 bool filtering = filterMap.size();
2640 std::vector<std::string> childrenNames =
2642 for(
auto& childName : childrenNames)
2650 retMap.insert(std::pair<std::string, ConfigurationTree>(
2651 childName, this->
getNode(childName)));
2665 <<
".' Can only check the status of a UID/Record node!" << __E__;
2670 bool tmpStatus =
true;
2675 catch(
const std::runtime_error& e)
2684 bool ConfigurationTree::isStatusNode(
void)
const
2696 bool onlyStatusTrue)
const
2698 std::vector<std::vector<std::string >> retVector;
2703 <<
"' with null configuration view pointer!" << __E__;
2712 if(row_ == TableView::INVALID && col_ == TableView::INVALID)
2719 std::vector<std::vector<
unsigned int >> groupRowsByPriority =
2722 ? TableView::INVALID
2729 for(
const auto& priorityChildRowVector : groupRowsByPriority)
2731 retVector.push_back(std::vector<std::string /*child name*/>());
2732 for(
const auto& priorityChildRow : priorityChildRowVector)
2733 retVector[retVector.size() - 1].push_back(
2734 tableView_->getDataView()[priorityChildRow][tableView_->
getColUID()]);
2737 else if(row_ == TableView::INVALID)
2739 __SS__ <<
"Malformed ConfigurationTree" << __E__;
2744 else if(col_ == TableView::INVALID)
2749 for(
unsigned int c = 0; c < tableView_->getNumberOfColumns(); ++c)
2757 retVector.push_back(std::vector<std::string /*child name*/>());
2758 retVector[retVector.size() - 1].push_back(
2759 tableView_->getColumnInfo(c).getName());
2765 __SS__ <<
"\n\nError occurred looking for children of nodeName=" <<
getValueName()
2767 <<
"Invalid depth! getChildrenValues() called from a value point in the "
2768 "Configuration Tree."
2782 bool byPriority ,
bool onlyStatusTrue )
const
2784 std::vector<std::string > retVector;
2792 retVector.push_back(configPair.first);
2799 __SS__ <<
"Can not get children names of '" <<
getFieldName() <<
":"
2808 if(row_ == TableView::INVALID && col_ == TableView::INVALID)
2812 std::vector<
unsigned int > groupRows = tableView_->
getGroupRows(
2814 ? TableView::INVALID
2822 for(
const auto& groupRow : groupRows)
2823 retVector.push_back(
2824 tableView_->getDataView()[groupRow][tableView_->
getColUID()]);
2891 else if(row_ == TableView::INVALID)
2893 __SS__ <<
"Malformed ConfigurationTree" << __E__;
2898 else if(col_ == TableView::INVALID)
2903 for(
unsigned int c = 0; c < tableView_->getNumberOfColumns(); ++c)
2910 retVector.push_back(tableView_->getColumnInfo(c).getName());
2915 __SS__ <<
"\n\nError occurred looking for children of nodeName=" <<
getValueName()
2917 <<
"Invalid depth! getChildrenValues() called from a value point in the "
2918 "Configuration Tree."
2939 __SS__ <<
"Invalid node for get value." << __E__;
2943 std::string valueString =
2946 if(valueString.size() && valueString[0] ==
'/')
2953 __COUT__ <<
"Found a valid tree path in value!" << __E__;
2958 __SS__ <<
"Invalid tree path." << __E__;
2964 __SS__ <<
"Invalid value string '" << valueString
2965 <<
"' - 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)