hio_plant.h
Go to the documentation of this file.
1/** @file hio_plant.h Generator with I/O-plant attributes */
2
3/* Hierarchical IO Systems Plug-In for FAU Discrete Event Systems Library (libfaudes)
4
5 Copyright (C) 2006 Sebastian Perk
6 Copyright (C) 2006 Klaus Schmidt
7 Copyright (C) 2006, 2024 Thomas Moor
8
9*/
10
11#ifndef FAUDES_HIO_PLANT_H
12#define FAUDES_HIO_PLANT_H
13
14#include "corefaudes.h"
15#include "hio_attributes.h"
16
17namespace faudes {
18
19
20/**
21 * Generator with I/O-plant attributes. The HioPlant is a variant of the
22 * Generator to add an interface for events and states with I/O-plant attributes,
23 * built from HioEvent- and HioStateFlags
24 * - event attributes: YP = Y && P
25 * UP = U && P
26 * YE = Y && E
27 * UE = U && E
28 * - state attributes: QYpYe = QY && QP && QE
29 * QUp = QU && QP
30 * QUe = QU && QE
31 *
32 * Technically, the construct is based on the specialized attribute classes
33 * faudes::HioEventFlags and faudes::HioStateFlags that provide attributes with
34 * semantics for hierarchical I/O properties. The THioPlant expects attribute template
35 * parameters with the minimum interface defined in HioEventFlags and HioStateFlags.
36 * Thus, you can add further semantics by deriving a class HioEventFlagsAndMore from
37 * HioEventFlags (same for HioStateFlags) and use this as event attribute parameter for
38 * THioPlant. To model a plain finite state machine plus I/O-plant properties, use THioPlant
39 * with HioEventFlags and HioStateFlags for the event and state attribute parameters
40 * and AttributeVoid for the other parameters.
41 * For convenience, this has been typedefed as HioPlant.
42 *
43 * @ingroup hiosysplugin
44 */
45
46template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
47class FAUDES_TAPI THioPlant : public TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr> {
48 public:
49 /**
50 * Creates an empty HioPlant object
51 */
52 THioPlant(void);
53
54 /**
55 * HioPlant from a std Generator. Copy constructor
56 *
57 * @param rOtherGen
58 */
59 THioPlant(const Generator& rOtherGen);
60
61 /**
62 * HioPlant from a std Generator and event sets. Copy constructor
63 *
64 * @param rOtherGen
65 * Generator
66 * @param rYp
67 * alphabet Yp
68 * @param rUp
69 * alphabet Up
70 * @param rYe
71 * alphabet Ye
72 * @param rUe
73 * alphabet Ue
74 */
76 const Generator& rOtherGen,
77 const EventSet& rYp,
78 const EventSet& rUp,
79 const EventSet& rYe,
80 const EventSet& rUe
81 );
82
83 /**
84 * HioPlant from a HioPlant. Copy constructor
85 *
86 * @param rOtherGen
87 */
88 THioPlant(const THioPlant& rOtherGen);
89
90 /**
91 * construct a HioPlant from file
92 *
93 * @param rFileName
94 * Filename
95 *
96 * @exception Exception
97 * If opening/reading fails an Exception object is thrown (id 1, 50, 51)
98 */
99 THioPlant(const std::string& rFileName);
100
101 /**
102 * Construct on heap
103 *
104 * @return
105 * new Generator
106 */
107 virtual THioPlant* New(void) const;
108
109 /**
110 * Construct copy on heap
111 *
112 * @return
113 * new Generator
114 */
115 virtual THioPlant* Copy(void) const;
116
117 /**
118 * Create empty HioPlant with same symboltable as this
119 *
120 * @return
121 * New Generator
122 */
124
125 /**
126 * Assignment operator (uses copy )
127 *
128 * @param rOtherGen
129 * Other generator
130 */
131 virtual THioPlant& operator= (const THioPlant& rOtherGen) {this->Assign(rOtherGen); return *this;};
132
133//**************** I/O plant event attributes ********************/
134
135 /**
136 * Add an existing Yp-event to generator.
137 * An entry in the global event table will be made.
138 *
139 * @param index
140 * Event index
141 */
142 void InsYpEvent(Idx index);
143
144 /**
145 * Add new named Yp-event to generator.
146 * An entry in the global event table will be made if event is new.
147 *
148 * @param rName
149 * Name of the event to add
150 *
151 * @return
152 * New global unique index
153 */
154 Idx InsYpEvent(const std::string& rName);
155
156 /**
157 * Add an existing Up-event to generator.
158 * An entry in the global event table will be made.
159 *
160 * @param index
161 * Event index
162 */
163 void InsUpEvent(Idx index);
164
165 /**
166 * Add new named Up-event to generator.
167 * An entry in the global event table will be made if event is new.
168 *
169 * @param rName
170 * Name of the event to add
171 *
172 * @return
173 * New global unique index
174 */
175 Idx InsUpEvent(const std::string& rName);
176
177 /**
178 * Mark event as Yp-event (by index)
179 *
180 * @param index
181 * Event index
182 */
183 void SetYp(Idx index);
184
185 /**
186 * Mark event as Yp-event(by name)
187 *
188 * @param rName
189 * Event name
190 */
191 void SetYp(const std::string& rName);
192
193 /**
194 * Mark set of events as Yp-events
195 *
196 * @param rEvents
197 * EventSet
198 */
199 void SetYp(const EventSet& rEvents);
200
201 /**
202 * Mark event Up-event(by index)
203 *
204 * @param index
205 * Event index
206 */
207 void SetUp(Idx index);
208
209 /**
210 * Mark event Up-event(by name)
211 *
212 * @param rName
213 * Event name
214 */
215 void SetUp(const std::string& rName);
216
217 /**
218 * Mark set of events as Up-events
219 *
220 * @param rEvents
221 * EventSet
222 */
223 void SetUp(const EventSet& rEvents);
224
225 /**
226 * Is event Yp-event(by index)
227 *
228 * @param index
229 * Event index
230 *
231 * @return
232 * True / false
233 */
234 bool IsYp(Idx index) const;
235
236 /**
237 * Is event Yp-event(by name)
238 *
239 * @param rName
240 * Event name
241 *
242 * @return
243 * True / false
244 */
245 bool IsYp(const std::string& rName) const;
246
247 /**
248 * Is event Up-event(by index)
249 *
250 * @param index
251 * Event index
252 *
253 * @return
254 * True / false
255 */
256 bool IsUp(Idx index) const;
257
258 /**
259 * Is event Up-event(by name)
260 *
261 * @param rName
262 * Event name
263 *
264 * @return
265 * True / false
266 */
267 bool IsUp(const std::string& rName) const;
268
269 /**
270 * Get EventSet with Yp-events
271 *
272 * @return
273 * EventSet of Yp-events
274 */
275 EventSet YpEvents(void) const;
276
277 /**
278 * Get EventSet with Up-events
279 *
280 * @return
281 * EventSet of Up-events
282 */
283 EventSet UpEvents(void) const;
284
285 /**
286 * Add an existing Ye-event to generator.
287 * An entry in the global event table will be made.
288 *
289 * @param index
290 * Event index
291 */
292 void InsYeEvent(Idx index);
293
294 /**
295 * Add new named Ye-event to generator.
296 * An entry in the global event table will be made if event is new.
297 *
298 * @param rName
299 * Name of the event to add
300 *
301 * @return
302 * New global unique index
303 */
304 Idx InsYeEvent(const std::string& rName);
305
306 /**
307 * Add an existing Ue-event to generator.
308 * An entry in the global event table will be made.
309 *
310 * @param index
311 * Event index
312 */
313 void InsUeEvent(Idx index);
314
315 /**
316 * Add new named Ue-event to generator.
317 * An entry in the global event table will be made if event is new.
318 *
319 * @param rName
320 * Name of the event to add
321 *
322 * @return
323 * New global unique index
324 */
325 Idx InsUeEvent(const std::string& rName);
326
327 /**
328 * Mark event as Ye-event (by index)
329 *
330 * @param index
331 * Event index
332 */
333 void SetYe(Idx index);
334
335 /**
336 * Mark event as Ye-event (by name)
337 *
338 * @param rName
339 * Event name
340 */
341 void SetYe(const std::string& rName);
342
343 /**
344 * Mark set of events as Ye-events
345 *
346 * @param rEvents
347 * EventSet
348 */
349 void SetYe(const EventSet& rEvents);
350
351 /**
352 * Mark event as Ue-event (by index)
353 *
354 * @param index
355 * Event index
356 */
357 void SetUe(Idx index);
358
359 /**
360 * Mark event as Ue-event (by name)
361 *
362 * @param rName
363 * Event name
364 */
365 void SetUe(const std::string& rName);
366
367 /**
368 * Mark set of events as Ue-events
369 *
370 * @param rEvents
371 * EventSet
372 */
373 void SetUe(const EventSet& rEvents);
374
375 /**
376 * Is event Ye-event (by index)
377 *
378 * @param index
379 * Event index
380 *
381 * @return
382 * True / false
383 */
384 bool IsYe(Idx index) const;
385
386 /**
387 * Is event Ye-event (by name)
388 *
389 * @param rName
390 * Event name
391 *
392 * @return
393 * True / false
394 */
395 bool IsYe(const std::string& rName) const;
396
397 /**
398 * Is event Ue-event (by index)
399 *
400 * @param index
401 * Event index
402 *
403 * @return
404 * True / false
405 */
406 bool IsUe(Idx index) const;
407
408 /**
409 * Is event Ue-event (by name)
410 *
411 * @param rName
412 * Event name
413 *
414 * @return
415 * True / false
416 */
417 bool IsUe(const std::string& rName) const;
418
419 /**
420 * Get EventSet with Ye-events
421 *
422 * @return
423 * EventSet of Ye-events
424 */
425 EventSet YeEvents(void) const;
426
427 /**
428 * Get EventSet with Ue-events
429 *
430 * @return
431 * EventSet of Ue-events
432 */
433 EventSet UeEvents(void) const;
434
435
436//************** query elementary event attributes ****************************/
437 /**
438 * Is event Y-event? (by index)
439 *
440 * @param index
441 * Event index
442 *
443 * @return
444 * True / false
445 */
446 bool IsY(Idx index) const;
447
448 /**
449 * Is event Y-event? (by name)
450 *
451 * @param rName
452 * Event name
453 *
454 * @return
455 * True / false
456 */
457 bool IsY(const std::string& rName) const;
458
459 /**
460 * Get EventSet with Y-events
461 *
462 * @return
463 * EventSet of Y-events
464 */
465 EventSet YEvents(void) const;
466
467 /**
468 * Is event U-event? (by index)
469 *
470 * @param index
471 * Event index
472 *
473 * @return
474 * True / false
475 */
476 bool IsU(Idx index) const;
477
478 /**
479 * Is event U-event? (by name)
480 *
481 * @param rName
482 * Event name
483 *
484 * @return
485 * True / false
486 */
487 bool IsU(const std::string& rName) const;
488
489 /**
490 * Get EventSet with U-events
491 *
492 * @return
493 * EventSet of U-events
494 */
495 EventSet UEvents(void) const;
496
497 /**
498 * Is event P-event? (by index)
499 *
500 * @param index
501 * Event index
502 *
503 * @return
504 * True / false
505 */
506 bool IsP(Idx index) const;
507
508 /**
509 * Is event P-event? (by name)
510 *
511 * @param rName
512 * Event name
513 *
514 * @return
515 * True / false
516 */
517 bool IsP(const std::string& rName) const;
518
519 /**
520 * Get EventSet with P-events
521 *
522 * @return
523 * EventSet of P-events
524 */
525 EventSet PEvents(void) const;
526
527 /**
528 * Is event E-event? (by index)
529 *
530 * @param index
531 * Event index
532 *
533 * @return
534 * True / false
535 */
536 bool IsE(Idx index) const;
537
538 /**
539 * Is event E-event? (by name)
540 *
541 * @param rName
542 * Event name
543 *
544 * @return
545 * True / false
546 */
547 bool IsE(const std::string& rName) const;
548
549 /**
550 * Get EventSet with E-events
551 *
552 * @return
553 * EventSet of E-events
554 */
555 EventSet EEvents(void) const;
556/******************************************************/
557
558
559/*************** I/O plant state attributes **********************/
560
561 /**
562 * Mark state as QYpYe-state (by index)
563 *
564 * @param index
565 * State index
566 */
567 void SetQYpYe(Idx index);
568
569 /**
570 * Mark state as QYpYe-state (by name)
571 *
572 * @param rName
573 * State name
574 */
575 void SetQYpYe(const std::string& rName);
576
577 /**
578 * Mark set of states as QYpYe-states
579 *
580 * @param rStates
581 * StateSet
582 */
583 void SetQYpYe(const StateSet& rStates);
584
585 /** Mark state as NOT QYpYe-state (by index)
586 *
587 * @param index
588 * State index
589 */
590 void ClrQYpYe(Idx index);
591
592 /**
593 * Mark state as NOT QYpYe-state (by name)
594 *
595 * @param rName
596 * State name
597 */
598 void ClrQYpYe(const std::string& rName);
599
600 /**
601 * Mark set of states as NOT QYpYe-states (by index)
602 *
603 * @param rStates
604 * StateSet
605 */
606 void ClrQYpYe(const StateSet& rStates);
607
608 /** Is state QYpYe-state (by index)
609 *
610 * @param index
611 * State index
612 *
613 * @return
614 * True / false
615 */
616 bool IsQYpYe(Idx index) const;
617
618 /**
619 * Is state QYpYe-state (by name)
620 *
621 * @param rName
622 * State name
623 *
624 * @return
625 * True / false
626 */
627 bool IsQYpYe(const std::string& rName) const;
628
629 /**
630 * Get StateSet with QYpYe-states
631 *
632 * @return
633 * StateSet of QYpYe-states
634 */
636
637 /**
638 * Mark state as QUp-state (by index)
639 *
640 * @param index
641 * State index
642 */
643 void SetQUp(Idx index);
644
645 /**
646 * Mark state as QUp-state (by name)
647 *
648 * @param rName
649 * State name
650 */
651 void SetQUp(const std::string& rName);
652
653 /**
654 * Mark set of states as QUp-states
655 *
656 * @param rStates
657 * StateSet
658 */
659 void SetQUp(const StateSet& rStates);
660
661 /** Mark state as NOT QUp-state (by index)
662 *
663 * @param index
664 * State index
665 */
666 void ClrQUp(Idx index);
667
668 /**
669 * Mark state as NOT QUp-state (by name)
670 *
671 * @param rName
672 * State name
673 */
674 void ClrQUp(const std::string& rName);
675
676 /**
677 * Mark set of states as NOT QUp-states (by index)
678 *
679 * @param rStates
680 * StateSet
681 */
682 void ClrQUp(const StateSet& rStates);
683
684 /** Is state QUp-state (by index)
685 *
686 * @param index
687 * State index
688 *
689 * @return
690 * True / false
691 */
692 bool IsQUp(Idx index) const;
693
694 /**
695 * Is state QUp-state (by name)
696 *
697 * @param rName
698 * State name
699 *
700 * @return
701 * True / false
702 */
703 bool IsQUp(const std::string& rName) const;
704
705 /**
706 * Get StateSet with QUp-states
707 *
708 * @return
709 * StateSet of QUp-states
710 */
711 StateSet QUpStates(void) const;
712
713 /**
714 * Mark state as QUe-state (by index)
715 *
716 * @param index
717 * State index
718 */
719 void SetQUe(Idx index);
720
721 /**
722 * Mark state as QUe-state (by name)
723 *
724 * @param rName
725 * State name
726 */
727 void SetQUe(const std::string& rName);
728
729 /**
730 * Mark set of states as QUe-states
731 *
732 * @param rStates
733 * StateSet
734 */
735 void SetQUe(const StateSet& rStates);
736
737 /** Mark state as NOT QUe-state (by index)
738 *
739 * @param index
740 * State index
741 */
742 void ClrQUe(Idx index);
743
744 /**
745 * Mark state as NOT QUe-state (by name)
746 *
747 * @param rName
748 * State name
749 */
750 void ClrQUe(const std::string& rName);
751
752 /**
753 * Mark set of states as NOT QUe-states (by index)
754 *
755 * @param rStates
756 * StateSet
757 */
758 void ClrQUe(const StateSet& rStates);
759
760 /** Is state QUe-state (by index)
761 *
762 * @param index
763 * State index
764 *
765 * @return
766 * True / false
767 */
768 bool IsQUe(Idx index) const;
769
770 /**
771 * Is state QUe-state (by name)
772 *
773 * @param rName
774 * State name
775 *
776 * @return
777 * True / false
778 */
779 bool IsQUe(const std::string& rName) const;
780
781 /**
782 * Get StateSet with QUe-states
783 *
784 * @return
785 * StateSet of QUe-states
786 */
787 StateSet QUeStates(void) const;
788
789 /**
790 * Mark state as Err-state (by index)
791 *
792 * @param index
793 * State index
794 */
795 void SetErr(Idx index);
796
797 /**
798 * Mark state as Err-state (by name)
799 *
800 * @param rName
801 * State name
802 */
803 void SetErr(const std::string& rName);
804
805 /**
806 * Mark set of states as Err-states
807 *
808 * @param rStates
809 * StateSet
810 */
811 void SetErr(const StateSet& rStates);
812
813 /** Mark state as NOT Err-state (by index)
814 *
815 * @param index
816 * State index
817 */
818 void ClrErr(Idx index);
819
820 /**
821 * Mark state as NOT Err-state (by name)
822 *
823 * @param rName
824 * State name
825 */
826 void ClrErr(const std::string& rName);
827
828 /**
829 * Mark set of states as NOT Err-states (by index)
830 *
831 * @param rStates
832 * StateSet
833 */
834 void ClrErr(const StateSet& rStates);
835
836 /** Is state Err-state (by index)
837 *
838 * @param index
839 * State index
840 *
841 * @return
842 * True / false
843 */
844 bool IsErr(Idx index) const;
845
846 /**
847 * Is state Err-state (by name)
848 *
849 * @param rName
850 * State name
851 *
852 * @return
853 * True / false
854 */
855 bool IsErr(const std::string& rName) const;
856
857 /**
858 * Get StateSet with Err-states
859 *
860 * @return
861 * StateSet of Err-states
862 */
863 StateSet ErrStates(void) const;
864
865 /**
866 * Updates internal attributes.
867 * This method sets the state partition attributes.
868 *
869 * @return True if value changed
870 */
871 virtual bool UpdateAttributes(void) {IsHioPlantForm(*this); return true;};
872
873 private:
874
875 protected:
876}; // end class THioPlant
877
878
879// convenience typedef for std HioPlant
881
882/* convenience access to relevant scopes */
883#define THIS THioPlant<GlobalAttr, StateAttr, EventAttr, TransAttr>
884#define BASE TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
885#define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
886
887
888// THioPlant(void)
889TEMP THIS::THioPlant(void) : BASE() {
890 FD_DG("HioPlant(" << this << ")::HioPlant()");
891}
892
893// THioPlant(rOtherGen)
894TEMP THIS::THioPlant(const THioPlant& rOtherGen) : BASE(rOtherGen) {
895 FD_DG("HioPlant(" << this << ")::HioPlant(rOtherGen)");
896}
897
898// THioPlant(rOtherGen)
899TEMP THIS::THioPlant(const Generator& rOtherGen) : BASE(rOtherGen) {
900 FD_DG("HioPlant(" << this << ")::HioPlant(rOtherGen)");
901}
902
903// THioPlant(rOtherGen,rYp,rUp,rYe,rUe)
904TEMP THIS::THioPlant(
905const Generator& rOtherGen,
906 const EventSet& rYp,
907 const EventSet& rUp,
908 const EventSet& rYe,
909 const EventSet& rUe
910) : BASE(rOtherGen) {
911 FD_DG("HioPlant(" << this << ")::HioPlant(rOtherGen)");
912 SetYp(rYp);
913 SetUp(rUp);
914 SetYe(rYe);
915 SetUe(rUe);
916}
917
918// THioPlant(rFileName)
919TEMP THIS::THioPlant(const std::string& rFileName) : BASE(rFileName) {
920 FD_DG("HioPlant(" << this << ")::HioPlant(rFilename) : done");
921}
922
923// New()
924TEMP THIS* THIS::New(void) const {
925 // allocate
926 THIS* res = new THIS();
927 // fix base data
928 res->EventSymbolTablep(BASE::mpEventSymbolTable);
929 res->mStateNamesEnabled=BASE::mStateNamesEnabled;
930 return res;
931}
932
933// Copy()
934TEMP THIS* THIS::Copy(void) const {
935 return new THIS(*this);
936}
937
938// NewHioPlant()
939TEMP THIS THIS::NewHioPlant(void) const {
940 // call base (fixes by assignment constructor)
941 THIS res= BASE::NewAGen();
942 return res;
943}
944
945
946/******************************************************/
947
948 // IsY(index)
949 TEMP bool THIS::IsY(Idx index) const {
950 EventAttr attr=BASE::EventAttribute(index);
951 return attr.IsY();
952 }
953
954 // IsY(rName)
955 TEMP bool THIS::IsY(const std::string& rName) const {
956 EventAttr attr=BASE::EventAttribute(rName);
957 return attr.IsY();
958 }
959
960 // IsU(index)
961 TEMP bool THIS::IsU(Idx index) const {
962 EventAttr attr=BASE::EventAttribute(index);
963 return attr.IsU();
964 }
965
966 // IsU(rName)
967 TEMP bool THIS::IsU(const std::string& rName) const {
968 EventAttr attr=BASE::EventAttribute(rName);
969 return attr.IsU();
970 }
971
972 //YEvents()
973 TEMP EventSet THIS::YEvents(void) const {
974 FD_DG("HioPlant(" << this << ")::YEvents()");
975 EventSet res;
976 EventSet::Iterator it;
977 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
978 if(IsY(*it)) res.Insert(*it);
979 }
980 return res;
981 }
982
983 //UEvents()
984 TEMP EventSet THIS::UEvents(void) const {
985 FD_DG("HioPlant(" << this << ")::UEvents()");
986 EventSet res;
987 EventSet::Iterator it;
988 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
989 if(IsU(*it)) res.Insert(*it);
990 }
991 return res;
992 }
993
994/*****************************************************************/
995
996 // InsYpEvent(index)
997 TEMP void THIS::InsYpEvent(Idx index) {
998 FD_DG("HioPlant(" << this << ")::InsYpEvent(" << index << ")");
999 EventAttr attr;
1000 attr.SetY();
1001 attr.SetP();
1002 BASE::InsEvent(index,attr);
1003 }
1004
1005 // InsYpEvent(rName)
1006 TEMP Idx THIS::InsYpEvent(const std::string& rName) {
1007 FD_DG("HioPlant(" << this << ")::InsYpEvent(" << rName << ")");
1008 EventAttr attr;
1009 attr.SetY();
1010 attr.SetP();
1011 return BASE::InsEvent(rName,attr);
1012 }
1013
1014 // InsUpEvent(index)
1015 TEMP void THIS::InsUpEvent(Idx index) {
1016 FD_DG("HioPlant(" << this << ")::InsUpEvent(" << index << ")");
1017 EventAttr attr;
1018 attr.SetU();
1019 attr.SetP();
1020 BASE::InsEvent(index,attr);
1021 }
1022
1023 // InsUpEvent(rName)
1024 TEMP Idx THIS::InsUpEvent(const std::string& rName) {
1025 FD_DG("HioPlant(" << this << ")::InsUpEvent(" << rName << ")");
1026 EventAttr attr;
1027 attr.SetU();
1028 attr.SetP();
1029 return BASE::InsEvent(rName,attr);
1030 }
1031
1032 // SetYp(index)
1033 TEMP void THIS::SetYp(Idx index) {
1034 FD_DG("HioPlant(" << this << ")::SetYp(" << index << ")");
1035 EventAttr attr=BASE::EventAttribute(index);
1036 attr.SetY();
1037 attr.SetP();
1038 BASE::pAlphabet->Attribute(index,attr);
1039 }
1040
1041 // SetYp(rName)
1042 TEMP void THIS::SetYp(const std::string& rName) {
1043 FD_DG("HioPlant(" << this << ")::SetYp(" << rName << ")");
1044 Idx index = BASE::EventIndex(rName);
1045 SetYp(index);
1046 }
1047
1048 //SetYp(rEvents)
1049 TEMP void THIS::SetYp(const EventSet& rEvents) {
1050 FD_DG("HioPlant(" << this << ")::SetYp(rEvents)");
1051 EventSet::Iterator it;
1052 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1053 SetYp(*it);
1054 }
1055 }
1056
1057 // SetUp(index)
1058 TEMP void THIS::SetUp(Idx index) {
1059 FD_DG("HioPlant(" << this << ")::SetUp(" << index << ")");
1060 EventAttr attr=BASE::EventAttribute(index);
1061 attr.SetU();
1062 attr.SetP();
1063 BASE::pAlphabet->Attribute(index,attr);
1064 }
1065
1066 // SetUp(rName)
1067 TEMP void THIS::SetUp(const std::string& rName) {
1068 FD_DG("HioPlant(" << this << ")::SetUp(" << rName << ")");
1069 Idx index = BASE::EventIndex(rName);
1070 SetUp(index);
1071 }
1072
1073 //SetUp(rEvents)
1074 TEMP void THIS::SetUp(const EventSet& rEvents) {
1075 FD_DG("HioPlant(" << this << ")::SetUp(rEvents)");
1076 EventSet::Iterator it;
1077 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1078 SetUp(*it);
1079 }
1080 }
1081
1082// IsYp(index)
1083 TEMP bool THIS::IsYp(Idx index) const {
1084 EventAttr attr=BASE::EventAttribute(index);
1085 return (attr.IsY() && attr.IsP());
1086 }
1087
1088 // IsYp(rName)
1089 TEMP bool THIS::IsYp(const std::string& rName) const {
1090 EventAttr attr=BASE::EventAttribute(rName);
1091 return (attr.IsY() && attr.IsP());
1092 }
1093
1094// IsUp(index)
1095 TEMP bool THIS::IsUp(Idx index) const {
1096 EventAttr attr=BASE::EventAttribute(index);
1097 return (attr.IsU() && attr.IsP());
1098 }
1099
1100 // IsUp(rName)
1101 TEMP bool THIS::IsUp(const std::string& rName) const {
1102 EventAttr attr=BASE::EventAttribute(rName);
1103 return (attr.IsU() && attr.IsP());
1104 }
1105
1106 //YpEvents()
1107 TEMP EventSet THIS::YpEvents(void) const {
1108 FD_DG("HioPlant(" << this << ")::YpEvents()");
1109 EventSet res;
1110 EventSet::Iterator it;
1111 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1112 if(IsYp(*it)) res.Insert(*it);
1113 }
1114 return res;
1115 }
1116
1117 //UpEvents()
1118 TEMP EventSet THIS::UpEvents(void) const {
1119 FD_DG("HioPlant(" << this << ")::UpEvents()");
1120 EventSet res;
1121 EventSet::Iterator it;
1122 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1123 if(IsUp(*it)) res.Insert(*it);
1124 }
1125 return res;
1126 }
1127
1128/*******************************************************************/
1129
1130 // InsYeEvent(index)
1131 TEMP void THIS::InsYeEvent(Idx index) {
1132 FD_DG("HioPlant(" << this << ")::InsYeEvent(" << index << ")");
1133 EventAttr attr;
1134 attr.SetY();
1135 attr.SetE();
1136 BASE::InsEvent(index,attr);
1137 }
1138
1139 // InsYeEvent(rName)
1140 TEMP Idx THIS::InsYeEvent(const std::string& rName) {
1141 FD_DG("HioPlant(" << this << ")::InsYeEvent(" << rName << ")");
1142 EventAttr attr;
1143 attr.SetY();
1144 attr.SetE();
1145 return BASE::InsEvent(rName,attr);
1146 }
1147
1148 // InsUeEvent(index)
1149 TEMP void THIS::InsUeEvent(Idx index) {
1150 FD_DG("HioPlant(" << this << ")::InsUeEvent(" << index << ")");
1151 EventAttr attr;
1152 attr.SetU();
1153 attr.SetE();
1154 BASE::InsEvent(index,attr);
1155 }
1156
1157 // InsUeEvent(rName)
1158 TEMP Idx THIS::InsUeEvent(const std::string& rName) {
1159 FD_DG("HioPlant(" << this << ")::InsUeEvent(" << rName << ")");
1160 EventAttr attr;
1161 attr.SetU();
1162 attr.SetE();
1163 return BASE::InsEvent(rName,attr);
1164 }
1165
1166 // SetYe(index)
1167 TEMP void THIS::SetYe(Idx index) {
1168 FD_DG("HioPlant(" << this << ")::SetYe(" << index << ")");
1169 EventAttr attr=BASE::EventAttribute(index);
1170 attr.SetY();
1171 attr.SetE();
1172 BASE::pAlphabet->Attribute(index,attr);
1173 }
1174
1175 // SetYe(rName)
1176 TEMP void THIS::SetYe(const std::string& rName) {
1177 FD_DG("HioPlant(" << this << ")::SetYe(" << rName << ")");
1178 Idx index = BASE::EventIndex(rName);
1179 SetYe(index);
1180 }
1181
1182 //SetYe(rEvents)
1183 TEMP void THIS::SetYe(const EventSet& rEvents) {
1184 FD_DG("HioPlant(" << this << ")::SetYe(rEvents)");
1185 EventSet::Iterator it;
1186 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1187 SetYe(*it);
1188 }
1189 }
1190
1191 // SetUe(index)
1192 TEMP void THIS::SetUe(Idx index) {
1193 FD_DG("HioPlant(" << this << ")::SetUe(" << index << ")");
1194 EventAttr attr=BASE::EventAttribute(index);
1195 attr.SetU();
1196 attr.SetE();
1197 BASE::pAlphabet->Attribute(index,attr);
1198 }
1199
1200 // SetUe(rName)
1201 TEMP void THIS::SetUe(const std::string& rName) {
1202 FD_DG("HioPlant(" << this << ")::SetUe(" << rName << ")");
1203 Idx index = BASE::EventIndex(rName);
1204 SetUe(index);
1205 }
1206
1207 //SetUe(rEvents)
1208 TEMP void THIS::SetUe(const EventSet& rEvents) {
1209 FD_DG("HioPlant(" << this << ")::SetUe(rEvents)");
1210 EventSet::Iterator it;
1211 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1212 SetUe(*it);
1213 }
1214 }
1215
1216 // IsYe(index)
1217 TEMP bool THIS::IsYe(Idx index) const {
1218 EventAttr attr=BASE::EventAttribute(index);
1219 return (attr.IsY() && attr.IsE());
1220 }
1221
1222 // IsYe(rName)
1223 TEMP bool THIS::IsYe(const std::string& rName) const {
1224 EventAttr attr=BASE::EventAttribute(rName);
1225 return (attr.IsY() && attr.IsE());
1226 }
1227
1228 // IsUe(index)
1229 TEMP bool THIS::IsUe(Idx index) const {
1230 EventAttr attr=BASE::EventAttribute(index);
1231 return (attr.IsU() && attr.IsE());
1232 }
1233
1234 // IsUe(rName)
1235 TEMP bool THIS::IsUe(const std::string& rName) const {
1236 EventAttr attr=BASE::EventAttribute(rName);
1237 return (attr.IsU() && attr.IsE());
1238 }
1239
1240 //YeEvents()
1241 TEMP EventSet THIS::YeEvents(void) const {
1242 FD_DG("HioPlant(" << this << ")::YeEvents()");
1243 EventSet res;
1244 EventSet::Iterator it;
1245 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1246 if(IsYe(*it)) res.Insert(*it);
1247 }
1248 return res;
1249 }
1250
1251 //UeEvents()
1252 TEMP EventSet THIS::UeEvents(void) const {
1253 FD_DG("HioPlant(" << this << ")::UeEvents()");
1254 EventSet res;
1255 EventSet::Iterator it;
1256 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1257 if(IsUe(*it)) res.Insert(*it);
1258 }
1259 return res;
1260 }
1261
1262/*****************************************************************/
1263
1264 // IsP(index)
1265 TEMP bool THIS::IsP(Idx index) const {
1266 EventAttr attr=BASE::EventAttribute(index);
1267 return attr.IsP();
1268 }
1269
1270 // IsP(rName)
1271 TEMP bool THIS::IsP(const std::string& rName) const {
1272 EventAttr attr=BASE::EventAttribute(rName);
1273 return attr.IsP();
1274 }
1275
1276 // IsE(index)
1277 TEMP bool THIS::IsE(Idx index) const {
1278 EventAttr attr=BASE::EventAttribute(index);
1279 return attr.IsE();
1280 }
1281
1282 // IsE(rName)
1283 TEMP bool THIS::IsE(const std::string& rName) const {
1284 EventAttr attr=BASE::EventAttribute(rName);
1285 return attr.IsE();
1286 }
1287
1288 //PEvents()
1289 TEMP EventSet THIS::PEvents(void) const {
1290 FD_DG("HioPlant(" << this << ")::PEvents()");
1291 EventSet res;
1292 EventSet::Iterator it;
1293 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1294 if(IsP(*it)) res.Insert(*it);
1295 }
1296 return res;
1297 }
1298
1299 //EEvents()
1300 TEMP EventSet THIS::EEvents(void) const {
1301 FD_DG("HioPlant(" << this << ")::EEvents()");
1302 EventSet res;
1303 EventSet::Iterator it;
1304 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1305 if(IsE(*it)) res.Insert(*it);
1306 }
1307 return res;
1308 }
1309
1310/*******************************************************************/
1311
1312/*******************************************************************
1313 *****************Implementation of the state attributes*************
1314*******************************************************************/
1315
1316 // SetQYpYe(index)
1317 TEMP void THIS::SetQYpYe(Idx index) {
1318 FD_DG("HioPlant(" << this << ")::SetQYpYe(" << index << ")");
1319 StateAttr attr=BASE::StateAttribute(index);
1320 attr.SetQY();
1321 attr.SetQP();
1322 attr.SetQE();
1323 attr.ClrQU();
1324 attr.ClrQC();
1325 attr.ClrQL();
1326 attr.ClrQYcUp();
1327 attr.ClrQYlUe();
1328 BASE::pStates->Attribute(index,attr);
1329 }
1330
1331 // SetQYpYe(rName)
1332 TEMP void THIS::SetQYpYe(const std::string& rName) {
1333 FD_DG("HioPlant(" << this << ")::SetQYpYe(" << rName << ")");
1334 Idx index = BASE::StateIndex(rName);
1335 SetQYpYe(index);
1336 }
1337
1338 //SetQYpYe(rStates)
1339 TEMP void THIS::SetQYpYe(const StateSet& rStates) {
1340 FD_DG("HioPlant(" << this << ")::SetQYpYe(rStates)");
1341 StateSet::Iterator sit;
1342 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1343 SetQYpYe(*sit);
1344 }
1345 }
1346
1347 // ClrQYpYe(index)
1348 TEMP void THIS::ClrQYpYe(Idx index) {
1349 FD_DG("HioPlant(" << this << ")::ClrQYpYe(" << index << ")");
1350 StateAttr attr=BASE::StateAttribute(index);
1351 attr.ClrQY();
1352 attr.ClrQP();
1353 attr.ClrQE();
1354 BASE::pStates->Attribute(index,attr);
1355 }
1356
1357 // ClrQYpYe(rName)
1358 TEMP void THIS::ClrQYpYe(const std::string& rName) {
1359 FD_DG("HioPlant(" << this << ")::ClrQYpYe(" << rName << ")");
1360 Idx index = BASE::StateIndex(rName);
1361 ClrQYpYe(index);
1362 }
1363
1364 //ClrQYpYe(rStates)
1365 TEMP void THIS::ClrQYpYe(const StateSet& rStates) {
1366 FD_DG("HioPlant(" << this << ")::ClrQYpYe(rStates)");
1367 StateSet::Iterator sit;
1368 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1369 ClrQYpYe(*sit);
1370 }
1371 }
1372
1373 // IsQYpYe(index)
1374 TEMP bool THIS::IsQYpYe(Idx index) const {
1375 StateAttr attr=BASE::StateAttribute(index);
1376 return attr.IsQY() && attr.IsQP() && attr.IsQE();
1377 }
1378
1379 // IsQYpYe(rName)
1380 TEMP bool THIS::IsQYpYe(const std::string& rName) const {
1381 Idx index = BASE::StateIndex(rName);
1382 return IsQYpYe(index);
1383 }
1384
1385 //QYpYeStates()
1386 TEMP StateSet THIS::QYpYeStates(void) const {
1387 FD_DG("HioPlant(" << this << ")::QYpYeStates()");
1388 StateSet res;
1389 StateSet::Iterator sit;
1390 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1391 if(IsQYpYe(*sit)) res.Insert(*sit);
1392 }
1393 return res;
1394 }
1395/***************************************************************************/
1396
1397 // SetQUp(index)
1398 TEMP void THIS::SetQUp(Idx index) {
1399 FD_DG("HioPlant(" << this << ")::SetQUp(" << index << ")");
1400 StateAttr attr=BASE::StateAttribute(index);
1401 attr.SetQU();
1402 attr.SetQP();
1403 attr.ClrQY();
1404 attr.ClrQC();
1405 attr.ClrQE();
1406 attr.ClrQL();
1407 attr.ClrQYcUp();
1408 attr.ClrQYlUe();
1409 BASE::pStates->Attribute(index,attr);
1410 }
1411
1412 // SetQUp(rName)
1413 TEMP void THIS::SetQUp(const std::string& rName) {
1414 FD_DG("HioPlant(" << this << ")::SetQUp(" << rName << ")");
1415 Idx index = BASE::StateIndex(rName);
1416 SetQUp(index);
1417 }
1418
1419 //SetQUp(rStates)
1420 TEMP void THIS::SetQUp(const StateSet& rStates) {
1421 FD_DG("HioPlant(" << this << ")::SetQUp(rStates)");
1422 StateSet::Iterator sit;
1423 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1424 SetQUp(*sit);
1425 }
1426 }
1427
1428 // ClrQUp(index)
1429 TEMP void THIS::ClrQUp(Idx index) {
1430 FD_DG("HioPlant(" << this << ")::ClrQUp(" << index << ")");
1431 StateAttr attr=BASE::StateAttribute(index);
1432 attr.ClrQU();
1433 attr.ClrQP();
1434 BASE::pStates->Attribute(index,attr);
1435 }
1436
1437 // ClrQUp(rName)
1438 TEMP void THIS::ClrQUp(const std::string& rName) {
1439 FD_DG("HioPlant(" << this << ")::ClrQUp(" << rName << ")");
1440 Idx index = BASE::StateIndex(rName);
1441 ClrQUp(index);
1442 }
1443
1444 //ClrQUp(rStates)
1445 TEMP void THIS::ClrQUp(const StateSet& rStates) {
1446 FD_DG("HioPlant(" << this << ")::ClrQUp(rStates)");
1447 StateSet::Iterator sit;
1448 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1449 ClrQUp(*sit);
1450 }
1451 }
1452
1453 // IsQUp(index)
1454 TEMP bool THIS::IsQUp(Idx index) const {
1455 StateAttr attr=BASE::StateAttribute(index);
1456 return attr.IsQU() && attr.IsQP();
1457 }
1458
1459 // IsQUp(rName)
1460 TEMP bool THIS::IsQUp(const std::string& rName) const {
1461 Idx index = BASE::StateIndex(rName);
1462 return IsQUp(index);
1463 }
1464
1465 //QUpStates()
1466 TEMP StateSet THIS::QUpStates(void) const {
1467 FD_DG("HioPlant(" << this << ")::QUpStates()");
1468 StateSet res;
1469 StateSet::Iterator sit;
1470 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1471 if(IsQUp(*sit)) res.Insert(*sit);
1472 }
1473 return res;
1474 }
1475/***************************************************************************/
1476
1477/***************************************************************************/
1478
1479 // SetQUe(index)
1480 TEMP void THIS::SetQUe(Idx index) {
1481 FD_DG("HioPlant(" << this << ")::SetQUe(" << index << ")");
1482 StateAttr attr=BASE::StateAttribute(index);
1483 attr.SetQU();
1484 attr.SetQE();
1485 attr.ClrQY();
1486 attr.ClrQC();
1487 attr.ClrQP();
1488 attr.ClrQL();
1489 attr.ClrQYcUp();
1490 attr.ClrQYlUe();
1491 BASE::pStates->Attribute(index,attr);
1492 }
1493
1494 // SetQUe(rName)
1495 TEMP void THIS::SetQUe(const std::string& rName) {
1496 FD_DG("HioPlant(" << this << ")::SetQUe(" << rName << ")");
1497 Idx index = BASE::StateIndex(rName);
1498 SetQUe(index);
1499 }
1500
1501 //SetQUe(rStates)
1502 TEMP void THIS::SetQUe(const StateSet& rStates) {
1503 FD_DG("HioPlant(" << this << ")::SetQUe(rStates)");
1504 StateSet::Iterator sit;
1505 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1506 SetQUe(*sit);
1507 }
1508 }
1509
1510 // ClrQUe(index)
1511 TEMP void THIS::ClrQUe(Idx index) {
1512 FD_DG("HioPlant(" << this << ")::ClrQUe(" << index << ")");
1513 StateAttr attr=BASE::StateAttribute(index);
1514 attr.ClrQU();
1515 attr.ClrQE();
1516 BASE::pStates->Attribute(index,attr);
1517 }
1518
1519 // ClrQUe(rName)
1520 TEMP void THIS::ClrQUe(const std::string& rName) {
1521 FD_DG("HioPlant(" << this << ")::ClrQUe(" << rName << ")");
1522 Idx index = BASE::StateIndex(rName);
1523 ClrQUe(index);
1524 }
1525
1526 //ClrQUe(rStates)
1527 TEMP void THIS::ClrQUe(const StateSet& rStates) {
1528 FD_DG("HioPlant(" << this << ")::ClrQUe(rStates)");
1529 StateSet::Iterator sit;
1530 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1531 ClrQUe(*sit);
1532 }
1533 }
1534
1535 // IsQUe(index)
1536 TEMP bool THIS::IsQUe(Idx index) const {
1537 StateAttr attr=BASE::StateAttribute(index);
1538 return attr.IsQU() && attr.IsQE();
1539 }
1540
1541 // IsQUe(rName)
1542 TEMP bool THIS::IsQUe(const std::string& rName) const {
1543 Idx index = BASE::StateIndex(rName);
1544 return IsQUe(index);
1545 }
1546
1547 //QUeStates()
1548 TEMP StateSet THIS::QUeStates(void) const {
1549 FD_DG("HioPlant(" << this << ")::QUeStates()");
1550 StateSet res;
1551 StateSet::Iterator sit;
1552 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1553 if(IsQUe(*sit)) res.Insert(*sit);
1554 }
1555 return res;
1556 }
1557
1558 // SetErr(index)
1559 TEMP void THIS::SetErr(Idx index) {
1560 FD_DG("HioPlant(" << this << ")::SetErr(" << index << ")");
1561 StateAttr attr=BASE::StateAttribute(index);
1562 attr.SetErr();
1563 BASE::pStates->Attribute(index,attr);
1564 }
1565
1566 // SetErr(rName)
1567 TEMP void THIS::SetErr(const std::string& rName) {
1568 FD_DG("HioPlant(" << this << ")::SetErr(" << rName << ")");
1569 Idx index = BASE::StateIndex(rName);
1570 SetErr(index);
1571 }
1572
1573 //SetErr(rStates)
1574 TEMP void THIS::SetErr(const StateSet& rStates) {
1575 FD_DG("HioPlant(" << this << ")::SetErr(rStates)");
1576 StateSet::Iterator sit;
1577 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1578 SetErr(*sit);
1579 }
1580 }
1581
1582 // ClrErr(index)
1583 TEMP void THIS::ClrErr(Idx index) {
1584 FD_DG("HioPlant(" << this << ")::ClrErr(" << index << ")");
1585 StateAttr attr=BASE::StateAttribute(index);
1586 attr.ClrErr();
1587 BASE::pStates->Attribute(index,attr);
1588 }
1589
1590 // ClrErr(rName)
1591 TEMP void THIS::ClrErr(const std::string& rName) {
1592 FD_DG("HioPlant(" << this << ")::ClrErr(" << rName << ")");
1593 Idx index = BASE::StateIndex(rName);
1594 ClrErr(index);
1595 }
1596
1597 //ClrErr(rStates)
1598 TEMP void THIS::ClrErr(const StateSet& rStates) {
1599 FD_DG("HioPlant(" << this << ")::ClrErr(rStates)");
1600 StateSet::Iterator sit;
1601 for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
1602 ClrErr(*sit);
1603 }
1604 }
1605
1606 // IsErr(index)
1607 TEMP bool THIS::IsErr(Idx index) const {
1608 StateAttr attr=BASE::StateAttribute(index);
1609 return attr.IsErr();
1610 }
1611
1612 // IsErr(rName)
1613 TEMP bool THIS::IsErr(const std::string& rName) const {
1614 Idx index = BASE::StateIndex(rName);
1615 return IsErr(index);
1616 }
1617
1618 //ErrStates()
1619 TEMP StateSet THIS::ErrStates(void) const {
1620 FD_DG("HioPlant(" << this << ")::ErrStates()");
1621 StateSet res;
1622 StateSet::Iterator sit;
1623 for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
1624 if(IsErr(*sit)) res.Insert(*sit);
1625 }
1626 return res;
1627 }
1628
1629/***************************************************************************/
1630
1631#undef TEMP
1632#undef BASE
1633#undef THIS
1634
1635/**
1636 * IsHioPlantForm: check if rHioPlant is in I/O-plant form and assign state
1637 * attributes.
1638 * This function tests if rHioPlant meets the I/O-plant form that has been formally
1639 * defined by S.Perk. If so, then the alphabet of and the language marked by
1640 * rHioPlant formally describe an I/O plant. During the test, the HioStateFlags are
1641 * set according to the active event set or the respective state, for example:
1642 * The QYpYe flag is assigned to a state if its active even set is a subset of the
1643 * union of the YP- and the YE-Alphabet.
1644 * The assignment of HioStateFlags is complete only if IsHioPlantForm() returns true.
1645 * Method: all conditions in the formal I/O-plant form definition are checked
1646 * individually. If crucial conditions are violated, the test of remaining
1647 * conditions is omitted.
1648 *
1649 * @param rHioPlant
1650 * HioPlant to check, HioStateFlags are set
1651 * @param rQYpYe
1652 * State set containing all QYpYe states
1653 * @param rQUp
1654 * State set containing all QUp states
1655 * @param rQUe
1656 * State set containing all QUe states
1657 * @param rErrEvSet
1658 * Event set for possible 'bad' events
1659 * @param rErrTrSet
1660 * Event set for possible 'bad' transition relations
1661 * @param rErrStSet
1662 * Event set for possible 'bad' states
1663 * @param rReportStr
1664 * Information about test results
1665 * @return
1666 * true if rHioPlant is in I/O-plant form
1667 */
1668extern FAUDES_API bool IsHioPlantForm(HioPlant& rHioPlant,
1669 StateSet& rQYpYe,
1670 StateSet& rQUp,
1671 StateSet& rQUe,
1672 EventSet& rErrEvSet,
1673 TransSet& rErrTrSet,
1674 StateSet& rErrStSet,
1675 std::string& rReportStr);
1676
1677/**
1678 * IsHioPlantForm: check if rHioPlant is in I/O-plant form and assign state
1679 * attributes.
1680 * This function tests if rHioPlant meets the I/O-plant form that has been formally
1681 * defined by S.Perk. If so, then the alphabet of and the language marked by
1682 * rHioPlant formally describe an I/O plant. During the test, the HioStateFlags are
1683 * set according to the active event set or the respective state, for example:
1684 * The QYpYe flag is assigned to a state if its active even set is a subset of the
1685 * union of the YP- and the YE-Alphabet.
1686 * The assignment of HioStateFlags is complete only if IsHioPlantForm() returns true.
1687 * Method: all conditions in the formal I/O-plant form definition are checked
1688 * individually. If crucial conditions are violated, the test of remaining
1689 * conditions is omitted.
1690 *
1691 * @param rHioPlant
1692 * HioPlant to check, HioStateFlags are set
1693 * @param rReportStr
1694 * Information about test results
1695 * @return
1696 * true if rHioPlant is in I/O-plant form
1697 */
1698extern FAUDES_API bool IsHioPlantForm(HioPlant& rHioPlant,std::string& rReportStr);
1699
1700/**
1701 * IsHioPlantForm: check if rHioPlant is in I/O-plant form and assign state
1702 * attributes.
1703 * This function tests if rHioPlant meets the I/O-plant form that has been formally
1704 * defined by S.Perk. If so, then the alphabet of and the language marked by
1705 * rHioPlant formally describe an I/O plant. During the test, the HioStateFlags are
1706 * set according to the active event set or the respective state, for example:
1707 * The QYpYe flag is assigned to a state if its active eventset is a subset of the
1708 * union of the YP- and the YE-Alphabet.
1709 * The assignment of HioStateFlags is complete only if IsHioPlantForm() returns true.
1710 * Method: all conditions of the formal I/O-plant form definition are checked
1711 * individually. If crucial conditions are violated, the test of remaining
1712 * conditions is omitted.
1713 *
1714 * @param rHioPlant
1715 * HioPlant to check, HioStateFlags are set
1716 * @return
1717 * true if rHioPlant is in I/O-plant form
1718 */
1719extern FAUDES_API bool IsHioPlantForm(HioPlant& rHioPlant);
1720
1721
1722/**
1723 * Function definition for run-time interface
1724 */
1725extern FAUDES_API bool IsHioPlantForm(HioPlant& rHioPlant, std::string& rReportStr);
1726
1727/**
1728 * Function definition for run-time interface
1729 */
1730extern FAUDES_API bool IsHioPlantForm(HioPlant& rHioPlant);
1731
1732/**
1733 * Function definition for run-time interface
1734 */
1735extern FAUDES_API bool IsHioPlantForm(HioPlant& rHioPlant,
1736 StateSet& rQYpYe,
1737 StateSet& rQUp,
1738 StateSet& rQUe,
1739 EventSet& rErrEvSet,
1740 TransSet& rErrTrSet,
1741 StateSet& rErrStSet,
1742 std::string& rReportStr);
1743
1744
1745/**
1746 * Function definition for run-time interface
1747 *
1748 * @param rPlant
1749 * HioPlant
1750 */
1751extern FAUDES_API void HioStatePartition(HioPlant& rPlant);
1752
1753
1754
1755
1756
1757} // namespace faudes
1758
1759#endif
#define TEMP
#define BASE
#define THIS
#define FD_DG(message)
#define FAUDES_API
#define FAUDES_TAPI
bool Insert(const Idx &rIndex)
bool IsE(const std::string &rName) const
Definition hio_plant.h:1283
void SetUp(const EventSet &rEvents)
Definition hio_plant.h:1074
bool IsUp(Idx index) const
Definition hio_plant.h:1095
void ClrQUp(const StateSet &rStates)
Definition hio_plant.h:1445
bool IsQUp(const std::string &rName) const
Definition hio_plant.h:1460
void SetQYpYe(const StateSet &rStates)
Definition hio_plant.h:1339
void SetYp(const EventSet &rEvents)
Definition hio_plant.h:1049
void SetQUe(const std::string &rName)
Definition hio_plant.h:1495
void SetYp(Idx index)
Definition hio_plant.h:1033
void SetQYpYe(Idx index)
Definition hio_plant.h:1317
void SetErr(const std::string &rName)
Definition hio_plant.h:1567
virtual bool UpdateAttributes(void)
Definition hio_plant.h:871
bool IsP(const std::string &rName) const
Definition hio_plant.h:1271
void ClrQUe(Idx index)
Definition hio_plant.h:1511
void SetQYpYe(const std::string &rName)
Definition hio_plant.h:1332
EventSet EEvents(void) const
Definition hio_plant.h:1300
bool IsUe(Idx index) const
Definition hio_plant.h:1229
bool IsY(Idx index) const
Definition hio_plant.h:949
Idx InsYeEvent(const std::string &rName)
Definition hio_plant.h:1140
Idx InsUpEvent(const std::string &rName)
Definition hio_plant.h:1024
THioPlant NewHioPlant(void) const
Definition hio_plant.h:939
void SetErr(Idx index)
Definition hio_plant.h:1559
void ClrQUe(const std::string &rName)
Definition hio_plant.h:1520
void SetYe(Idx index)
Definition hio_plant.h:1167
void ClrErr(const StateSet &rStates)
Definition hio_plant.h:1598
void SetQUe(Idx index)
Definition hio_plant.h:1480
StateSet ErrStates(void) const
Definition hio_plant.h:1619
THioPlant(const Generator &rOtherGen)
Definition hio_plant.h:899
void SetUe(const EventSet &rEvents)
Definition hio_plant.h:1208
bool IsP(Idx index) const
Definition hio_plant.h:1265
void SetYe(const EventSet &rEvents)
Definition hio_plant.h:1183
EventSet YEvents(void) const
Definition hio_plant.h:973
EventSet UeEvents(void) const
Definition hio_plant.h:1252
void SetUe(const std::string &rName)
Definition hio_plant.h:1201
bool IsErr(Idx index) const
Definition hio_plant.h:1607
bool IsUp(const std::string &rName) const
Definition hio_plant.h:1101
bool IsQUe(const std::string &rName) const
Definition hio_plant.h:1542
void ClrQUp(const std::string &rName)
Definition hio_plant.h:1438
Idx InsUeEvent(const std::string &rName)
Definition hio_plant.h:1158
virtual THioPlant * Copy(void) const
Definition hio_plant.h:934
bool IsYp(const std::string &rName) const
Definition hio_plant.h:1089
void InsYpEvent(Idx index)
Definition hio_plant.h:997
void InsUeEvent(Idx index)
Definition hio_plant.h:1149
StateSet QUpStates(void) const
Definition hio_plant.h:1466
Idx InsYpEvent(const std::string &rName)
Definition hio_plant.h:1006
void SetQUe(const StateSet &rStates)
Definition hio_plant.h:1502
bool IsQYpYe(Idx index) const
Definition hio_plant.h:1374
bool IsUe(const std::string &rName) const
Definition hio_plant.h:1235
EventSet UpEvents(void) const
Definition hio_plant.h:1118
StateSet QUeStates(void) const
Definition hio_plant.h:1548
void InsUpEvent(Idx index)
Definition hio_plant.h:1015
void ClrErr(const std::string &rName)
Definition hio_plant.h:1591
bool IsQUe(Idx index) const
Definition hio_plant.h:1536
bool IsQUp(Idx index) const
Definition hio_plant.h:1454
void SetQUp(const std::string &rName)
Definition hio_plant.h:1413
void SetUp(const std::string &rName)
Definition hio_plant.h:1067
void ClrErr(Idx index)
Definition hio_plant.h:1583
bool IsQYpYe(const std::string &rName) const
Definition hio_plant.h:1380
void ClrQUe(const StateSet &rStates)
Definition hio_plant.h:1527
THioPlant(const THioPlant &rOtherGen)
Definition hio_plant.h:894
void InsYeEvent(Idx index)
Definition hio_plant.h:1131
void SetUp(Idx index)
Definition hio_plant.h:1058
bool IsU(const std::string &rName) const
Definition hio_plant.h:967
void ClrQYpYe(const StateSet &rStates)
Definition hio_plant.h:1365
void SetYp(const std::string &rName)
Definition hio_plant.h:1042
void ClrQYpYe(Idx index)
Definition hio_plant.h:1348
bool IsYp(Idx index) const
Definition hio_plant.h:1083
void SetQUp(const StateSet &rStates)
Definition hio_plant.h:1420
void ClrQUp(Idx index)
Definition hio_plant.h:1429
bool IsYe(Idx index) const
Definition hio_plant.h:1217
StateSet QYpYeStates(void) const
Definition hio_plant.h:1386
EventSet UEvents(void) const
Definition hio_plant.h:984
void SetYe(const std::string &rName)
Definition hio_plant.h:1176
EventSet PEvents(void) const
Definition hio_plant.h:1289
THioPlant(const std::string &rFileName)
Definition hio_plant.h:919
void SetErr(const StateSet &rStates)
Definition hio_plant.h:1574
void SetQUp(Idx index)
Definition hio_plant.h:1398
virtual THioPlant * New(void) const
Definition hio_plant.h:924
bool IsErr(const std::string &rName) const
Definition hio_plant.h:1613
EventSet YpEvents(void) const
Definition hio_plant.h:1107
bool IsU(Idx index) const
Definition hio_plant.h:961
bool IsYe(const std::string &rName) const
Definition hio_plant.h:1223
bool IsY(const std::string &rName) const
Definition hio_plant.h:955
EventSet YeEvents(void) const
Definition hio_plant.h:1241
void SetUe(Idx index)
Definition hio_plant.h:1192
THioPlant(const Generator &rOtherGen, const EventSet &rYp, const EventSet &rUp, const EventSet &rYe, const EventSet &rUe)
Definition hio_plant.h:904
bool IsE(Idx index) const
Definition hio_plant.h:1277
void ClrQYpYe(const std::string &rName)
Definition hio_plant.h:1358
Iterator End(void) const
Iterator Begin(void) const
uint32_t Idx
void HioStatePartition(HioConstraint &rHioConstraint)
THioPlant< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid > HioPlant
Definition hio_plant.h:880
bool IsHioPlantForm(HioPlant &rHioPlant, StateSet &rQYpYe, StateSet &rQUp, StateSet &rQUe, EventSet &rErrEvSet, TransSet &rErrTrSet, StateSet &rErrStSet, std::string &rReportStr)
Definition hio_plant.cpp:16

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen