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

libFAUDES 2.26g --- 2015.08.17 --- c++ api documentaion by doxygen