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

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