11 #ifndef FAUDES_HIO_ENVIRONMENT_H
12 #define FAUDES_HIO_ENVIRONMENT_H
46 template <
class GlobalAttr,
class StateAttr,
class EventAttr,
class TransAttr>
201 void SetYe(
const std::string& rName);
225 void SetUe(
const std::string& rName);
255 bool IsYe(
const std::string& rName)
const;
277 bool IsUe(
const std::string& rName)
const;
351 void SetYl(
const std::string& rName);
375 void SetUl(
const std::string& rName);
405 bool IsYl(
const std::string& rName)
const;
427 bool IsUl(
const std::string& rName)
const;
456 bool IsY(
Idx index)
const;
467 bool IsY(
const std::string& rName)
const;
486 bool IsU(
Idx index)
const;
497 bool IsU(
const std::string& rName)
const;
516 bool IsE(
Idx index)
const;
527 bool IsE(
const std::string& rName)
const;
546 bool IsL(
Idx index)
const;
557 bool IsL(
const std::string& rName)
const;
585 void SetQYe(
const std::string& rName);
608 void ClrQYe(
const std::string& rName);
637 bool IsQYe(
const std::string& rName)
const;
661 void SetQUe(
const std::string& rName);
684 void ClrQUe(
const std::string& rName);
713 bool IsQUe(
const std::string& rName)
const;
737 void SetQUl(
const std::string& rName);
760 void ClrQUl(
const std::string& rName);
789 bool IsQUl(
const std::string& rName)
const;
813 void SetQYlUe(
const std::string& rName);
836 void ClrQYlUe(
const std::string& rName);
865 bool IsQYlUe(
const std::string& rName)
const;
889 void SetErr(
const std::string& rName);
912 void ClrErr(
const std::string& rName);
941 bool IsErr(
const std::string& rName)
const;
969 #define THIS THioEnvironment<GlobalAttr, StateAttr, EventAttr, TransAttr>
970 #define BASE TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
971 #define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
976 FD_DG(
"HioEnvironment(" <<
this <<
")::HioEnvironment()");
981 FD_DG(
"HioEnvironment(" <<
this <<
")::HioEnvironment(rOtherGen)");
986 FD_DG(
"HioEnvironment(" <<
this <<
")::HioEnvironment(rOtherGen)");
996 ) :
BASE(rOtherGen) {
997 FD_DG(
"HioEnvironment(" <<
this <<
")::HioEnvironment(rOtherGen)");
1005 TEMP THIS::THioEnvironment(
const std::string& rFileName) :
BASE(rFileName) {
1006 FD_DG(
"HioEnvironment(" <<
this <<
")::HioEnvironment(rFilename) : done");
1014 res->EventSymbolTablep(BASE::mpEventSymbolTable);
1015 res->mStateNamesEnabled=BASE::mStateNamesEnabled;
1021 return new THIS(*
this);
1027 THIS res= BASE::NewAGen();
1035 EventAttr attr=BASE::EventAttribute(index);
1040 TEMP bool THIS::IsY(
const std::string& rName)
const {
1041 EventAttr attr=BASE::EventAttribute(rName);
1047 EventAttr attr=BASE::EventAttribute(index);
1052 TEMP bool THIS::IsU(
const std::string& rName)
const {
1053 EventAttr attr=BASE::EventAttribute(rName);
1059 FD_DG(
"HioEnvironment(" <<
this <<
")::YEvents()");
1061 EventSet::Iterator it;
1062 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1063 if(IsY(*it)) res.
Insert(*it);
1070 FD_DG(
"HioEnvironment(" <<
this <<
")::UEvents()");
1072 EventSet::Iterator it;
1073 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1074 if(IsU(*it)) res.
Insert(*it);
1083 FD_DG(
"HioEnvironment(" <<
this <<
")::InsYeEvent(" << index <<
")");
1087 BASE::InsEvent(index,attr);
1091 TEMP Idx THIS::InsYeEvent(
const std::string& rName) {
1092 FD_DG(
"HioEnvironment(" <<
this <<
")::InsYeEvent(" << rName <<
")");
1096 return BASE::InsEvent(rName,attr);
1101 FD_DG(
"HioEnvironment(" <<
this <<
")::InsUeEvent(" << index <<
")");
1105 BASE::InsEvent(index,attr);
1109 TEMP Idx THIS::InsUeEvent(
const std::string& rName) {
1110 FD_DG(
"HioEnvironment(" <<
this <<
")::InsUeEvent(" << rName <<
")");
1114 return BASE::InsEvent(rName,attr);
1119 FD_DG(
"HioEnvironment(" <<
this <<
")::SetYe(" << index <<
")");
1120 EventAttr attr=BASE::EventAttribute(index);
1123 BASE::pAlphabet->Attribute(index,attr);
1127 TEMP void THIS::SetYe(
const std::string& rName) {
1128 FD_DG(
"HioEnvironment(" <<
this <<
")::SetYe(" << rName <<
")");
1129 Idx index = BASE::EventIndex(rName);
1135 FD_DG(
"HioEnvironment(" <<
this <<
")::SetYe(rEvents)");
1136 EventSet::Iterator it;
1137 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1144 FD_DG(
"HioEnvironment(" <<
this <<
")::SetUe(" << index <<
")");
1145 EventAttr attr=BASE::EventAttribute(index);
1148 BASE::pAlphabet->Attribute(index,attr);
1152 TEMP void THIS::SetUe(
const std::string& rName) {
1153 FD_DG(
"HioEnvironment(" <<
this <<
")::SetUe(" << rName <<
")");
1154 Idx index = BASE::EventIndex(rName);
1160 FD_DG(
"HioEnvironment(" <<
this <<
")::SetUe(rEvents)");
1161 EventSet::Iterator it;
1162 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1169 EventAttr attr=BASE::EventAttribute(index);
1170 return (attr.IsY() && attr.IsE());
1174 TEMP bool THIS::IsYe(
const std::string& rName)
const {
1175 EventAttr attr=BASE::EventAttribute(rName);
1176 return (attr.IsY() && attr.IsE());
1181 EventAttr attr=BASE::EventAttribute(index);
1182 return (attr.IsU() && attr.IsE());
1186 TEMP bool THIS::IsUe(
const std::string& rName)
const {
1187 EventAttr attr=BASE::EventAttribute(rName);
1188 return (attr.IsU() && attr.IsE());
1193 FD_DG(
"HioEnvironment(" <<
this <<
")::YeEvents()");
1195 EventSet::Iterator it;
1196 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1197 if(IsYe(*it)) res.
Insert(*it);
1204 FD_DG(
"HioEnvironment(" <<
this <<
")::UeEvents()");
1206 EventSet::Iterator it;
1207 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1208 if(IsUe(*it)) res.
Insert(*it);
1217 FD_DG(
"HioEnvironment(" <<
this <<
")::InsYlEvent(" << index <<
")");
1221 BASE::InsEvent(index,attr);
1225 TEMP Idx THIS::InsYlEvent(
const std::string& rName) {
1226 FD_DG(
"HioEnvironment(" <<
this <<
")::InsYlEvent(" << rName <<
")");
1230 return BASE::InsEvent(rName,attr);
1235 FD_DG(
"HioEnvironment(" <<
this <<
")::InsUlEvent(" << index <<
")");
1239 BASE::InsEvent(index,attr);
1243 TEMP Idx THIS::InsUlEvent(
const std::string& rName) {
1244 FD_DG(
"HioEnvironment(" <<
this <<
")::InsUlEvent(" << rName <<
")");
1248 return BASE::InsEvent(rName,attr);
1253 FD_DG(
"HioEnvironment(" <<
this <<
")::SetYl(" << index <<
")");
1254 EventAttr attr=BASE::EventAttribute(index);
1257 BASE::pAlphabet->Attribute(index,attr);
1261 TEMP void THIS::SetYl(
const std::string& rName) {
1262 FD_DG(
"HioEnvironment(" <<
this <<
")::SetYl(" << rName <<
")");
1263 Idx index = BASE::EventIndex(rName);
1269 FD_DG(
"HioEnvironment(" <<
this <<
")::SetYl(rEvents)");
1270 EventSet::Iterator it;
1271 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1278 FD_DG(
"HioEnvironment(" <<
this <<
")::SetUl(" << index <<
")");
1279 EventAttr attr=BASE::EventAttribute(index);
1282 BASE::pAlphabet->Attribute(index,attr);
1286 TEMP void THIS::SetUl(
const std::string& rName) {
1287 FD_DG(
"HioEnvironment(" <<
this <<
")::SetUl(" << rName <<
")");
1288 Idx index = BASE::EventIndex(rName);
1294 FD_DG(
"HioEnvironment(" <<
this <<
")::SetUl(rEvents)");
1295 EventSet::Iterator it;
1296 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1303 EventAttr attr=BASE::EventAttribute(index);
1304 return (attr.IsY() && attr.IsL());
1308 TEMP bool THIS::IsYl(
const std::string& rName)
const {
1309 EventAttr attr=BASE::EventAttribute(rName);
1310 return (attr.IsY() && attr.IsL());
1315 EventAttr attr=BASE::EventAttribute(index);
1316 return (attr.IsU() && attr.IsL());
1320 TEMP bool THIS::IsUl(
const std::string& rName)
const {
1321 EventAttr attr=BASE::EventAttribute(rName);
1322 return (attr.IsU() && attr.IsL());
1327 FD_DG(
"HioEnvironment(" <<
this <<
")::YlEvents()");
1329 EventSet::Iterator it;
1330 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1331 if(IsYl(*it)) res.
Insert(*it);
1338 FD_DG(
"HioEnvironment(" <<
this <<
")::UlEvents()");
1340 EventSet::Iterator it;
1341 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1342 if(IsUl(*it)) res.
Insert(*it);
1351 EventAttr attr=BASE::EventAttribute(index);
1356 TEMP bool THIS::IsE(
const std::string& rName)
const {
1357 EventAttr attr=BASE::EventAttribute(rName);
1363 EventAttr attr=BASE::EventAttribute(index);
1368 TEMP bool THIS::IsL(
const std::string& rName)
const {
1369 EventAttr attr=BASE::EventAttribute(rName);
1375 FD_DG(
"HioEnvironment(" <<
this <<
")::EEvents()");
1377 EventSet::Iterator it;
1378 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1379 if(IsE(*it)) res.
Insert(*it);
1386 FD_DG(
"HioEnvironment(" <<
this <<
")::EEvents()");
1388 EventSet::Iterator it;
1389 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1390 if(IsL(*it)) res.
Insert(*it);
1403 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQYe(" << index <<
")");
1404 StateAttr attr=BASE::StateAttribute(index);
1413 BASE::pStates->Attribute(index,attr);
1417 TEMP void THIS::SetQYe(
const std::string& rName) {
1418 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQYe(" << rName <<
")");
1419 Idx index = BASE::StateIndex(rName);
1425 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQYe(rStates)");
1426 StateSet::Iterator sit;
1427 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1434 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQYe(" << index <<
")");
1435 StateAttr attr=BASE::StateAttribute(index);
1438 BASE::pStates->Attribute(index,attr);
1442 TEMP void THIS::ClrQYe(
const std::string& rName) {
1443 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQYe(" << rName <<
")");
1444 Idx index = BASE::StateIndex(rName);
1450 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQYe(rStates)");
1451 StateSet::Iterator sit;
1452 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1459 StateAttr attr=BASE::StateAttribute(index);
1460 return attr.IsQY() && attr.IsQE() && attr.IsQL();
1464 TEMP bool THIS::IsQYe(
const std::string& rName)
const {
1465 Idx index = BASE::StateIndex(rName);
1466 return IsQYe(index);
1471 FD_DG(
"HioEnvironment(" <<
this <<
")::QYeStates()");
1473 StateSet::Iterator sit;
1474 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1475 if(IsQYe(*sit)) res.
Insert(*sit);
1483 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQUe(" << index <<
")");
1484 StateAttr attr=BASE::StateAttribute(index);
1493 BASE::pStates->Attribute(index,attr);
1497 TEMP void THIS::SetQUe(
const std::string& rName) {
1498 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQUe(" << rName <<
")");
1499 Idx index = BASE::StateIndex(rName);
1505 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQUe(rStates)");
1506 StateSet::Iterator sit;
1507 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1514 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQUe(" << index <<
")");
1515 StateAttr attr=BASE::StateAttribute(index);
1518 BASE::pStates->Attribute(index,attr);
1522 TEMP void THIS::ClrQUe(
const std::string& rName) {
1523 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQUe(" << rName <<
")");
1524 Idx index = BASE::StateIndex(rName);
1530 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQUe(rStates)");
1531 StateSet::Iterator sit;
1532 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1539 StateAttr attr=BASE::StateAttribute(index);
1540 return attr.IsQU() && attr.IsQE();
1544 TEMP bool THIS::IsQUe(
const std::string& rName)
const {
1545 Idx index = BASE::StateIndex(rName);
1546 return IsQUe(index);
1551 FD_DG(
"HioEnvironment(" <<
this <<
")::QUeStates()");
1553 StateSet::Iterator sit;
1554 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1555 if(IsQUe(*sit)) res.
Insert(*sit);
1565 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQUl(" << index <<
")");
1566 StateAttr attr=BASE::StateAttribute(index);
1575 BASE::pStates->Attribute(index,attr);
1579 TEMP void THIS::SetQUl(
const std::string& rName) {
1580 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQUl(" << rName <<
")");
1581 Idx index = BASE::StateIndex(rName);
1587 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQUl(rStates)");
1588 StateSet::Iterator sit;
1589 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1596 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQUl(" << index <<
")");
1597 StateAttr attr=BASE::StateAttribute(index);
1600 BASE::pStates->Attribute(index,attr);
1604 TEMP void THIS::ClrQUl(
const std::string& rName) {
1605 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQUl(" << rName <<
")");
1606 Idx index = BASE::StateIndex(rName);
1612 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQUl(rStates)");
1613 StateSet::Iterator sit;
1614 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1621 StateAttr attr=BASE::StateAttribute(index);
1622 return attr.IsQU() && attr.IsQL();
1626 TEMP bool THIS::IsQUl(
const std::string& rName)
const {
1627 Idx index = BASE::StateIndex(rName);
1628 return IsQUl(index);
1633 FD_DG(
"HioEnvironment(" <<
this <<
")::QUlStates()");
1635 StateSet::Iterator sit;
1636 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1637 if(IsQUl(*sit)) res.
Insert(*sit);
1646 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQYlUe(" << index <<
")");
1647 StateAttr attr=BASE::StateAttribute(index);
1656 BASE::pStates->Attribute(index,attr);
1660 TEMP void THIS::SetQYlUe(
const std::string& rName) {
1661 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQYlUe(" << rName <<
")");
1662 Idx index = BASE::StateIndex(rName);
1668 FD_DG(
"HioEnvironment(" <<
this <<
")::SetQYlUe(rStates)");
1669 StateSet::Iterator sit;
1670 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1677 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQYlUe(" << index <<
")");
1678 StateAttr attr=BASE::StateAttribute(index);
1680 BASE::pStates->Attribute(index,attr);
1684 TEMP void THIS::ClrQYlUe(
const std::string& rName) {
1685 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQYlUe(" << rName <<
")");
1686 Idx index = BASE::StateIndex(rName);
1692 FD_DG(
"HioEnvironment(" <<
this <<
")::ClrQYlUe(rStates)");
1693 StateSet::Iterator sit;
1694 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1701 StateAttr attr=BASE::StateAttribute(index);
1702 return attr.IsQYlUe();
1706 TEMP bool THIS::IsQYlUe(
const std::string& rName)
const {
1707 Idx index = BASE::StateIndex(rName);
1708 return IsQYlUe(index);
1713 FD_DG(
"HioEnvironment(" <<
this <<
")::QYlUeStates()");
1715 StateSet::Iterator sit;
1716 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1717 if(IsQYlUe(*sit)) res.
Insert(*sit);
1724 FD_DG(
"HioPlant(" <<
this <<
")::SetErr(" << index <<
")");
1725 StateAttr attr=BASE::StateAttribute(index);
1727 BASE::pStates->Attribute(index,attr);
1731 TEMP void THIS::SetErr(
const std::string& rName) {
1732 FD_DG(
"HioPlant(" <<
this <<
")::SetErr(" << rName <<
")");
1733 Idx index = BASE::StateIndex(rName);
1739 FD_DG(
"HioPlant(" <<
this <<
")::SetErr(rStates)");
1740 StateSet::Iterator sit;
1741 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1748 FD_DG(
"HioPlant(" <<
this <<
")::ClrErr(" << index <<
")");
1749 StateAttr attr=BASE::StateAttribute(index);
1751 BASE::pStates->Attribute(index,attr);
1755 TEMP void THIS::ClrErr(
const std::string& rName) {
1756 FD_DG(
"HioPlant(" <<
this <<
")::ClrErr(" << rName <<
")");
1757 Idx index = BASE::StateIndex(rName);
1763 FD_DG(
"HioPlant(" <<
this <<
")::ClrErr(rStates)");
1764 StateSet::Iterator sit;
1765 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1772 StateAttr attr=BASE::StateAttribute(index);
1773 return attr.IsErr();
1777 TEMP bool THIS::IsErr(
const std::string& rName)
const {
1778 Idx index = BASE::StateIndex(rName);
1779 return IsErr(index);
1784 FD_DG(
"HioPlant(" <<
this <<
")::ErrStates()");
1786 StateSet::Iterator sit;
1787 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1788 if(IsErr(*sit)) res.
Insert(*sit);
1842 std::string& rReportStr);
1898 #define HIOENVIRONMENT_H