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

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen