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

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