11 #ifndef FAUDES_HIO_PLANT_H
12 #define FAUDES_HIO_PLANT_H
46 template <
class GlobalAttr,
class StateAttr,
class EventAttr,
class TransAttr>
201 void SetYp(
const std::string& rName);
225 void SetUp(
const std::string& rName);
255 bool IsYp(
const std::string& rName)
const;
277 bool IsUp(
const std::string& rName)
const;
351 void SetYe(
const std::string& rName);
375 void SetUe(
const std::string& rName);
405 bool IsYe(
const std::string& rName)
const;
427 bool IsUe(
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 IsP(
Idx index)
const;
527 bool IsP(
const std::string& rName)
const;
546 bool IsE(
Idx index)
const;
557 bool IsE(
const std::string& rName)
const;
585 void SetQYpYe(
const std::string& rName);
608 void ClrQYpYe(
const std::string& rName);
637 bool IsQYpYe(
const std::string& rName)
const;
661 void SetQUp(
const std::string& rName);
684 void ClrQUp(
const std::string& rName);
713 bool IsQUp(
const std::string& rName)
const;
737 void SetQUe(
const std::string& rName);
760 void ClrQUe(
const std::string& rName);
789 bool IsQUe(
const std::string& rName)
const;
813 void SetErr(
const std::string& rName);
836 void ClrErr(
const std::string& rName);
865 bool IsErr(
const std::string& rName)
const;
893 #define THIS THioPlant<GlobalAttr, StateAttr, EventAttr, TransAttr>
894 #define BASE TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
895 #define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
900 FD_DG(
"HioPlant(" <<
this <<
")::HioPlant()");
905 FD_DG(
"HioPlant(" <<
this <<
")::HioPlant(rOtherGen)");
910 FD_DG(
"HioPlant(" <<
this <<
")::HioPlant(rOtherGen)");
920 ) :
BASE(rOtherGen) {
921 FD_DG(
"HioPlant(" <<
this <<
")::HioPlant(rOtherGen)");
929 TEMP THIS::THioPlant(
const std::string& rFileName) :
BASE(rFileName) {
930 FD_DG(
"HioPlant(" <<
this <<
")::HioPlant(rFilename) : done");
938 res->EventSymbolTablep(BASE::mpEventSymbolTable);
939 res->mStateNamesEnabled=BASE::mStateNamesEnabled;
945 return new THIS(*
this);
951 THIS res= BASE::NewAGen();
960 EventAttr attr=BASE::EventAttribute(index);
965 TEMP bool THIS::IsY(
const std::string& rName)
const {
966 EventAttr attr=BASE::EventAttribute(rName);
972 EventAttr attr=BASE::EventAttribute(index);
977 TEMP bool THIS::IsU(
const std::string& rName)
const {
978 EventAttr attr=BASE::EventAttribute(rName);
984 FD_DG(
"HioPlant(" <<
this <<
")::YEvents()");
986 EventSet::Iterator it;
987 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
988 if(IsY(*it)) res.
Insert(*it);
995 FD_DG(
"HioPlant(" <<
this <<
")::UEvents()");
997 EventSet::Iterator it;
998 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
999 if(IsU(*it)) res.
Insert(*it);
1008 FD_DG(
"HioPlant(" <<
this <<
")::InsYpEvent(" << index <<
")");
1012 BASE::InsEvent(index,attr);
1016 TEMP Idx THIS::InsYpEvent(
const std::string& rName) {
1017 FD_DG(
"HioPlant(" <<
this <<
")::InsYpEvent(" << rName <<
")");
1021 return BASE::InsEvent(rName,attr);
1026 FD_DG(
"HioPlant(" <<
this <<
")::InsUpEvent(" << index <<
")");
1030 BASE::InsEvent(index,attr);
1034 TEMP Idx THIS::InsUpEvent(
const std::string& rName) {
1035 FD_DG(
"HioPlant(" <<
this <<
")::InsUpEvent(" << rName <<
")");
1039 return BASE::InsEvent(rName,attr);
1044 FD_DG(
"HioPlant(" <<
this <<
")::SetYp(" << index <<
")");
1045 EventAttr attr=BASE::EventAttribute(index);
1048 BASE::pAlphabet->Attribute(index,attr);
1052 TEMP void THIS::SetYp(
const std::string& rName) {
1053 FD_DG(
"HioPlant(" <<
this <<
")::SetYp(" << rName <<
")");
1054 Idx index = BASE::EventIndex(rName);
1060 FD_DG(
"HioPlant(" <<
this <<
")::SetYp(rEvents)");
1061 EventSet::Iterator it;
1062 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1069 FD_DG(
"HioPlant(" <<
this <<
")::SetUp(" << index <<
")");
1070 EventAttr attr=BASE::EventAttribute(index);
1073 BASE::pAlphabet->Attribute(index,attr);
1077 TEMP void THIS::SetUp(
const std::string& rName) {
1078 FD_DG(
"HioPlant(" <<
this <<
")::SetUp(" << rName <<
")");
1079 Idx index = BASE::EventIndex(rName);
1085 FD_DG(
"HioPlant(" <<
this <<
")::SetUp(rEvents)");
1086 EventSet::Iterator it;
1087 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1094 EventAttr attr=BASE::EventAttribute(index);
1095 return (attr.IsY() && attr.IsP());
1099 TEMP bool THIS::IsYp(
const std::string& rName)
const {
1100 EventAttr attr=BASE::EventAttribute(rName);
1101 return (attr.IsY() && attr.IsP());
1106 EventAttr attr=BASE::EventAttribute(index);
1107 return (attr.IsU() && attr.IsP());
1111 TEMP bool THIS::IsUp(
const std::string& rName)
const {
1112 EventAttr attr=BASE::EventAttribute(rName);
1113 return (attr.IsU() && attr.IsP());
1118 FD_DG(
"HioPlant(" <<
this <<
")::YpEvents()");
1120 EventSet::Iterator it;
1121 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1122 if(IsYp(*it)) res.
Insert(*it);
1129 FD_DG(
"HioPlant(" <<
this <<
")::UpEvents()");
1131 EventSet::Iterator it;
1132 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1133 if(IsUp(*it)) res.
Insert(*it);
1142 FD_DG(
"HioPlant(" <<
this <<
")::InsYeEvent(" << index <<
")");
1146 BASE::InsEvent(index,attr);
1150 TEMP Idx THIS::InsYeEvent(
const std::string& rName) {
1151 FD_DG(
"HioPlant(" <<
this <<
")::InsYeEvent(" << rName <<
")");
1155 return BASE::InsEvent(rName,attr);
1160 FD_DG(
"HioPlant(" <<
this <<
")::InsUeEvent(" << index <<
")");
1164 BASE::InsEvent(index,attr);
1168 TEMP Idx THIS::InsUeEvent(
const std::string& rName) {
1169 FD_DG(
"HioPlant(" <<
this <<
")::InsUeEvent(" << rName <<
")");
1173 return BASE::InsEvent(rName,attr);
1178 FD_DG(
"HioPlant(" <<
this <<
")::SetYe(" << index <<
")");
1179 EventAttr attr=BASE::EventAttribute(index);
1182 BASE::pAlphabet->Attribute(index,attr);
1186 TEMP void THIS::SetYe(
const std::string& rName) {
1187 FD_DG(
"HioPlant(" <<
this <<
")::SetYe(" << rName <<
")");
1188 Idx index = BASE::EventIndex(rName);
1194 FD_DG(
"HioPlant(" <<
this <<
")::SetYe(rEvents)");
1195 EventSet::Iterator it;
1196 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1203 FD_DG(
"HioPlant(" <<
this <<
")::SetUe(" << index <<
")");
1204 EventAttr attr=BASE::EventAttribute(index);
1207 BASE::pAlphabet->Attribute(index,attr);
1211 TEMP void THIS::SetUe(
const std::string& rName) {
1212 FD_DG(
"HioPlant(" <<
this <<
")::SetUe(" << rName <<
")");
1213 Idx index = BASE::EventIndex(rName);
1219 FD_DG(
"HioPlant(" <<
this <<
")::SetUe(rEvents)");
1220 EventSet::Iterator it;
1221 for(it=rEvents.
Begin(); it!=rEvents.
End(); it++) {
1228 EventAttr attr=BASE::EventAttribute(index);
1229 return (attr.IsY() && attr.IsE());
1233 TEMP bool THIS::IsYe(
const std::string& rName)
const {
1234 EventAttr attr=BASE::EventAttribute(rName);
1235 return (attr.IsY() && attr.IsE());
1240 EventAttr attr=BASE::EventAttribute(index);
1241 return (attr.IsU() && attr.IsE());
1245 TEMP bool THIS::IsUe(
const std::string& rName)
const {
1246 EventAttr attr=BASE::EventAttribute(rName);
1247 return (attr.IsU() && attr.IsE());
1252 FD_DG(
"HioPlant(" <<
this <<
")::YeEvents()");
1254 EventSet::Iterator it;
1255 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1256 if(IsYe(*it)) res.
Insert(*it);
1263 FD_DG(
"HioPlant(" <<
this <<
")::UeEvents()");
1265 EventSet::Iterator it;
1266 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1267 if(IsUe(*it)) res.
Insert(*it);
1276 EventAttr attr=BASE::EventAttribute(index);
1281 TEMP bool THIS::IsP(
const std::string& rName)
const {
1282 EventAttr attr=BASE::EventAttribute(rName);
1288 EventAttr attr=BASE::EventAttribute(index);
1293 TEMP bool THIS::IsE(
const std::string& rName)
const {
1294 EventAttr attr=BASE::EventAttribute(rName);
1300 FD_DG(
"HioPlant(" <<
this <<
")::PEvents()");
1302 EventSet::Iterator it;
1303 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1304 if(IsP(*it)) res.
Insert(*it);
1311 FD_DG(
"HioPlant(" <<
this <<
")::EEvents()");
1313 EventSet::Iterator it;
1314 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1315 if(IsE(*it)) res.
Insert(*it);
1328 FD_DG(
"HioPlant(" <<
this <<
")::SetQYpYe(" << index <<
")");
1329 StateAttr attr=BASE::StateAttribute(index);
1338 BASE::pStates->Attribute(index,attr);
1342 TEMP void THIS::SetQYpYe(
const std::string& rName) {
1343 FD_DG(
"HioPlant(" <<
this <<
")::SetQYpYe(" << rName <<
")");
1344 Idx index = BASE::StateIndex(rName);
1350 FD_DG(
"HioPlant(" <<
this <<
")::SetQYpYe(rStates)");
1351 StateSet::Iterator sit;
1352 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1359 FD_DG(
"HioPlant(" <<
this <<
")::ClrQYpYe(" << index <<
")");
1360 StateAttr attr=BASE::StateAttribute(index);
1364 BASE::pStates->Attribute(index,attr);
1368 TEMP void THIS::ClrQYpYe(
const std::string& rName) {
1369 FD_DG(
"HioPlant(" <<
this <<
")::ClrQYpYe(" << rName <<
")");
1370 Idx index = BASE::StateIndex(rName);
1376 FD_DG(
"HioPlant(" <<
this <<
")::ClrQYpYe(rStates)");
1377 StateSet::Iterator sit;
1378 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1385 StateAttr attr=BASE::StateAttribute(index);
1386 return attr.IsQY() && attr.IsQP() && attr.IsQE();
1390 TEMP bool THIS::IsQYpYe(
const std::string& rName)
const {
1391 Idx index = BASE::StateIndex(rName);
1392 return IsQYpYe(index);
1397 FD_DG(
"HioPlant(" <<
this <<
")::QYpYeStates()");
1399 StateSet::Iterator sit;
1400 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1401 if(IsQYpYe(*sit)) res.
Insert(*sit);
1409 FD_DG(
"HioPlant(" <<
this <<
")::SetQUp(" << index <<
")");
1410 StateAttr attr=BASE::StateAttribute(index);
1419 BASE::pStates->Attribute(index,attr);
1423 TEMP void THIS::SetQUp(
const std::string& rName) {
1424 FD_DG(
"HioPlant(" <<
this <<
")::SetQUp(" << rName <<
")");
1425 Idx index = BASE::StateIndex(rName);
1431 FD_DG(
"HioPlant(" <<
this <<
")::SetQUp(rStates)");
1432 StateSet::Iterator sit;
1433 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1440 FD_DG(
"HioPlant(" <<
this <<
")::ClrQUp(" << index <<
")");
1441 StateAttr attr=BASE::StateAttribute(index);
1444 BASE::pStates->Attribute(index,attr);
1448 TEMP void THIS::ClrQUp(
const std::string& rName) {
1449 FD_DG(
"HioPlant(" <<
this <<
")::ClrQUp(" << rName <<
")");
1450 Idx index = BASE::StateIndex(rName);
1456 FD_DG(
"HioPlant(" <<
this <<
")::ClrQUp(rStates)");
1457 StateSet::Iterator sit;
1458 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1465 StateAttr attr=BASE::StateAttribute(index);
1466 return attr.IsQU() && attr.IsQP();
1470 TEMP bool THIS::IsQUp(
const std::string& rName)
const {
1471 Idx index = BASE::StateIndex(rName);
1472 return IsQUp(index);
1477 FD_DG(
"HioPlant(" <<
this <<
")::QUpStates()");
1479 StateSet::Iterator sit;
1480 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1481 if(IsQUp(*sit)) res.
Insert(*sit);
1491 FD_DG(
"HioPlant(" <<
this <<
")::SetQUe(" << index <<
")");
1492 StateAttr attr=BASE::StateAttribute(index);
1501 BASE::pStates->Attribute(index,attr);
1505 TEMP void THIS::SetQUe(
const std::string& rName) {
1506 FD_DG(
"HioPlant(" <<
this <<
")::SetQUe(" << rName <<
")");
1507 Idx index = BASE::StateIndex(rName);
1513 FD_DG(
"HioPlant(" <<
this <<
")::SetQUe(rStates)");
1514 StateSet::Iterator sit;
1515 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1522 FD_DG(
"HioPlant(" <<
this <<
")::ClrQUe(" << index <<
")");
1523 StateAttr attr=BASE::StateAttribute(index);
1526 BASE::pStates->Attribute(index,attr);
1530 TEMP void THIS::ClrQUe(
const std::string& rName) {
1531 FD_DG(
"HioPlant(" <<
this <<
")::ClrQUe(" << rName <<
")");
1532 Idx index = BASE::StateIndex(rName);
1538 FD_DG(
"HioPlant(" <<
this <<
")::ClrQUe(rStates)");
1539 StateSet::Iterator sit;
1540 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1547 StateAttr attr=BASE::StateAttribute(index);
1548 return attr.IsQU() && attr.IsQE();
1552 TEMP bool THIS::IsQUe(
const std::string& rName)
const {
1553 Idx index = BASE::StateIndex(rName);
1554 return IsQUe(index);
1559 FD_DG(
"HioPlant(" <<
this <<
")::QUeStates()");
1561 StateSet::Iterator sit;
1562 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1563 if(IsQUe(*sit)) res.
Insert(*sit);
1570 FD_DG(
"HioPlant(" <<
this <<
")::SetErr(" << index <<
")");
1571 StateAttr attr=BASE::StateAttribute(index);
1573 BASE::pStates->Attribute(index,attr);
1577 TEMP void THIS::SetErr(
const std::string& rName) {
1578 FD_DG(
"HioPlant(" <<
this <<
")::SetErr(" << rName <<
")");
1579 Idx index = BASE::StateIndex(rName);
1585 FD_DG(
"HioPlant(" <<
this <<
")::SetErr(rStates)");
1586 StateSet::Iterator sit;
1587 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1594 FD_DG(
"HioPlant(" <<
this <<
")::ClrErr(" << index <<
")");
1595 StateAttr attr=BASE::StateAttribute(index);
1597 BASE::pStates->Attribute(index,attr);
1601 TEMP void THIS::ClrErr(
const std::string& rName) {
1602 FD_DG(
"HioPlant(" <<
this <<
")::ClrErr(" << rName <<
")");
1603 Idx index = BASE::StateIndex(rName);
1609 FD_DG(
"HioPlant(" <<
this <<
")::ClrErr(rStates)");
1610 StateSet::Iterator sit;
1611 for(sit=rStates.
Begin(); sit!=rStates.
End(); sit++) {
1618 StateAttr attr=BASE::StateAttribute(index);
1619 return attr.IsErr();
1623 TEMP bool THIS::IsErr(
const std::string& rName)
const {
1624 Idx index = BASE::StateIndex(rName);
1625 return IsErr(index);
1630 FD_DG(
"HioPlant(" <<
this <<
")::ErrStates()");
1632 StateSet::Iterator sit;
1633 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1634 if(IsErr(*sit)) res.
Insert(*sit);
1685 std::string& rReportStr);
1752 std::string& rReportStr);