- fixed the sub-graph notification on edge removal or replacement upon connected node movement or destruction using the new Eir SDK feature "eir::containNotify(Add-)RemoveTie"
@@ -341,6 +341,7 @@ | ||
341 | 341 | return false; |
342 | 342 | } |
343 | 343 | |
344 | +protected: | |
344 | 345 | // Reachability node replacement. |
345 | 346 | virtual void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept |
346 | 347 | { |
@@ -348,6 +349,7 @@ | ||
348 | 349 | return; |
349 | 350 | } |
350 | 351 | |
352 | +public: | |
351 | 353 | // Reference counting for runtime keep-alive. |
352 | 354 | inline void AddStackRef( void ) noexcept |
353 | 355 | { |
@@ -600,19 +602,27 @@ | ||
600 | 602 | return statements.Find( n ); |
601 | 603 | } |
602 | 604 | |
605 | +protected: | |
603 | 606 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
604 | 607 | { |
605 | 608 | if ( with == nullptr ) |
606 | 609 | { |
607 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, statements ); | |
610 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
611 | + eir::containNotifyRemoveTie( statements, std::bind( &Program::OnRemoveStatement, this, std::placeholders::_1 ) ) | |
612 | + ); | |
608 | 613 | } |
609 | 614 | else |
610 | 615 | { |
611 | - eir::replaceInContainer <COSNode*> ( what, with, statements ); | |
616 | + eir::replaceInContainer <COSNode*> ( what, with, | |
617 | + eir::containNotifyAddRemoveTie( | |
618 | + statements, | |
619 | + std::bind( &Program::OnAddStatement, this, std::placeholders::_1 ), | |
620 | + std::bind( &Program::OnRemoveStatement, this, std::placeholders::_1 ) | |
621 | + ) | |
622 | + ); | |
612 | 623 | } |
613 | 624 | } |
614 | 625 | |
615 | -protected: | |
616 | 626 | cosCommonVector <COSNode*> statements; |
617 | 627 | public: |
618 | 628 | inline void AddStatement( COSNode *node ) |
@@ -698,15 +708,22 @@ | ||
698 | 708 | return ( n == this->op ); |
699 | 709 | } |
700 | 710 | |
711 | +protected: | |
701 | 712 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
702 | 713 | { |
703 | 714 | if ( this->op == what ) |
704 | 715 | { |
716 | + this->OnUnsetOperation( what ); | |
717 | + | |
705 | 718 | this->op = with; |
719 | + | |
720 | + if ( with != nullptr ) | |
721 | + { | |
722 | + this->OnSetOperation( with ); | |
723 | + } | |
706 | 724 | } |
707 | 725 | } |
708 | 726 | |
709 | -protected: | |
710 | 727 | COSNode *op; |
711 | 728 | public: |
712 | 729 | inline void SetOperation( COSNode *op ) |
@@ -808,19 +825,33 @@ | ||
808 | 825 | return ( n == this->left || n == this->right ); |
809 | 826 | } |
810 | 827 | |
828 | +protected: | |
811 | 829 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
812 | 830 | { |
813 | 831 | if ( this->left == what ) |
814 | 832 | { |
833 | + this->OnUnsetLeft( what ); | |
834 | + | |
815 | 835 | this->left = with; |
836 | + | |
837 | + if ( with != nullptr ) | |
838 | + { | |
839 | + this->OnSetLeft( with ); | |
840 | + } | |
816 | 841 | } |
817 | 842 | if ( this->right == what ) |
818 | 843 | { |
844 | + this->OnUnsetRight( what ); | |
845 | + | |
819 | 846 | this->right = with; |
847 | + | |
848 | + if ( with != nullptr ) | |
849 | + { | |
850 | + this->OnSetRight( with ); | |
851 | + } | |
820 | 852 | } |
821 | 853 | } |
822 | 854 | |
823 | -protected: | |
824 | 855 | COSNode *left; |
825 | 856 | COSNode *right; |
826 | 857 | public: |
@@ -1039,19 +1070,33 @@ | ||
1039 | 1070 | return eir::isInContainer( n, what, params ); |
1040 | 1071 | } |
1041 | 1072 | |
1073 | +protected: | |
1042 | 1074 | void ReplaceConnection_Reach( COSNode *rwhat, COSNode *rwith ) noexcept final override |
1043 | 1075 | { |
1044 | 1076 | if ( rwith == nullptr ) |
1045 | 1077 | { |
1046 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( rwhat, what, params ); | |
1078 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( rwhat, | |
1079 | + eir::containNotifyRemoveTie( what, std::bind( &FunctionCallOperation::OnUnsetNode, this, std::placeholders::_1 ) ), | |
1080 | + eir::containNotifyRemoveTie( params, std::bind( &FunctionCallOperation::OnRemoveParam, this, std::placeholders::_1 ) ) | |
1081 | + ); | |
1047 | 1082 | } |
1048 | 1083 | else |
1049 | 1084 | { |
1050 | - eir::replaceInContainer <COSNode*> ( rwhat, rwith, what, params ); | |
1085 | + eir::replaceInContainer <COSNode*> ( rwhat, rwith, | |
1086 | + eir::containNotifyAddRemoveTie( | |
1087 | + what, | |
1088 | + std::bind( &FunctionCallOperation::OnSetNode, this, std::placeholders::_1 ), | |
1089 | + std::bind( &FunctionCallOperation::OnUnsetNode, this, std::placeholders::_1 ) | |
1090 | + ), | |
1091 | + eir::containNotifyAddRemoveTie( | |
1092 | + params, | |
1093 | + std::bind( &FunctionCallOperation::OnAddParam, this, std::placeholders::_1 ), | |
1094 | + std::bind( &FunctionCallOperation::OnRemoveParam, this, std::placeholders::_1 ) | |
1095 | + ) | |
1096 | + ); | |
1051 | 1097 | } |
1052 | 1098 | } |
1053 | 1099 | |
1054 | -protected: | |
1055 | 1100 | COSNode *what; |
1056 | 1101 | cosCommonVector <COSNode*> params; |
1057 | 1102 | public: |
@@ -1149,19 +1194,45 @@ | ||
1149 | 1194 | return eir::isInContainer( n, what, items ); |
1150 | 1195 | } |
1151 | 1196 | |
1197 | +protected: | |
1152 | 1198 | void ReplaceConnection_Reach( COSNode *rwhat, COSNode *rwith ) noexcept final override |
1153 | 1199 | { |
1200 | + // TODO: solve this edge-update-notification template more beautifully, by allowing the eir::replaceInContainer | |
1201 | + // and eir::removeFromContainer functions to call these functions on-demand if we pass a special (container, on-set, on-unset) | |
1202 | + // tuple to either. | |
1203 | + | |
1154 | 1204 | if ( rwith == nullptr ) |
1155 | 1205 | { |
1156 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( rwhat, what, items ); | |
1206 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( rwhat, | |
1207 | + eir::containNotifyAddRemoveTie( | |
1208 | + what, | |
1209 | + std::bind( &ArrayInitOperation::OnSetNode, this, std::placeholders::_1 ), | |
1210 | + std::bind( &ArrayInitOperation::OnUnsetNode, this, std::placeholders::_1 ) | |
1211 | + ), | |
1212 | + eir::containNotifyAddRemoveTie( | |
1213 | + items, | |
1214 | + std::bind( &ArrayInitOperation::OnAddItem, this, std::placeholders::_1 ), | |
1215 | + std::bind( &ArrayInitOperation::OnRemoveItem, this, std::placeholders::_1 ) | |
1216 | + ) | |
1217 | + ); | |
1157 | 1218 | } |
1158 | 1219 | else |
1159 | 1220 | { |
1160 | - eir::replaceInContainer <COSNode*> ( rwhat, rwith, what, items ); | |
1221 | + eir::replaceInContainer <COSNode*> ( rwhat, rwith, | |
1222 | + eir::containNotifyAddRemoveTie( | |
1223 | + what, | |
1224 | + std::bind( &ArrayInitOperation::OnSetNode, this, std::placeholders::_1 ), | |
1225 | + std::bind( &ArrayInitOperation::OnUnsetNode, this, std::placeholders::_1 ) | |
1226 | + ), | |
1227 | + eir::containNotifyAddRemoveTie( | |
1228 | + items, | |
1229 | + std::bind( &ArrayInitOperation::OnAddItem, this, std::placeholders::_1 ), | |
1230 | + std::bind( &ArrayInitOperation::OnRemoveItem, this, std::placeholders::_1 ) | |
1231 | + ) | |
1232 | + ); | |
1161 | 1233 | } |
1162 | 1234 | } |
1163 | 1235 | |
1164 | -protected: | |
1165 | 1236 | COSNode *what; |
1166 | 1237 | cosCommonVector <COSNode*> items; |
1167 | 1238 | public: |
@@ -1260,19 +1331,33 @@ | ||
1260 | 1331 | return eir::isInContainer( n, type, params ); |
1261 | 1332 | } |
1262 | 1333 | |
1334 | +protected: | |
1263 | 1335 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
1264 | 1336 | { |
1265 | 1337 | if ( with == nullptr ) |
1266 | 1338 | { |
1267 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, type, params ); | |
1339 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
1340 | + eir::containNotifyRemoveTie( type, std::bind( &NewOperation::OnUnsetType, this, std::placeholders::_1 ) ), | |
1341 | + eir::containNotifyRemoveTie( params, std::bind( &NewOperation::OnRemoveParam, this, std::placeholders::_1 ) ) | |
1342 | + ); | |
1268 | 1343 | } |
1269 | 1344 | else |
1270 | 1345 | { |
1271 | - eir::replaceInContainer <COSNode*> ( what, with, type, params ); | |
1346 | + eir::replaceInContainer <COSNode*> ( what, with, | |
1347 | + eir::containNotifyAddRemoveTie( | |
1348 | + type, | |
1349 | + std::bind( &NewOperation::OnSetType, this, std::placeholders::_1 ), | |
1350 | + std::bind( &NewOperation::OnUnsetType, this, std::placeholders::_1 ) | |
1351 | + ), | |
1352 | + eir::containNotifyAddRemoveTie( | |
1353 | + params, | |
1354 | + std::bind( &NewOperation::OnAddParam, this, std::placeholders::_1 ), | |
1355 | + std::bind( &NewOperation::OnRemoveParam, this, std::placeholders::_1 ) | |
1356 | + ) | |
1357 | + ); | |
1272 | 1358 | } |
1273 | 1359 | } |
1274 | 1360 | |
1275 | -protected: | |
1276 | 1361 | COSNode *type; |
1277 | 1362 | cosCommonVector <COSNode*> params; |
1278 | 1363 | public: |
@@ -1371,19 +1456,33 @@ | ||
1371 | 1456 | return eir::isInContainer( n, what, with ); |
1372 | 1457 | } |
1373 | 1458 | |
1459 | +protected: | |
1374 | 1460 | void ReplaceConnection_Reach( COSNode *rwhat, COSNode *rwith ) noexcept final override |
1375 | 1461 | { |
1376 | 1462 | if ( this->what == rwhat ) |
1377 | 1463 | { |
1464 | + this->OnUnsetWhat( rwhat ); | |
1465 | + | |
1378 | 1466 | this->what = rwith; |
1467 | + | |
1468 | + if ( rwith != nullptr ) | |
1469 | + { | |
1470 | + this->OnSetWhat( rwith ); | |
1471 | + } | |
1379 | 1472 | } |
1380 | 1473 | if ( this->with == rwhat ) |
1381 | 1474 | { |
1475 | + this->OnUnsetWith( rwhat ); | |
1476 | + | |
1382 | 1477 | this->with = rwith; |
1478 | + | |
1479 | + if ( rwith != nullptr ) | |
1480 | + { | |
1481 | + this->OnSetWith( rwith ); | |
1482 | + } | |
1383 | 1483 | } |
1384 | 1484 | } |
1385 | 1485 | |
1386 | -protected: | |
1387 | 1486 | COSNode *what; |
1388 | 1487 | COSNode *with; |
1389 | 1488 | public: |
@@ -1467,19 +1566,33 @@ | ||
1467 | 1566 | return eir::isInContainer( n, totype, castobj ); |
1468 | 1567 | } |
1469 | 1568 | |
1569 | +protected: | |
1470 | 1570 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
1471 | 1571 | { |
1472 | 1572 | if ( this->totype == what ) |
1473 | 1573 | { |
1574 | + this->OnUnsetToType( what ); | |
1575 | + | |
1474 | 1576 | this->totype = with; |
1577 | + | |
1578 | + if ( with != nullptr ) | |
1579 | + { | |
1580 | + this->OnSetToType( with ); | |
1581 | + } | |
1475 | 1582 | } |
1476 | 1583 | if ( this->castobj == what ) |
1477 | 1584 | { |
1585 | + this->OnUnsetCastObject( what ); | |
1586 | + | |
1478 | 1587 | this->castobj = with; |
1588 | + | |
1589 | + if ( with != nullptr ) | |
1590 | + { | |
1591 | + this->OnSetCastObject( with ); | |
1592 | + } | |
1479 | 1593 | } |
1480 | 1594 | } |
1481 | 1595 | |
1482 | -protected: | |
1483 | 1596 | COSNode *totype; |
1484 | 1597 | COSNode *castobj; |
1485 | 1598 | public: |
@@ -1559,19 +1672,33 @@ | ||
1559 | 1672 | return eir::isInContainer( n, templ, tparams ); |
1560 | 1673 | } |
1561 | 1674 | |
1675 | +protected: | |
1562 | 1676 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
1563 | 1677 | { |
1564 | 1678 | if ( with == nullptr ) |
1565 | 1679 | { |
1566 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, templ, tparams ); | |
1680 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
1681 | + eir::containNotifyRemoveTie( templ, std::bind( &TemplateInstantiationOperation::OnUnsetTemplate, this, std::placeholders::_1 ) ), | |
1682 | + eir::containNotifyRemoveTie( tparams, std::bind( &TemplateInstantiationOperation::OnRemoveParam, this, std::placeholders::_1 ) ) | |
1683 | + ); | |
1567 | 1684 | } |
1568 | 1685 | else |
1569 | 1686 | { |
1570 | - eir::replaceInContainer <COSNode*> ( what, with, templ, tparams ); | |
1687 | + eir::replaceInContainer <COSNode*> ( what, with, | |
1688 | + eir::containNotifyAddRemoveTie( | |
1689 | + templ, | |
1690 | + std::bind( &TemplateInstantiationOperation::OnSetTemplate, this, std::placeholders::_1 ), | |
1691 | + std::bind( &TemplateInstantiationOperation::OnUnsetTemplate, this, std::placeholders::_1 ) | |
1692 | + ), | |
1693 | + eir::containNotifyAddRemoveTie( | |
1694 | + tparams, | |
1695 | + std::bind( &TemplateInstantiationOperation::OnAddParam, this, std::placeholders::_1 ), | |
1696 | + std::bind( &TemplateInstantiationOperation::OnRemoveParam, this, std::placeholders::_1 ) | |
1697 | + ) | |
1698 | + ); | |
1571 | 1699 | } |
1572 | 1700 | } |
1573 | 1701 | |
1574 | -protected: | |
1575 | 1702 | COSNode *templ; |
1576 | 1703 | cosCommonVector <COSNode*> tparams; |
1577 | 1704 | public: |
@@ -1673,23 +1800,44 @@ | ||
1673 | 1800 | return eir::isInContainer( n, condition, true_branch, false_branch ); |
1674 | 1801 | } |
1675 | 1802 | |
1803 | +protected: | |
1676 | 1804 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
1677 | 1805 | { |
1678 | 1806 | if ( this->condition == what ) |
1679 | 1807 | { |
1808 | + this->OnUnsetCondition( what ); | |
1809 | + | |
1680 | 1810 | this->condition = with; |
1811 | + | |
1812 | + if ( with != nullptr ) | |
1813 | + { | |
1814 | + this->OnSetCondition( with ); | |
1815 | + } | |
1681 | 1816 | } |
1682 | 1817 | if ( this->true_branch == what ) |
1683 | 1818 | { |
1819 | + this->OnUnsetTrueBranch( what ); | |
1820 | + | |
1684 | 1821 | this->true_branch = with; |
1822 | + | |
1823 | + if ( with != nullptr ) | |
1824 | + { | |
1825 | + this->OnSetTrueBranch( with ); | |
1826 | + } | |
1685 | 1827 | } |
1686 | 1828 | if ( this->false_branch == what ) |
1687 | 1829 | { |
1830 | + this->OnUnsetFalseBranch( what ); | |
1831 | + | |
1688 | 1832 | this->false_branch = with; |
1833 | + | |
1834 | + if ( with != nullptr ) | |
1835 | + { | |
1836 | + this->OnSetFalseBranch( with ); | |
1837 | + } | |
1689 | 1838 | } |
1690 | 1839 | } |
1691 | 1840 | |
1692 | -protected: | |
1693 | 1841 | COSNode *condition; |
1694 | 1842 | COSNode *true_branch; |
1695 | 1843 | COSNode *false_branch; |
@@ -1788,19 +1936,33 @@ | ||
1788 | 1936 | return eir::isInContainer( n, condition, exec ); |
1789 | 1937 | } |
1790 | 1938 | |
1939 | +protected: | |
1791 | 1940 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
1792 | 1941 | { |
1793 | 1942 | if ( this->condition == what ) |
1794 | 1943 | { |
1944 | + this->OnUnsetCondition( what ); | |
1945 | + | |
1795 | 1946 | this->condition = with; |
1947 | + | |
1948 | + if ( with != nullptr ) | |
1949 | + { | |
1950 | + this->OnSetCondition( with ); | |
1951 | + } | |
1796 | 1952 | } |
1797 | 1953 | if ( this->exec == what ) |
1798 | 1954 | { |
1955 | + this->OnUnsetExec( what ); | |
1956 | + | |
1799 | 1957 | this->exec = with; |
1958 | + | |
1959 | + if ( with != nullptr ) | |
1960 | + { | |
1961 | + this->OnSetExec( with ); | |
1962 | + } | |
1800 | 1963 | } |
1801 | 1964 | } |
1802 | 1965 | |
1803 | -protected: | |
1804 | 1966 | COSNode *condition; |
1805 | 1967 | COSNode *exec; |
1806 | 1968 | public: |
@@ -1884,27 +2046,55 @@ | ||
1884 | 2046 | return eir::isInContainer( n, init, condition, iteration, exec ); |
1885 | 2047 | } |
1886 | 2048 | |
2049 | +protected: | |
1887 | 2050 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
1888 | 2051 | { |
1889 | 2052 | if ( this->init == what ) |
1890 | 2053 | { |
2054 | + this->OnUnsetInit( what ); | |
2055 | + | |
1891 | 2056 | this->init = with; |
2057 | + | |
2058 | + if ( with != nullptr ) | |
2059 | + { | |
2060 | + this->OnSetInit( with ); | |
2061 | + } | |
1892 | 2062 | } |
1893 | 2063 | if ( this->condition == what ) |
1894 | 2064 | { |
2065 | + this->OnUnsetCondition( what ); | |
2066 | + | |
1895 | 2067 | this->condition = with; |
2068 | + | |
2069 | + if ( with != nullptr ) | |
2070 | + { | |
2071 | + this->OnSetCondition( with ); | |
2072 | + } | |
1896 | 2073 | } |
1897 | 2074 | if ( this->iteration == what ) |
1898 | 2075 | { |
2076 | + this->OnUnsetIteration( what ); | |
2077 | + | |
1899 | 2078 | this->iteration = with; |
2079 | + | |
2080 | + if ( with != nullptr ) | |
2081 | + { | |
2082 | + this->OnSetIteration( with ); | |
2083 | + } | |
1900 | 2084 | } |
1901 | 2085 | if ( this->exec == what ) |
1902 | 2086 | { |
2087 | + this->OnUnsetExec( what ); | |
2088 | + | |
1903 | 2089 | this->exec = with; |
2090 | + | |
2091 | + if ( with != nullptr ) | |
2092 | + { | |
2093 | + this->OnSetExec( with ); | |
2094 | + } | |
1904 | 2095 | } |
1905 | 2096 | } |
1906 | 2097 | |
1907 | -protected: | |
1908 | 2098 | COSNode *init; |
1909 | 2099 | COSNode *condition; |
1910 | 2100 | COSNode *iteration; |
@@ -2033,15 +2223,22 @@ | ||
2033 | 2223 | return ( n == this->op ); |
2034 | 2224 | } |
2035 | 2225 | |
2226 | +protected: | |
2036 | 2227 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2037 | 2228 | { |
2038 | 2229 | if ( this->op == what ) |
2039 | 2230 | { |
2231 | + this->OnUnsetNode( what ); | |
2232 | + | |
2040 | 2233 | this->op = with; |
2234 | + | |
2235 | + if ( with != nullptr ) | |
2236 | + { | |
2237 | + this->OnSetNode( with ); | |
2238 | + } | |
2041 | 2239 | } |
2042 | 2240 | } |
2043 | 2241 | |
2044 | -protected: | |
2045 | 2242 | COSNode *op; |
2046 | 2243 | public: |
2047 | 2244 | inline void SetNode( COSNode *newop ) |
@@ -2109,23 +2306,44 @@ | ||
2109 | 2306 | return eir::isInContainer( n, name, type, initializer ); |
2110 | 2307 | } |
2111 | 2308 | |
2309 | +protected: | |
2112 | 2310 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2113 | 2311 | { |
2114 | 2312 | if ( this->name == what ) |
2115 | 2313 | { |
2314 | + this->OnUnsetName( what ); | |
2315 | + | |
2116 | 2316 | this->name = with; |
2317 | + | |
2318 | + if ( with != nullptr ) | |
2319 | + { | |
2320 | + this->OnSetName( with ); | |
2321 | + } | |
2117 | 2322 | } |
2118 | 2323 | if ( this->type == what ) |
2119 | 2324 | { |
2325 | + this->OnUnsetType( what ); | |
2326 | + | |
2120 | 2327 | this->type = with; |
2328 | + | |
2329 | + if ( with != nullptr ) | |
2330 | + { | |
2331 | + this->OnSetType( with ); | |
2332 | + } | |
2121 | 2333 | } |
2122 | 2334 | if ( this->initializer == what ) |
2123 | 2335 | { |
2336 | + this->OnUnsetInitializer( what ); | |
2337 | + | |
2124 | 2338 | this->initializer = with; |
2339 | + | |
2340 | + if ( with != nullptr ) | |
2341 | + { | |
2342 | + this->OnSetInitializer( with ); | |
2343 | + } | |
2125 | 2344 | } |
2126 | 2345 | } |
2127 | 2346 | |
2128 | -protected: | |
2129 | 2347 | COSNode *name; |
2130 | 2348 | COSNode *type; |
2131 | 2349 | COSNode *initializer; |
@@ -2219,22 +2437,30 @@ | ||
2219 | 2437 | return eir::isInContainer( n, decls ); |
2220 | 2438 | } |
2221 | 2439 | |
2440 | +protected: | |
2222 | 2441 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2223 | 2442 | { |
2224 | 2443 | if ( with == nullptr ) |
2225 | 2444 | { |
2226 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, decls ); | |
2445 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
2446 | + eir::containNotifyRemoveTie( decls, std::bind( &MultiDeclarationStatement::OnRemoveDeclaration, this, std::placeholders::_1 ) ) | |
2447 | + ); | |
2227 | 2448 | } |
2228 | 2449 | else |
2229 | 2450 | { |
2230 | 2451 | if ( DeclarationStatement *decl_with = dynamic_cast <DeclarationStatement*> ( with ) ) |
2231 | 2452 | { |
2232 | - eir::replaceInContainer <COSNode*> ( what, decl_with, decls ); | |
2453 | + eir::replaceInContainer <COSNode*> ( what, decl_with, | |
2454 | + eir::containNotifyAddRemoveTie( | |
2455 | + decls, | |
2456 | + std::bind( &MultiDeclarationStatement::OnAddDeclaration, this, std::placeholders::_1 ), | |
2457 | + std::bind( &MultiDeclarationStatement::OnRemoveDeclaration, this, std::placeholders::_1 ) | |
2458 | + ) | |
2459 | + ); | |
2233 | 2460 | } |
2234 | 2461 | } |
2235 | 2462 | } |
2236 | 2463 | |
2237 | -protected: | |
2238 | 2464 | cosCommonVector <DeclarationStatement*> decls; |
2239 | 2465 | public: |
2240 | 2466 | inline void AddDeclaration( DeclarationStatement *newdecl ) |
@@ -2314,19 +2540,33 @@ | ||
2314 | 2540 | return eir::isInContainer( n, srctype, dsttype ); |
2315 | 2541 | } |
2316 | 2542 | |
2543 | +protected: | |
2317 | 2544 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2318 | 2545 | { |
2319 | 2546 | if ( this->srctype == what ) |
2320 | 2547 | { |
2548 | + this->OnUnsetSrcType( what ); | |
2549 | + | |
2321 | 2550 | this->srctype = with; |
2551 | + | |
2552 | + if ( with != nullptr ) | |
2553 | + { | |
2554 | + this->OnSetSrcType( with ); | |
2555 | + } | |
2322 | 2556 | } |
2323 | 2557 | if ( this->dsttype == what ) |
2324 | 2558 | { |
2559 | + this->OnUnsetDstType( what ); | |
2560 | + | |
2325 | 2561 | this->dsttype = with; |
2562 | + | |
2563 | + if ( with != nullptr ) | |
2564 | + { | |
2565 | + this->OnSetDstType( with ); | |
2566 | + } | |
2326 | 2567 | } |
2327 | 2568 | } |
2328 | 2569 | |
2329 | -protected: | |
2330 | 2570 | COSNode *srctype; |
2331 | 2571 | COSNode *dsttype; |
2332 | 2572 | public: |
@@ -2398,22 +2638,30 @@ | ||
2398 | 2638 | return eir::isInContainer( n, defs ); |
2399 | 2639 | } |
2400 | 2640 | |
2641 | +protected: | |
2401 | 2642 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2402 | 2643 | { |
2403 | 2644 | if ( with == nullptr ) |
2404 | 2645 | { |
2405 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, defs ); | |
2646 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
2647 | + eir::containNotifyRemoveTie( defs, std::bind( &MultiTypedefStatement::OnRemoveTypedef, this, std::placeholders::_1 ) ) | |
2648 | + ); | |
2406 | 2649 | } |
2407 | 2650 | else |
2408 | 2651 | { |
2409 | 2652 | if ( TypedefStatement *tdef_with = dynamic_cast <TypedefStatement*> ( with ) ) |
2410 | 2653 | { |
2411 | - eir::replaceInContainer <COSNode*> ( what, tdef_with, defs ); | |
2654 | + eir::replaceInContainer <COSNode*> ( what, tdef_with, | |
2655 | + eir::containNotifyAddRemoveTie( | |
2656 | + defs, | |
2657 | + std::bind( &MultiTypedefStatement::OnAddTypedef, this, std::placeholders::_1 ), | |
2658 | + std::bind( &MultiTypedefStatement::OnRemoveTypedef, this, std::placeholders::_1 ) | |
2659 | + ) | |
2660 | + ); | |
2412 | 2661 | } |
2413 | 2662 | } |
2414 | 2663 | } |
2415 | 2664 | |
2416 | -protected: | |
2417 | 2665 | cosCommonVector <TypedefStatement*> defs; |
2418 | 2666 | public: |
2419 | 2667 | inline void AddTypedef( TypedefStatement *newtypedef ) |
@@ -2486,19 +2734,27 @@ | ||
2486 | 2734 | return eir::isInContainer( n, statements ); |
2487 | 2735 | } |
2488 | 2736 | |
2737 | +protected: | |
2489 | 2738 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2490 | 2739 | { |
2491 | 2740 | if ( with == nullptr ) |
2492 | 2741 | { |
2493 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, statements ); | |
2742 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
2743 | + eir::containNotifyRemoveTie( statements, std::bind( &BlockStatement::OnRemoveStatement, this, std::placeholders::_1 ) ) | |
2744 | + ); | |
2494 | 2745 | } |
2495 | 2746 | else |
2496 | 2747 | { |
2497 | - eir::replaceInContainer <COSNode*> ( what, with, statements ); | |
2748 | + eir::replaceInContainer <COSNode*> ( what, with, | |
2749 | + eir::containNotifyAddRemoveTie( | |
2750 | + statements, | |
2751 | + std::bind( &BlockStatement::OnAddStatement, this, std::placeholders::_1 ), | |
2752 | + std::bind( &BlockStatement::OnRemoveStatement, this, std::placeholders::_1 ) | |
2753 | + ) | |
2754 | + ); | |
2498 | 2755 | } |
2499 | 2756 | } |
2500 | 2757 | |
2501 | -protected: | |
2502 | 2758 | cosCommonVector <COSNode*> statements; |
2503 | 2759 | public: |
2504 | 2760 | inline void AddStatement( COSNode *stmt ) |
@@ -2579,15 +2835,22 @@ | ||
2579 | 2835 | return ( n == this->op ); |
2580 | 2836 | } |
2581 | 2837 | |
2838 | +protected: | |
2582 | 2839 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2583 | 2840 | { |
2584 | 2841 | if ( this->op == what ) |
2585 | 2842 | { |
2843 | + this->OnUnsetNode( what ); | |
2844 | + | |
2586 | 2845 | this->op = with; |
2846 | + | |
2847 | + if ( with != nullptr ) | |
2848 | + { | |
2849 | + this->OnSetNode( with ); | |
2850 | + } | |
2587 | 2851 | } |
2588 | 2852 | } |
2589 | 2853 | |
2590 | -protected: | |
2591 | 2854 | COSNode *op; |
2592 | 2855 | public: |
2593 | 2856 | inline void SetNode( COSNode *newop ) |
@@ -2645,19 +2908,33 @@ | ||
2645 | 2908 | return eir::isInContainer( n, caught_decl, catch_body ); |
2646 | 2909 | } |
2647 | 2910 | |
2911 | +protected: | |
2648 | 2912 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2649 | 2913 | { |
2650 | 2914 | if ( this->caught_decl == what ) |
2651 | 2915 | { |
2916 | + this->OnUnsetCaughtDecl( what ); | |
2917 | + | |
2652 | 2918 | this->caught_decl = with; |
2919 | + | |
2920 | + if ( with != nullptr ) | |
2921 | + { | |
2922 | + this->OnSetCaughtDecl( with ); | |
2923 | + } | |
2653 | 2924 | } |
2654 | 2925 | if ( this->catch_body == what ) |
2655 | 2926 | { |
2927 | + this->OnUnsetCatchBody( what ); | |
2928 | + | |
2656 | 2929 | this->catch_body = with; |
2930 | + | |
2931 | + if ( with != nullptr ) | |
2932 | + { | |
2933 | + this->OnSetCatchBody( with ); | |
2934 | + } | |
2657 | 2935 | } |
2658 | 2936 | } |
2659 | 2937 | |
2660 | -protected: | |
2661 | 2938 | COSNode *caught_decl; |
2662 | 2939 | COSNode *catch_body; |
2663 | 2940 | public: |
@@ -2735,27 +3012,40 @@ | ||
2735 | 3012 | return eir::isInContainer( n, try_body, errors ); |
2736 | 3013 | } |
2737 | 3014 | |
3015 | +protected: | |
2738 | 3016 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2739 | 3017 | { |
2740 | 3018 | if ( with == nullptr ) |
2741 | 3019 | { |
2742 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, try_body, errors ); | |
3020 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
3021 | + eir::containNotifyRemoveTie( try_body, std::bind( &TryStatement::OnUnsetTryBody, this, std::placeholders::_1 ) ), | |
3022 | + eir::containNotifyRemoveTie( errors, std::bind( &TryStatement::OnRemoveError, this, std::placeholders::_1 ) ) | |
3023 | + ); | |
2743 | 3024 | } |
2744 | 3025 | else |
2745 | 3026 | { |
2746 | 3027 | if ( CatchStatement *catch_with = dynamic_cast <CatchStatement*> ( with ) ) |
2747 | 3028 | { |
2748 | - eir::replaceInContainer <COSNode*> ( what, catch_with, errors ); | |
3029 | + eir::replaceInContainer <COSNode*> ( what, catch_with, | |
3030 | + eir::containNotifyAddRemoveTie( | |
3031 | + errors, | |
3032 | + std::bind( &TryStatement::OnAddError, this, std::placeholders::_1 ), | |
3033 | + std::bind( &TryStatement::OnRemoveError, this, std::placeholders::_1 ) | |
3034 | + ) | |
3035 | + ); | |
2749 | 3036 | } |
2750 | 3037 | |
2751 | 3038 | if ( this->try_body == what ) |
2752 | 3039 | { |
3040 | + this->OnUnsetTryBody( what ); | |
3041 | + | |
2753 | 3042 | this->try_body = with; |
3043 | + | |
3044 | + this->OnSetTryBody( with ); | |
2754 | 3045 | } |
2755 | 3046 | } |
2756 | 3047 | } |
2757 | 3048 | |
2758 | -protected: | |
2759 | 3049 | COSNode *try_body; |
2760 | 3050 | cosCommonVector <CatchStatement*> errors; |
2761 | 3051 | public: |
@@ -2855,19 +3145,33 @@ | ||
2855 | 3145 | return eir::isInContainer( n, name, body ); |
2856 | 3146 | } |
2857 | 3147 | |
3148 | +protected: | |
2858 | 3149 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2859 | 3150 | { |
2860 | 3151 | if ( this->name == what ) |
2861 | 3152 | { |
3153 | + this->OnUnsetName( what ); | |
3154 | + | |
2862 | 3155 | this->name = with; |
3156 | + | |
3157 | + if ( with != nullptr ) | |
3158 | + { | |
3159 | + this->OnSetName( with ); | |
3160 | + } | |
2863 | 3161 | } |
2864 | 3162 | if ( this->body == what ) |
2865 | 3163 | { |
3164 | + this->OnUnsetBody( what ); | |
3165 | + | |
2866 | 3166 | this->body = with; |
3167 | + | |
3168 | + if ( with != nullptr ) | |
3169 | + { | |
3170 | + this->OnSetBody( with ); | |
3171 | + } | |
2867 | 3172 | } |
2868 | 3173 | } |
2869 | 3174 | |
2870 | -protected: | |
2871 | 3175 | COSNode *name; |
2872 | 3176 | COSNode *body; |
2873 | 3177 | public: |
@@ -2945,19 +3249,33 @@ | ||
2945 | 3249 | return eir::isInContainer( n, params, body ); |
2946 | 3250 | } |
2947 | 3251 | |
3252 | +protected: | |
2948 | 3253 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
2949 | 3254 | { |
2950 | 3255 | if ( with == nullptr ) |
2951 | 3256 | { |
2952 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, params, body ); | |
3257 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
3258 | + eir::containNotifyRemoveTie( params, std::bind( &ConstructorDefinition::OnRemoveParam, this, std::placeholders::_1 ) ), | |
3259 | + eir::containNotifyRemoveTie( body, std::bind( &ConstructorDefinition::OnUnsetBody, this, std::placeholders::_1 ) ) | |
3260 | + ); | |
2953 | 3261 | } |
2954 | 3262 | else |
2955 | 3263 | { |
2956 | - eir::replaceInContainer <COSNode*> ( what, with, params, body ); | |
3264 | + eir::replaceInContainer <COSNode*> ( what, with, | |
3265 | + eir::containNotifyAddRemoveTie( | |
3266 | + params, | |
3267 | + std::bind( &ConstructorDefinition::OnAddParam, this, std::placeholders::_1 ), | |
3268 | + std::bind( &ConstructorDefinition::OnRemoveParam, this, std::placeholders::_1 ) | |
3269 | + ), | |
3270 | + eir::containNotifyAddRemoveTie( | |
3271 | + body, | |
3272 | + std::bind( &ConstructorDefinition::OnSetBody, this, std::placeholders::_1 ), | |
3273 | + std::bind( &ConstructorDefinition::OnUnsetBody, this, std::placeholders::_1 ) | |
3274 | + ) | |
3275 | + ); | |
2957 | 3276 | } |
2958 | 3277 | } |
2959 | 3278 | |
2960 | -protected: | |
2961 | 3279 | cosCommonVector <COSNode*> params; |
2962 | 3280 | COSNode *body; |
2963 | 3281 | public: |
@@ -3058,15 +3376,22 @@ | ||
3058 | 3376 | return ( n == this->body ); |
3059 | 3377 | } |
3060 | 3378 | |
3379 | +protected: | |
3061 | 3380 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3062 | 3381 | { |
3063 | 3382 | if ( this->body == what ) |
3064 | 3383 | { |
3384 | + this->OnUnsetBody( what ); | |
3385 | + | |
3065 | 3386 | this->body = with; |
3387 | + | |
3388 | + if ( with != nullptr ) | |
3389 | + { | |
3390 | + this->OnSetBody( with ); | |
3391 | + } | |
3066 | 3392 | } |
3067 | 3393 | } |
3068 | 3394 | |
3069 | -protected: | |
3070 | 3395 | COSNode *body; |
3071 | 3396 | public: |
3072 | 3397 | inline void SetBody( COSNode *newbody ) |
@@ -3324,15 +3649,22 @@ | ||
3324 | 3649 | return ( n == this->spec ); |
3325 | 3650 | } |
3326 | 3651 | |
3652 | +protected: | |
3327 | 3653 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept override |
3328 | 3654 | { |
3329 | 3655 | if ( this->spec == what ) |
3330 | 3656 | { |
3657 | + this->OnUnsetSpec( what ); | |
3658 | + | |
3331 | 3659 | this->spec = with; |
3660 | + | |
3661 | + if ( with != nullptr ) | |
3662 | + { | |
3663 | + this->OnSetSpec( with ); | |
3664 | + } | |
3332 | 3665 | } |
3333 | 3666 | } |
3334 | 3667 | |
3335 | -protected: | |
3336 | 3668 | COSNode *spec; |
3337 | 3669 | public: |
3338 | 3670 | inline void SetSpec( COSNode *newspec ) |
@@ -3396,6 +3728,7 @@ | ||
3396 | 3728 | return TypeSpecifier::IsNodeConnectedTo_Reach( n ) || ( this->array_size_op == n ); |
3397 | 3729 | } |
3398 | 3730 | |
3731 | +protected: | |
3399 | 3732 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3400 | 3733 | { |
3401 | 3734 | TypeSpecifier::ReplaceConnection_Reach( what, with ); |
@@ -3402,11 +3735,17 @@ | ||
3402 | 3735 | |
3403 | 3736 | if ( this->array_size_op == what ) |
3404 | 3737 | { |
3738 | + this->OnUnsetArraySizeOp( what ); | |
3739 | + | |
3405 | 3740 | this->array_size_op = with; |
3741 | + | |
3742 | + if ( with != nullptr ) | |
3743 | + { | |
3744 | + this->OnSetArraySizeOp( with ); | |
3745 | + } | |
3406 | 3746 | } |
3407 | 3747 | } |
3408 | 3748 | |
3409 | -protected: | |
3410 | 3749 | COSNode *array_size_op; |
3411 | 3750 | public: |
3412 | 3751 | inline void SetArraySizeOp( COSNode *newsizeop ) |
@@ -3457,19 +3796,27 @@ | ||
3457 | 3796 | return eir::isInContainer( n, params ); |
3458 | 3797 | } |
3459 | 3798 | |
3799 | +protected: | |
3460 | 3800 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3461 | 3801 | { |
3462 | 3802 | if ( with == nullptr ) |
3463 | 3803 | { |
3464 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, params ); | |
3804 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
3805 | + eir::containNotifyRemoveTie( params, std::bind( &CurlyPack::OnRemoveParam, this, std::placeholders::_1 ) ) | |
3806 | + ); | |
3465 | 3807 | } |
3466 | 3808 | else |
3467 | 3809 | { |
3468 | - eir::replaceInContainer <COSNode*> ( what, with, params ); | |
3810 | + eir::replaceInContainer <COSNode*> ( what, with, | |
3811 | + eir::containNotifyAddRemoveTie( | |
3812 | + params, | |
3813 | + std::bind( &CurlyPack::OnAddParam, this, std::placeholders::_1 ), | |
3814 | + std::bind( &CurlyPack::OnRemoveParam, this, std::placeholders::_1 ) | |
3815 | + ) | |
3816 | + ); | |
3469 | 3817 | } |
3470 | 3818 | } |
3471 | 3819 | |
3472 | -protected: | |
3473 | 3820 | cosCommonVector <COSNode*> params; |
3474 | 3821 | public: |
3475 | 3822 | inline void AddParam( COSNode *newparam ) |
@@ -3542,19 +3889,30 @@ | ||
3542 | 3889 | return eir::isInContainer( n, items ); |
3543 | 3890 | } |
3544 | 3891 | |
3892 | +protected: | |
3545 | 3893 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3546 | 3894 | { |
3547 | 3895 | if ( with == nullptr ) |
3548 | 3896 | { |
3549 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, items ); | |
3897 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
3898 | + eir::containNotifyRemoveTie( | |
3899 | + items, | |
3900 | + std::bind( &ArrayDefinition::OnRemoveItem, this, std::placeholders::_1 ) | |
3901 | + ) | |
3902 | + ); | |
3550 | 3903 | } |
3551 | 3904 | else |
3552 | 3905 | { |
3553 | - eir::replaceInContainer <COSNode*> ( what, with, items ); | |
3906 | + eir::replaceInContainer <COSNode*> ( what, with, | |
3907 | + eir::containNotifyAddRemoveTie( | |
3908 | + items, | |
3909 | + std::bind( &ArrayDefinition::OnAddItem, this, std::placeholders::_1 ), | |
3910 | + std::bind( &ArrayDefinition::OnRemoveItem, this, std::placeholders::_1 ) | |
3911 | + ) | |
3912 | + ); | |
3554 | 3913 | } |
3555 | 3914 | } |
3556 | 3915 | |
3557 | -protected: | |
3558 | 3916 | cosCommonVector <COSNode*> items; |
3559 | 3917 | public: |
3560 | 3918 | inline void AddItem( COSNode *newitem ) |
@@ -3644,19 +4002,33 @@ | ||
3644 | 4002 | return eir::isInContainer( n, return_type, params ); |
3645 | 4003 | } |
3646 | 4004 | |
4005 | +protected: | |
3647 | 4006 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3648 | 4007 | { |
3649 | 4008 | if ( with == nullptr ) |
3650 | 4009 | { |
3651 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, return_type, params ); | |
4010 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
4011 | + eir::containNotifyRemoveTie( return_type, std::bind( &FuncsigDefinition::OnUnsetReturnType, this, std::placeholders::_1 ) ), | |
4012 | + eir::containNotifyRemoveTie( params, std::bind( &FuncsigDefinition::OnRemoveParam, this, std::placeholders::_1 ) ) | |
4013 | + ); | |
3652 | 4014 | } |
3653 | 4015 | else |
3654 | 4016 | { |
3655 | - eir::replaceInContainer <COSNode*> ( what, with, return_type, params ); | |
4017 | + eir::replaceInContainer <COSNode*> ( what, with, | |
4018 | + eir::containNotifyAddRemoveTie( | |
4019 | + return_type, | |
4020 | + std::bind( &FuncsigDefinition::OnSetReturnType, this, std::placeholders::_1 ), | |
4021 | + std::bind( &FuncsigDefinition::OnUnsetReturnType, this, std::placeholders::_1 ) | |
4022 | + ), | |
4023 | + eir::containNotifyAddRemoveTie( | |
4024 | + params, | |
4025 | + std::bind( &FuncsigDefinition::OnAddParam, this, std::placeholders::_1 ), | |
4026 | + std::bind( &FuncsigDefinition::OnRemoveParam, this, std::placeholders::_1 ) | |
4027 | + ) | |
4028 | + ); | |
3656 | 4029 | } |
3657 | 4030 | } |
3658 | 4031 | |
3659 | -protected: | |
3660 | 4032 | COSNode *return_type; |
3661 | 4033 | cosCommonVector <COSNode*> params; |
3662 | 4034 | public: |
@@ -3756,19 +4128,33 @@ | ||
3756 | 4128 | return eir::isInContainer( n, name, toinclude ); |
3757 | 4129 | } |
3758 | 4130 | |
4131 | +protected: | |
3759 | 4132 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3760 | 4133 | { |
3761 | 4134 | if ( this->name == what ) |
3762 | 4135 | { |
4136 | + this->OnUnsetName( what ); | |
4137 | + | |
3763 | 4138 | this->name = with; |
4139 | + | |
4140 | + if ( with != nullptr ) | |
4141 | + { | |
4142 | + this->OnSetName( with ); | |
4143 | + } | |
3764 | 4144 | } |
3765 | 4145 | if ( this->toinclude == what ) |
3766 | 4146 | { |
4147 | + this->OnUnsetToInclude( what ); | |
4148 | + | |
3767 | 4149 | this->toinclude = with; |
4150 | + | |
4151 | + if ( with != nullptr ) | |
4152 | + { | |
4153 | + this->OnSetToInclude( with ); | |
4154 | + } | |
3768 | 4155 | } |
3769 | 4156 | } |
3770 | 4157 | |
3771 | -protected: | |
3772 | 4158 | COSNode *name; |
3773 | 4159 | COSNode *toinclude; |
3774 | 4160 | public: |
@@ -3848,15 +4234,22 @@ | ||
3848 | 4234 | return ( n == this->nsname ); |
3849 | 4235 | } |
3850 | 4236 | |
4237 | +protected: | |
3851 | 4238 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3852 | 4239 | { |
3853 | 4240 | if ( this->nsname == what ) |
3854 | 4241 | { |
4242 | + this->OnUnsetName( what ); | |
4243 | + | |
3855 | 4244 | this->nsname = with; |
4245 | + | |
4246 | + if ( with != nullptr ) | |
4247 | + { | |
4248 | + this->OnSetName( with ); | |
4249 | + } | |
3856 | 4250 | } |
3857 | 4251 | } |
3858 | 4252 | |
3859 | -protected: | |
3860 | 4253 | COSNode *nsname; |
3861 | 4254 | public: |
3862 | 4255 | inline void SetName( COSNode *newnsname ) |
@@ -3947,15 +4340,30 @@ | ||
3947 | 4340 | return eir::isInContainer( n, name, itemrefs ); |
3948 | 4341 | } |
3949 | 4342 | |
4343 | +protected: | |
3950 | 4344 | void ReplaceConnection_Reach( COSNode *what, COSNode *with ) noexcept final override |
3951 | 4345 | { |
3952 | 4346 | if ( with == nullptr ) |
3953 | 4347 | { |
3954 | - eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, name, itemrefs ); | |
4348 | + eir::removeFromContainer <COSNode*, eir::eUniqueVectorRemovalPolicy::REPLACE_WITH_DEFAULT> ( what, | |
4349 | + eir::containNotifyRemoveTie( name, std::bind( &EnumDefinition::OnUnsetName, this, std::placeholders::_1 ) ), | |
4350 | + eir::containNotifyRemoveTie( itemrefs, std::bind( &EnumDefinition::OnRemoveItemNode, this, std::placeholders::_1 ) ) | |
4351 | + ); | |
3955 | 4352 | } |
3956 | 4353 | else |
3957 | 4354 | { |
3958 | - eir::replaceInContainer <COSNode*> ( what, with, name, itemrefs ); | |
4355 | + eir::replaceInContainer <COSNode*> ( what, with, | |
4356 | + eir::containNotifyAddRemoveTie( | |
4357 | + name, | |
4358 | + std::bind( &EnumDefinition::OnSetName, this, std::placeholders::_1 ), | |
4359 | + std::bind( &EnumDefinition::OnUnsetName, this, std::placeholders::_1 ) | |
4360 | + ), | |
4361 | + eir::containNotifyAddRemoveTie( | |
4362 | + itemrefs, | |
4363 | + std::bind( &EnumDefinition::OnAddItemNode, this, std::placeholders::_1 ), | |
4364 | + std::bind( &EnumDefinition::OnRemoveItemNode, this, std::placeholders::_1 ) | |
4365 | + ) | |
4366 | + ); | |
3959 | 4367 | } |
3960 | 4368 | |
3961 | 4369 | size_t idx = 0; |
@@ -3985,7 +4393,6 @@ | ||
3985 | 4393 | } |
3986 | 4394 | } |
3987 | 4395 | |
3988 | -protected: | |
3989 | 4396 | COSNode *name; |
3990 | 4397 | cosCommonVector <item> items; |
3991 | 4398 |
@@ -4023,7 +4430,14 @@ | ||
4023 | 4430 | |
4024 | 4431 | try |
4025 | 4432 | { |
4026 | - this->OnAddItem( i ); | |
4433 | + if ( i.key ) | |
4434 | + { | |
4435 | + this->OnAddItemNode( i.key ); | |
4436 | + } | |
4437 | + if ( i.value ) | |
4438 | + { | |
4439 | + this->OnAddItemNode( i.value ); | |
4440 | + } | |
4027 | 4441 | |
4028 | 4442 | COSObjects *sys = this->sys; |
4029 | 4443 |
@@ -4069,11 +4483,11 @@ | ||
4069 | 4483 | { |
4070 | 4484 | return; |
4071 | 4485 | } |
4072 | - virtual void OnAddItem( const item& i ) | |
4486 | + virtual void OnAddItemNode( COSNode *n ) | |
4073 | 4487 | { |
4074 | 4488 | return; |
4075 | 4489 | } |
4076 | - virtual void OnRemoveItem( const item& i ) | |
4490 | + virtual void OnRemoveItemNode( COSNode *n ) | |
4077 | 4491 | { |
4078 | 4492 | return; |
4079 | 4493 | } |