hio_controller.h

Go to the documentation of this file.
00001 /** @file hio_controller.h Generator with I/O-controller attributes */
00002 
00003 /* Hierarchical IO Systems Plug-In for FAU Discrete Event Systems Library (libfaudes)
00004 
00005    Copyright (C) 2006  Sebastian Perk 
00006    Copyright (C) 2006  Thomas Moor 
00007    Copyright (C) 2006  Klaus Schmidt
00008 
00009 */
00010 
00011 #ifndef FAUDES_HIO_CONTROLLER_H
00012 #define FAUDES_HIO_CONTROLLER_H
00013 
00014 #include "corefaudes.h"
00015 #include "hio_attributes.h"
00016 
00017 namespace faudes {
00018 
00019 
00020 /**
00021  * Generator with I/O-controller attributes. The HioController is a variant of the 
00022  * Generator to add an interface for events and states with I/O-controller attributes,
00023  * built from HioEvent- and HioStateFlags
00024  * - event attributes: YC   = Y && C
00025  *                     UC   = U && C
00026  *                     YP   = Y && P
00027  *                     UP   = U && P
00028  * - state attributes: QYP = QY && QP
00029  *                     QUp  = QU && QP
00030  *                     QUc  = QU && QC
00031  *                     QYcUp
00032  *
00033  * Technically, the construct is based on the specialized attribute classes
00034  * faudes::HioEventFlags and faudes::HioStateFlags that provide attributes with
00035  * semantics for hierarchical I/O properties. The THioController expects attribute template
00036  * parameters with the minimum interface defined in HioEventFlags and HioStateFlags.
00037  * Thus, you can add further semantics by deriving a class HioEventFlagsAndMore  from
00038  * HioEventFlags (same for HioStateFlags) and use this as event attribute parameter for
00039  * THioController. To model a plain finite state machine plus I/O-controller properties, use THioController
00040  * with HioEventFlags and HioStateFlags for the event and state attribute parameters
00041  * and AttributeVoid for the other parameters.
00042  * For convenience, this has been typedefed as HioController.
00043  * 
00044  * @ingroup hiosysplugin 
00045  */
00046 
00047 template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
00048     class THioController : public TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr> {    
00049   public:
00050     /**
00051      * Creates an empty HioController object 
00052      */
00053     THioController(void);
00054 
00055     /** 
00056      * HioController from a std Generator. Copy constructor 
00057      *
00058      * @param rOtherGen
00059      */
00060    THioController(const Generator& rOtherGen);
00061 
00062     /** 
00063      * HioController from a std Generator and event sets. Copy constructor 
00064      *
00065      * @param rOtherGen
00066      *   Generator
00067      * @param rYc
00068      *   alphabet Yc
00069      * @param rUc
00070      *   alphabet Uc
00071      * @param rYp
00072      *   alphabet Yp
00073      * @param rUp
00074      *   alphabet Up
00075      */
00076    THioController(
00077    const Generator& rOtherGen,
00078    const EventSet& rYc,
00079    const EventSet& rUc,
00080    const EventSet& rYp,
00081    const EventSet& rUp
00082    );
00083    
00084     /** 
00085      * HioController from a HioController. Copy constructor 
00086      *
00087      * @param rOtherGen
00088      */
00089     THioController(const THioController& rOtherGen);
00090 
00091     /**
00092      * construct a HioController from file
00093      *
00094      * @param rFileName
00095      *   Filename
00096      *
00097      * @exception Exception
00098      *   If opening/reading fails an Exception object is thrown (id 1, 50, 51)
00099      */
00100     THioController(const std::string& rFileName);
00101   
00102     /**
00103      * Construct on heap
00104      *
00105      * @return 
00106      *   new Generator 
00107      */
00108     THioController* New(void) const;
00109 
00110     /**
00111      * Construct copy on heap
00112      *
00113      * @return 
00114      *   new Generator 
00115      */
00116     virtual THioController* Copy(void) const;
00117 
00118     /**
00119      * Create empty HioController with same symboltable as this
00120      *
00121      * @return
00122      *   New Generator
00123      */
00124     THioController NewHioController(void) const;
00125   
00126     /**
00127      * Assignment operator (uses copy )
00128      * Note: you must reimplement this operator in derived 
00129      * classes in order to handle internal pointers correctly
00130      *
00131      * @param rOtherGen
00132      *   Other generator
00133      */
00134     virtual THioController& operator= (const THioController& rOtherGen) {this->Assign(rOtherGen); return *this;};
00135 
00136     /**
00137      * Assignment operator (uses copy )
00138      *
00139      * @param rOtherGen
00140      *   Other generator
00141      */
00142      virtual THioController& operator= (const Generator& rOtherGen) {this->Assign(rOtherGen); return *this;};
00143     
00144 //**************** I/O controller event attributes ********************/
00145 
00146     /**
00147      * Add an existing Yp-event to generator. 
00148      * An entry in the global event table will be made.
00149      *
00150      * @param index
00151      *   Event index
00152      */
00153     void InsYpEvent(Idx index);
00154 
00155     /**
00156      * Add new named Yp-event to generator. 
00157      * An entry in the global event table will be made if event is new.
00158      *
00159      * @param rName
00160      *   Name of the event to add
00161      *
00162      * @return 
00163      *   New global unique index
00164      */
00165     Idx InsYpEvent(const std::string& rName);
00166     
00167     /**
00168      * Add an existing Up-event to generator. 
00169      * An entry in the global event table will be made.
00170      *
00171      * @param index
00172      *   Event index
00173      */
00174     void InsUpEvent(Idx index);
00175 
00176     /**
00177      * Add new named Up-event to generator. 
00178      * An entry in the global event table will be made if event is new.
00179      *
00180      * @param rName
00181      *   Name of the event to add
00182      *
00183      * @return 
00184      *   New global unique index
00185      */
00186     Idx InsUpEvent(const std::string& rName);
00187         
00188     /**
00189      * Mark event as Yp-event (by index)
00190      *
00191      * @param index
00192      *   Event index
00193      */
00194     void SetYp(Idx index);
00195 
00196     /** 
00197      * Mark event as Yp-event(by name)
00198      *
00199      * @param rName
00200      *   Event name    
00201      */
00202     void SetYp(const std::string& rName);
00203 
00204     /**
00205      * Mark set of events as Yp-events
00206      *
00207      * @param rEvents
00208      *   EventSet
00209      */
00210     void SetYp(const EventSet& rEvents);
00211         
00212     /**
00213      * Mark event Up-event(by index)
00214      * 
00215      * @param index
00216      *   Event index
00217      */
00218     void SetUp(Idx index);
00219 
00220     /**
00221      * Mark event Up-event(by name)
00222      * 
00223      * @param rName
00224      *   Event name
00225      */
00226     void SetUp(const std::string& rName);
00227 
00228     /**
00229      * Mark set of events as Up-events
00230      *
00231      * @param rEvents
00232      *   EventSet
00233      */
00234     void SetUp(const EventSet& rEvents);
00235           
00236     /**
00237      * Is event Yp-event(by index)
00238      *
00239      * @param index
00240      *   Event index
00241      *
00242      * @return
00243      *   True / false
00244      */
00245     bool IsYp(Idx index) const;
00246 
00247     /**
00248      * Is event Yp-event(by name)
00249      *
00250      * @param rName
00251      *   Event name
00252      *
00253      * @return
00254      *   True / false
00255      */
00256     bool IsYp(const std::string& rName) const;
00257     
00258     /**
00259      * Is event Up-event(by index)
00260      *
00261      * @param index
00262      *   Event index
00263      *
00264      * @return
00265      *   True / false
00266      */
00267     bool IsUp(Idx index) const;
00268 
00269     /**
00270      * Is event Up-event(by name)
00271      *
00272      * @param rName
00273      *   Event name
00274      *
00275      * @return
00276      *   True / false
00277      */
00278     bool IsUp(const std::string& rName) const;
00279 
00280     /** 
00281      * Get EventSet with Yp-events
00282      *
00283      * @return
00284      *   EventSet of Yp-events
00285      */
00286     EventSet YpEvents(void) const;
00287 
00288     /**
00289      * Get EventSet with Up-events
00290      *
00291      * @return 
00292      *   EventSet of Up-events
00293      */
00294     EventSet UpEvents(void) const;
00295 
00296     /**
00297      * Add an existing Yc-event to generator. 
00298      * An entry in the global event table will be made.
00299      *
00300      * @param index
00301      *   Event index
00302      */
00303     void InsYcEvent(Idx index);
00304    
00305    /**
00306      * Add new named Yc-event to generator. 
00307      * An entry in the global event table will be made if event is new.
00308      *
00309      * @param rName
00310      *   Name of the event to add
00311      *
00312      * @return 
00313      *   New global unique index
00314      */
00315     Idx InsYcEvent(const std::string& rName);
00316     
00317     /**
00318      * Add an existing Uc-event to generator. 
00319      * An entry in the global event table will be made.
00320      *
00321      * @param index
00322      *   Event index
00323      */
00324     void InsUcEvent(Idx index);
00325 
00326     /**
00327      * Add new named Uc-event to generator. 
00328      * An entry in the global event table will be made if event is new.
00329      *
00330      * @param rName
00331      *   Name of the event to add
00332      *
00333      * @return 
00334      *   New global unique index
00335      */
00336     Idx InsUcEvent(const std::string& rName);
00337         
00338     /**
00339      * Mark event as Yc-event (by index)
00340      *
00341      * @param index
00342      *   Event index
00343      */
00344     void SetYc(Idx index);
00345 
00346     /** 
00347      * Mark event as Yc-event (by name)
00348      *
00349      * @param rName
00350      *   Event name    
00351      */
00352     void SetYc(const std::string& rName);
00353 
00354     /**
00355      * Mark set of events as Yc-events
00356      *
00357      * @param rEvents
00358      *   EventSet
00359      */
00360     void SetYc(const EventSet& rEvents);
00361         
00362     /**
00363      * Mark event as Uc-event (by index)
00364      * 
00365      * @param index
00366      *   Event index
00367      */
00368     void SetUc(Idx index);
00369 
00370     /**
00371      * Mark event as Uc-event (by name)
00372      * 
00373      * @param rName
00374      *   Event name
00375      */
00376     void SetUc(const std::string& rName);
00377 
00378     /**
00379      * Mark set of events as Uc-events 
00380      *
00381      * @param rEvents
00382      *   EventSet
00383      */
00384     void SetUc(const EventSet& rEvents);
00385           
00386     /**
00387      * Is event Yc-event (by index)
00388      *
00389      * @param index
00390      *   Event index
00391      *
00392      * @return
00393      *   True / false
00394      */
00395     bool IsYc(Idx index) const;
00396 
00397     /**
00398      * Is event Yc-event (by name)
00399      *
00400      * @param rName
00401      *   Event name
00402      *
00403      * @return
00404      *   True / false
00405      */
00406     bool IsYc(const std::string& rName) const;
00407 
00408     /**
00409      * Is event Uc-event (by index)
00410      *
00411      * @param index
00412      *   Event index
00413      *
00414      * @return
00415      *   True / false
00416      */
00417     bool IsUc(Idx index) const;
00418 
00419     /**
00420      * Is event Uc-event (by name)
00421      *
00422      * @param rName
00423      *   Event name
00424      *
00425      * @return
00426      *   True / false
00427      */
00428     bool IsUc(const std::string& rName) const;
00429 
00430     /** 
00431      * Get EventSet with Yc-events
00432      *
00433      * @return
00434      *   EventSet of Yc-events
00435      */
00436     EventSet YcEvents(void) const;
00437 
00438     /**
00439      * Get EventSet with Uc-events
00440      *
00441      * @return 
00442      *   EventSet of Uc-events
00443      */
00444     EventSet UcEvents(void) const;
00445 
00446 
00447 //************** query elementary event attributes ****************************/
00448     /**
00449      * Is event Y-event? (by index)
00450      *
00451      * @param index
00452      *   Event index
00453      *
00454      * @return
00455      *   True / false
00456      */
00457     bool IsY(Idx index) const;
00458 
00459     /**
00460      * Is event Y-event? (by name)
00461      *
00462      * @param rName
00463      *   Event name
00464      *
00465      * @return
00466      *   True / false
00467      */
00468     bool IsY(const std::string& rName) const;
00469 
00470     /** 
00471      * Get EventSet with Y-events
00472      *
00473      * @return
00474      *   EventSet of Y-events
00475      */
00476     EventSet YEvents(void) const;
00477 
00478     /**
00479      * Is event U-event? (by index)
00480      *
00481      * @param index
00482      *   Event index
00483      *
00484      * @return
00485      *   True / false
00486      */
00487     bool IsU(Idx index) const;
00488 
00489     /**
00490      * Is event U-event? (by name)
00491      *
00492      * @param rName
00493      *   Event name
00494      *
00495      * @return
00496      *   True / false
00497      */
00498     bool IsU(const std::string& rName) const;
00499 
00500     /**
00501      * Get EventSet with U-events
00502      *
00503      * @return 
00504      *   EventSet of U-events
00505      */
00506     EventSet UEvents(void) const;
00507           
00508     /**
00509      * Is event P-event? (by index)
00510      *
00511      * @param index
00512      *   Event index
00513      *
00514      * @return
00515      *   True / false
00516      */
00517     bool IsP(Idx index) const;
00518 
00519     /**
00520      * Is event P-event? (by name)
00521      *
00522      * @param rName
00523      *   Event name
00524      *
00525      * @return
00526      *   True / false
00527      */
00528     bool IsP(const std::string& rName) const;
00529 
00530     /** 
00531      * Get EventSet with P-events
00532      *
00533      * @return
00534      *   EventSet of P-events
00535      */
00536     EventSet PEvents(void) const;
00537     
00538     /**
00539      * Is event E-event? (by index)
00540      *
00541      * @param index
00542      *   Event index
00543      *
00544      * @return
00545      *   True / false
00546      */
00547     bool IsC(Idx index) const;
00548 
00549     /**
00550      * Is event E-event? (by name)
00551      *
00552      * @param rName
00553      *   Event name
00554      *
00555      * @return
00556      *   True / false
00557      */
00558     bool IsC(const std::string& rName) const;    
00559 
00560     /**
00561      * Get EventSet with E-events
00562      *
00563      * @return 
00564      *   EventSet of E-events
00565      */
00566     EventSet CEvents(void) const;
00567 /******************************************************/
00568 
00569 
00570 /*************** I/O controller state attributes **********************/
00571 
00572     /**
00573      * Mark state as QYP-state (by index)
00574      *
00575      * @param index
00576      *   State index
00577      */
00578     void SetQYp(Idx index);
00579 
00580     /** 
00581      * Mark state as QYP-state (by name)
00582      *
00583      * @param rName
00584      *   State name    
00585      */
00586     void SetQYp(const std::string& rName);
00587 
00588     /**
00589      * Mark set of states as QYP-states
00590      *
00591      * @param rStates
00592      *   StateSet
00593      */
00594     void SetQYp(const StateSet& rStates);
00595     
00596     /** Mark state as NOT QYP-state (by index)
00597      * 
00598      * @param index
00599      *   State index
00600      */
00601     void ClrQYP(Idx index);
00602 
00603     /**
00604      * Mark state as NOT QYP-state (by name)
00605      * 
00606      * @param rName
00607      *   State name
00608      */
00609     void ClrQYP(const std::string& rName);
00610 
00611     /** 
00612      * Mark set of states as NOT QYP-states (by index)
00613      *
00614      * @param rStates
00615      *   StateSet
00616      */
00617     void ClrQYP(const StateSet& rStates);
00618 
00619     /** Is state QYP-state (by index)
00620      *
00621      * @param index
00622      *   State index
00623      *
00624      * @return
00625      *   True / false
00626      */
00627     bool IsQYP(Idx index) const;
00628 
00629     /**
00630      * Is state QYP-state (by name)
00631      *
00632      * @param rName
00633      *   State name
00634      *
00635      * @return
00636      *   True / false
00637      */
00638     bool IsQYP(const std::string& rName) const;
00639 
00640     /**
00641      * Get StateSet with QYP-states
00642      *
00643      * @return 
00644      *   StateSet of QYP-states
00645      */
00646     StateSet QYPStates(void) const;
00647     
00648     /**
00649      * Mark event as QUp-state (by index)
00650      *
00651      * @param index
00652      *   State index
00653      */
00654     void SetQUp(Idx index);
00655 
00656     /** 
00657      * Mark state as QUp-state (by name)
00658      *
00659      * @param rName
00660      *   State name    
00661      */
00662     void SetQUp(const std::string& rName);
00663 
00664     /**
00665      * Mark set of states as QUp-states
00666      *
00667      * @param rStates
00668      *   StateSet
00669      */
00670     void SetQUp(const StateSet& rStates);
00671     
00672     /** Mark state as NOT QUp-state (by index)
00673      * 
00674      * @param index
00675      *   State index
00676      */
00677     void ClrQUp(Idx index);
00678 
00679     /**
00680      * Mark state as NOT QUp-state (by name)
00681      * 
00682      * @param rName
00683      *   State name
00684      */
00685     void ClrQUp(const std::string& rName);
00686 
00687     /** 
00688      * Mark set of states as NOT QUp-states (by index)
00689      *
00690      * @param rStates
00691      *   StateSet
00692      */
00693     void ClrQUp(const StateSet& rStates);
00694 
00695     /** Is state QUp-state (by index)
00696      *
00697      * @param index
00698      *   State index
00699      *
00700      * @return
00701      *   True / false
00702      */
00703     bool IsQUp(Idx index) const;
00704 
00705     /**
00706      * Is state QUp-state (by name)
00707      *
00708      * @param rName
00709      *   State name
00710      *
00711      * @return
00712      *   True / false
00713      */
00714     bool IsQUp(const std::string& rName) const;
00715     
00716     /**
00717      * Get StateSet with QUp-states
00718      *
00719      * @return 
00720      *   StateSet of QUp-states
00721      */
00722     StateSet QUpStates(void) const;
00723 
00724     /**
00725      * Mark event as QUc-state (by index)
00726      *
00727      * @param index
00728      *   State index
00729      */
00730     void SetQUc(Idx index);
00731 
00732     /** 
00733      * Mark state as QUc-state (by name)
00734      *
00735      * @param rName
00736      *   State name    
00737      */
00738     void SetQUc(const std::string& rName);
00739 
00740     /**
00741      * Mark set of states as QUc-states
00742      *
00743      * @param rStates
00744      *   StateSet
00745      */
00746     void SetQUc(const StateSet& rStates);
00747     
00748     /** Mark state as NOT QUc-state (by index)
00749      * 
00750      * @param index
00751      *   State index
00752      */
00753     void ClrQUc(Idx index);
00754 
00755     /**
00756      * Mark state as NOT QUc-state (by name)
00757      * 
00758      * @param rName
00759      *   State name
00760      */
00761     void ClrQUc(const std::string& rName);
00762 
00763     /** 
00764      * Mark set of states as NOT QUc-states (by index)
00765      *
00766      * @param rStates
00767      *   StateSet
00768      */
00769     void ClrQUc(const StateSet& rStates);
00770 
00771     /** Is state QUc-state (by index)
00772      *
00773      * @param index
00774      *   State index
00775      *
00776      * @return
00777      *   True / false
00778      */
00779     bool IsQUc(Idx index) const;
00780 
00781     /**
00782      * Is state QUc-state (by name)
00783      *
00784      * @param rName
00785      *   State name
00786      *
00787      * @return
00788      *   True / false
00789      */
00790     bool IsQUc(const std::string& rName) const;
00791     
00792     /**
00793      * Get StateSet with QUc-states
00794      *
00795      * @return 
00796      *   StateSet of QUc-states
00797      */
00798     StateSet QUcStates(void) const;
00799 
00800     /**
00801      * Mark event as QYcUp-state (by index)
00802      *
00803      * @param index
00804      *   State index
00805      */
00806     void SetQYcUp(Idx index);
00807 
00808     /** 
00809      * Mark state as QYcUp-state (by name)
00810      *
00811      * @param rName
00812      *   State name    
00813      */
00814     void SetQYcUp(const std::string& rName);
00815 
00816     /**
00817      * Mark set of states as QYcUp-states
00818      *
00819      * @param rStates
00820      *   StateSet
00821      */
00822     void SetQYcUp(const StateSet& rStates);
00823     
00824     /** Mark state as NOT QYcUp-state (by index)
00825      * 
00826      * @param index
00827      *   State index
00828      */
00829     void ClrQYcUp(Idx index);
00830 
00831     /**
00832      * Mark state as NOT QYcUp-state (by name)
00833      * 
00834      * @param rName
00835      *   State name
00836      */
00837     void ClrQYcUp(const std::string& rName);
00838 
00839     /** 
00840      * Mark set of states as NOT QYcUp-states (by index)
00841      *
00842      * @param rStates
00843      *   StateSet
00844      */
00845     void ClrQYcUp(const StateSet& rStates);
00846 
00847     /** Is state QYcUp-state (by index)
00848      *
00849      * @param index
00850      *   State index
00851      *
00852      * @return
00853      *   True / false
00854      */
00855     bool IsQYcUp(Idx index) const;
00856 
00857     /**
00858      * Is state QYcUp-state (by name)
00859      *
00860      * @param rName
00861      *   State name
00862      *
00863      * @return
00864      *   True / false
00865      */
00866     bool IsQYcUp(const std::string& rName) const;
00867     
00868     /**
00869      * Get StateSet with QYcUp-states
00870      *
00871      * @return 
00872      *   StateSet of QYcUp-states
00873      */
00874     StateSet QYcUpStates(void) const;
00875 
00876   /**
00877      * Mark state as Err-state (by index)
00878      *
00879      * @param index
00880      *   State index
00881      */
00882     void SetErr(Idx index);
00883 
00884     /** 
00885      * Mark state as Err-state (by name)
00886      *
00887      * @param rName
00888      *   State name    
00889      */
00890     void SetErr(const std::string& rName);
00891 
00892     /**
00893      * Mark set of states as Err-states
00894      *
00895      * @param rStates
00896      *   StateSet
00897      */
00898     void SetErr(const StateSet& rStates);
00899     
00900     /** Mark state as NOT Err-state (by index)
00901      * 
00902      * @param index
00903      *   State index
00904      */
00905     void ClrErr(Idx index);
00906 
00907     /**
00908      * Mark state as NOT Err-state (by name)
00909      * 
00910      * @param rName
00911      *   State name
00912      */
00913     void ClrErr(const std::string& rName);
00914 
00915     /** 
00916      * Mark set of states as NOT Err-states (by index)
00917      *
00918      * @param rStates
00919      *   StateSet
00920      */
00921     void ClrErr(const StateSet& rStates);
00922 
00923     /** Is state Err-state (by index)
00924      *
00925      * @param index
00926      *   State index
00927      *
00928      * @return
00929      *   True / false
00930      */
00931     bool IsErr(Idx index) const;
00932 
00933     /**
00934      * Is state Err-state (by name)
00935      *
00936      * @param rName
00937      *   State name
00938      *
00939      * @return
00940      *   True / false
00941      */
00942     bool IsErr(const std::string& rName) const;
00943 
00944     /**
00945      * Get StateSet with Err-states
00946      *
00947      * @return 
00948      *   StateSet of Err-states
00949      */
00950     StateSet ErrStates(void) const;
00951     
00952     /**
00953      * Updates internal attributes. 
00954      * This method sets the state partition attributes.
00955      * 
00956      * @return True if value changed
00957      */
00958     virtual bool UpdateAttributes(void) {IsHioControllerForm(*this); return true;};
00959     
00960   private:
00961 
00962   protected:
00963 }; // end class THioController
00964 
00965     
00966 // convenience typedef for std HioController
00967 typedef THioController<AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid> HioController;
00968 
00969 /* convenience access to relevant scopes */
00970 #define THIS THioController<GlobalAttr, StateAttr, EventAttr, TransAttr>
00971 #define BASE TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
00972 #define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
00973 
00974 
00975 // THioController(void)
00976 TEMP THIS::THioController(void) : BASE() {
00977   FD_DG("HioController(" << this << ")::HioController()");
00978 }
00979 
00980 // THioController(rOtherGen)
00981 TEMP THIS::THioController(const THioController& rOtherGen) : BASE(rOtherGen) {
00982   FD_DG("HioController(" << this << ")::HioController(rOtherGen)");
00983 }
00984 
00985 // THioController(rOtherGen)
00986 TEMP THIS::THioController(const Generator& rOtherGen) : BASE(rOtherGen) {
00987   FD_DG("HioController(" << this << ")::HioController(rOtherGen)");
00988 }
00989 
00990 // THioController(rOtherGen,rYc,rUc,rYp,rUp)
00991 TEMP THIS::THioController(
00992 const Generator& rOtherGen,
00993    const EventSet& rYc,
00994    const EventSet& rUc,
00995    const EventSet& rYp,
00996    const EventSet& rUp
00997 ) : BASE(rOtherGen) {
00998   FD_DG("HioController(" << this << ")::HioController(rOtherGen)");
00999   SetYc(rYc);
01000   SetUc(rUc);
01001   SetYp(rYp);
01002   SetUp(rUp);
01003 }
01004 
01005 // THioController(rFileName)
01006 TEMP THIS::THioController(const std::string& rFileName) : BASE(rFileName) {
01007   FD_DG("HioController(" << this << ")::HioController(rFilename) : done");
01008 }
01009 
01010 // New()
01011 TEMP THIS* THIS::New(void) const {
01012   // allocate
01013   THIS* res = new THIS;
01014   // fix base data
01015   res->EventSymbolTablep(BASE::mpEventSymbolTable);
01016   res->mStateNamesEnabled=BASE::mStateNamesEnabled;
01017   return res;
01018 }
01019 
01020 // Copy()
01021 TEMP THIS* THIS::Copy(void) const {
01022   return new THIS(*this);
01023 }
01024 
01025 // NewHioController()
01026 TEMP THIS THIS::NewHioController(void) const {
01027   // call base (fixes by assignment constructor)
01028   THIS res= BASE::NewAGen();
01029   return res;
01030 }
01031 
01032 /******************************************************/
01033 
01034   // IsY(index)
01035   TEMP bool THIS::IsY(Idx index) const {
01036     EventAttr attr=BASE::EventAttribute(index);
01037     return attr.IsY();
01038   } 
01039   
01040   // IsY(rName)
01041   TEMP bool THIS::IsY(const std::string& rName) const {
01042     EventAttr attr=BASE::EventAttribute(rName);
01043     return attr.IsY();
01044   } 
01045 
01046   // IsU(index)
01047   TEMP bool THIS::IsU(Idx index) const {
01048     EventAttr attr=BASE::EventAttribute(index);
01049     return attr.IsU();
01050   } 
01051   
01052   // IsU(rName)
01053   TEMP bool THIS::IsU(const std::string& rName) const {
01054     EventAttr attr=BASE::EventAttribute(rName);
01055     return attr.IsU();
01056   } 
01057 
01058   //YEvents()
01059   TEMP EventSet THIS::YEvents(void) const {
01060     FD_DG("HioController(" << this << ")::YEvents()");
01061     EventSet res;
01062     EventSet::Iterator it;
01063     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01064       if(IsY(*it)) res.Insert(*it);
01065     }
01066     return res;
01067   }
01068   
01069   //UEvents()
01070   TEMP EventSet THIS::UEvents(void) const {
01071     FD_DG("HioController(" << this << ")::UEvents()");
01072     EventSet res;
01073     EventSet::Iterator it;
01074     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01075       if(IsU(*it)) res.Insert(*it);
01076     }
01077     return res;
01078   }
01079   
01080 /*****************************************************************/
01081 
01082   // InsYpEvent(index)
01083   TEMP void THIS::InsYpEvent(Idx index) {
01084     FD_DG("HioController(" << this << ")::InsYpEvent(" << index << ")");
01085     EventAttr attr;
01086     attr.SetY();
01087     attr.SetP();
01088     BASE::InsEvent(index,attr);
01089   } 
01090 
01091   // InsYpEvent(rName)
01092   TEMP Idx THIS::InsYpEvent(const std::string& rName) {
01093     FD_DG("HioController(" << this << ")::InsYpEvent(" << rName << ")");
01094     EventAttr attr;
01095     attr.SetY();
01096     attr.SetP();
01097     return BASE::InsEvent(rName,attr);
01098   } 
01099 
01100   // InsUpEvent(index)
01101   TEMP void THIS::InsUpEvent(Idx index) {
01102     FD_DG("HioController(" << this << ")::InsUpEvent(" << index << ")");
01103     EventAttr attr;
01104     attr.SetU();
01105     attr.SetP();
01106     BASE::InsEvent(index,attr);
01107   } 
01108 
01109   // InsUpEvent(rName)
01110   TEMP Idx THIS::InsUpEvent(const std::string& rName) {
01111     FD_DG("HioController(" << this << ")::InsUpEvent(" << rName << ")");
01112     EventAttr attr;
01113     attr.SetU();
01114     attr.SetP();
01115     return BASE::InsEvent(rName,attr);
01116   } 
01117     
01118   // SetYp(index)
01119   TEMP void THIS::SetYp(Idx index) {
01120     FD_DG("HioController(" << this << ")::SetYp(" << index << ")");
01121     EventAttr attr=BASE::EventAttribute(index);
01122     attr.SetY();
01123     attr.SetP();
01124     BASE::pAlphabet->Attribute(index,attr);
01125   } 
01126 
01127   // SetYp(rName)
01128   TEMP void THIS::SetYp(const std::string& rName) {
01129     FD_DG("HioController(" << this << ")::SetYp(" << rName << ")");
01130     Idx index = BASE::EventIndex(rName);
01131     SetYp(index);
01132   }
01133 
01134   //SetYp(rEvents)
01135   TEMP void THIS::SetYp(const EventSet& rEvents) {
01136     FD_DG("HioController(" << this << ")::SetYp(rEvents)");
01137     EventSet::Iterator it;
01138     for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
01139       SetYp(*it);
01140     }
01141   }
01142     
01143   // SetUp(index)
01144   TEMP void THIS::SetUp(Idx index) {
01145     FD_DG("HioController(" << this << ")::SetUp(" << index << ")");
01146     EventAttr attr=BASE::EventAttribute(index);
01147     attr.SetU();
01148     attr.SetP();
01149     BASE::pAlphabet->Attribute(index,attr);
01150   } 
01151 
01152   // SetUp(rName)
01153   TEMP void THIS::SetUp(const std::string& rName) {
01154     FD_DG("HioController(" << this << ")::SetUp(" << rName << ")");
01155     Idx index = BASE::EventIndex(rName);
01156     SetUp(index);
01157   }
01158 
01159   //SetUp(rEvents)
01160   TEMP void THIS::SetUp(const EventSet& rEvents) {
01161     FD_DG("HioController(" << this << ")::SetUp(rEvents)");
01162     EventSet::Iterator it;
01163     for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
01164       SetUp(*it);
01165     }
01166   }
01167 
01168 // IsYp(index)
01169   TEMP bool THIS::IsYp(Idx index) const {
01170     EventAttr attr=BASE::EventAttribute(index);
01171     return (attr.IsY() && attr.IsP());
01172   } 
01173   
01174   // IsYp(rName)
01175   TEMP bool THIS::IsYp(const std::string& rName) const {
01176     EventAttr attr=BASE::EventAttribute(rName);
01177     return (attr.IsY() && attr.IsP());
01178   } 
01179 
01180 // IsUp(index)
01181   TEMP bool THIS::IsUp(Idx index) const {
01182     EventAttr attr=BASE::EventAttribute(index);
01183     return (attr.IsU() && attr.IsP());
01184   } 
01185   
01186   // IsUp(rName)
01187   TEMP bool THIS::IsUp(const std::string& rName) const {
01188     EventAttr attr=BASE::EventAttribute(rName);
01189     return (attr.IsU() && attr.IsP());
01190   } 
01191   
01192   //YpEvents()
01193   TEMP EventSet THIS::YpEvents(void) const {
01194     FD_DG("HioController(" << this << ")::YpEvents()");
01195     EventSet res;
01196     EventSet::Iterator it;
01197     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01198       if(IsYp(*it)) res.Insert(*it);
01199     }
01200     return res;
01201   }
01202   
01203   //UpEvents()
01204   TEMP EventSet THIS::UpEvents(void) const {
01205     FD_DG("HioController(" << this << ")::UpEvents()");
01206     EventSet res;
01207     EventSet::Iterator it;
01208     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01209       if(IsUp(*it)) res.Insert(*it);
01210     }
01211     return res;
01212   }
01213 
01214 /*******************************************************************/
01215 
01216   // InsYcEvent(index)
01217   TEMP void THIS::InsYcEvent(Idx index) {
01218     FD_DG("HioController(" << this << ")::InsYcEvent(" << index << ")");
01219     EventAttr attr;
01220     attr.SetY();
01221     attr.SetC();
01222     BASE::InsEvent(index,attr);
01223   } 
01224 
01225   // InsYcEvent(rName)
01226   TEMP Idx THIS::InsYcEvent(const std::string& rName) {
01227     FD_DG("HioController(" << this << ")::InsYcEvent(" << rName << ")");
01228     EventAttr attr;
01229     attr.SetY();
01230     attr.SetC();
01231     return BASE::InsEvent(rName,attr);
01232   } 
01233 
01234   // InsUcEvent(index)
01235   TEMP void THIS::InsUcEvent(Idx index) {
01236     FD_DG("HioController(" << this << ")::InsUcEvent(" << index << ")");
01237     EventAttr attr;
01238     attr.SetU();
01239     attr.SetC();
01240     BASE::InsEvent(index,attr);
01241   } 
01242 
01243   // InsUcEvent(rName)
01244   TEMP Idx THIS::InsUcEvent(const std::string& rName) {
01245     FD_DG("HioController(" << this << ")::InsUcEvent(" << rName << ")");
01246     EventAttr attr;
01247     attr.SetU();
01248     attr.SetC();
01249     return BASE::InsEvent(rName,attr);
01250   } 
01251     
01252   // SetYc(index)
01253   TEMP void THIS::SetYc(Idx index) {
01254     FD_DG("HioController(" << this << ")::SetYc(" << index << ")");
01255     EventAttr attr=BASE::EventAttribute(index);
01256     attr.SetY();
01257     attr.SetC();
01258     BASE::pAlphabet->Attribute(index,attr);
01259   } 
01260 
01261   // SetYc(rName)
01262   TEMP void THIS::SetYc(const std::string& rName) {
01263     FD_DG("HioController(" << this << ")::SetYc(" << rName << ")");
01264     Idx index = BASE::EventIndex(rName);
01265     SetYc(index);
01266   }
01267 
01268   //SetYc(rEvents)
01269   TEMP void THIS::SetYc(const EventSet& rEvents) {
01270     FD_DG("HioController(" << this << ")::SetYc(rEvents)");
01271     EventSet::Iterator it;
01272     for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
01273       SetYc(*it);
01274     }
01275   }
01276     
01277   // SetUc(index)
01278   TEMP void THIS::SetUc(Idx index) {
01279     FD_DG("HioController(" << this << ")::SetUc(" << index << ")");
01280     EventAttr attr=BASE::EventAttribute(index);
01281     attr.SetU();
01282     attr.SetC();
01283     BASE::pAlphabet->Attribute(index,attr);
01284   } 
01285 
01286   // SetUc(rName)
01287   TEMP void THIS::SetUc(const std::string& rName) {
01288     FD_DG("HioController(" << this << ")::SetUc(" << rName << ")");
01289     Idx index = BASE::EventIndex(rName);
01290     SetUc(index); 
01291   }
01292 
01293   //SetUc(rEvents)
01294   TEMP void THIS::SetUc(const EventSet& rEvents) {
01295     FD_DG("HioController(" << this << ")::SetUc(rEvents)");
01296     EventSet::Iterator it;
01297     for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
01298       SetUc(*it);
01299     }
01300   }
01301 
01302   // IsYc(index)
01303   TEMP bool THIS::IsYc(Idx index) const {
01304     EventAttr attr=BASE::EventAttribute(index);
01305     return (attr.IsY() && attr.IsC());
01306   } 
01307   
01308   // IsYc(rName)
01309   TEMP bool THIS::IsYc(const std::string& rName) const {
01310     EventAttr attr=BASE::EventAttribute(rName);
01311     return (attr.IsY() && attr.IsC());
01312   } 
01313 
01314   // IsUc(index)
01315   TEMP bool THIS::IsUc(Idx index) const {
01316     EventAttr attr=BASE::EventAttribute(index);
01317     return (attr.IsU() && attr.IsC());
01318   } 
01319   
01320   // IsUc(rName)
01321   TEMP bool THIS::IsUc(const std::string& rName) const {
01322     EventAttr attr=BASE::EventAttribute(rName);
01323     return (attr.IsU() && attr.IsC());
01324   } 
01325 
01326   //YcEvents()
01327   TEMP EventSet THIS::YcEvents(void) const {
01328     FD_DG("HioController(" << this << ")::YcEvents()");
01329     EventSet res;
01330     EventSet::Iterator it;
01331     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01332       if(IsYc(*it)) res.Insert(*it);
01333     }
01334     return res;
01335   }
01336   
01337   //UcEvents()
01338   TEMP EventSet THIS::UcEvents(void) const {
01339     FD_DG("HioController(" << this << ")::UcEvents()");
01340     EventSet res;
01341     EventSet::Iterator it;
01342     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01343       if(IsUc(*it)) res.Insert(*it);
01344     }
01345     return res;
01346   }
01347 
01348 /*****************************************************************/
01349 
01350   // IsP(index)
01351   TEMP bool THIS::IsP(Idx index) const {
01352     EventAttr attr=BASE::EventAttribute(index);
01353     return attr.IsP();
01354   } 
01355   
01356   // IsP(rName)
01357   TEMP bool THIS::IsP(const std::string& rName) const {
01358     EventAttr attr=BASE::EventAttribute(rName);
01359     return attr.IsP();
01360   } 
01361 
01362   // IsC(index)
01363   TEMP bool THIS::IsC(Idx index) const {
01364     EventAttr attr=BASE::EventAttribute(index);
01365     return attr.IsC();
01366   } 
01367   
01368   // IsC(rName)
01369   TEMP bool THIS::IsC(const std::string& rName) const {
01370     EventAttr attr=BASE::EventAttribute(rName);
01371     return attr.IsC();
01372   } 
01373 
01374   //PEvents()
01375   TEMP EventSet THIS::PEvents(void) const {
01376     FD_DG("HioController(" << this << ")::PEvents()");
01377     EventSet res;
01378     EventSet::Iterator it;
01379     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01380       if(IsP(*it)) res.Insert(*it);
01381     }
01382     return res;
01383   }
01384   
01385   //CEvents()
01386   TEMP EventSet THIS::CEvents(void) const {
01387     FD_DG("HioController(" << this << ")::EEvents()");
01388     EventSet res;
01389     EventSet::Iterator it;
01390     for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
01391       if(IsC(*it)) res.Insert(*it);
01392     }
01393     return res;
01394   }
01395   
01396 /*******************************************************************/
01397 
01398 /*******************************************************************
01399  *****************Implementation of the state attributes*************
01400 *******************************************************************/
01401 
01402   // index)
01403   TEMP void THIS::SetQYp(Idx index) {
01404     FD_DG("HioController(" << this << ")::" << index << ")");
01405     StateAttr attr=BASE::StateAttribute(index);
01406     attr.SetQY();
01407     attr.SetQP();
01408     attr.ClrQU();
01409     attr.ClrQC();
01410     attr.ClrQE();
01411     attr.ClrQL();
01412     attr.ClrQYcUp();
01413     attr.ClrQYlUe();
01414     BASE::pStates->Attribute(index,attr);
01415   } 
01416 
01417   // rName)
01418   TEMP void THIS::SetQYp(const std::string& rName) {
01419     FD_DG("HioController(" << this << ")::" << rName << ")");
01420     Idx index = BASE::StateIndex(rName);
01421     SetQYp(index);
01422   }
01423 
01424   //rStates)
01425   TEMP void THIS::SetQYp(const StateSet& rStates) {
01426     FD_DG("HioController(" << this << ")::rStates)");
01427     StateSet::Iterator sit;
01428     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01429       SetQYp(*sit);
01430     }
01431   }
01432 
01433   // ClrQYP(index)
01434   TEMP void THIS::ClrQYP(Idx index) {
01435     FD_DG("HioController(" << this << ")::ClrQYP(" << index << ")");
01436     StateAttr attr=BASE::StateAttribute(index);
01437     attr.ClrQY();
01438     attr.ClrQP();
01439     BASE::pStates->Attribute(index,attr);
01440   } 
01441 
01442   // ClrQYP(rName)
01443   TEMP void THIS::ClrQYP(const std::string& rName) {
01444     FD_DG("HioController(" << this << ")::ClrQYP(" << rName << ")");
01445     Idx index = BASE::StateIndex(rName);
01446     ClrQYP(index);
01447   }
01448 
01449   //ClrQYP(rStates)
01450   TEMP void THIS::ClrQYP(const StateSet& rStates) {
01451     FD_DG("HioController(" << this << ")::ClrQYP(rStates)");
01452     StateSet::Iterator sit;
01453     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01454       ClrQYP(*sit);
01455     }
01456   }
01457 
01458   // IsQYP(index)
01459   TEMP bool THIS::IsQYP(Idx index) const {
01460     StateAttr attr=BASE::StateAttribute(index);
01461     return attr.IsQY() && attr.IsQP() && attr.IsQC();
01462   } 
01463   
01464   // IsQYP(rName)
01465   TEMP bool THIS::IsQYP(const std::string& rName) const {
01466     Idx index = BASE::StateIndex(rName);
01467     return IsQYP(index);
01468   }
01469 
01470   //QYPStates()
01471   TEMP StateSet THIS::QYPStates(void) const {
01472     FD_DG("HioController(" << this << ")::QYPStates()");
01473     StateSet res;
01474     StateSet::Iterator sit;
01475     for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
01476       if(IsQYP(*sit)) res.Insert(*sit);
01477     }
01478     return res;
01479   }
01480 /***************************************************************************/
01481 
01482   // SetQUp(index)
01483   TEMP void THIS::SetQUp(Idx index) {
01484     FD_DG("HioController(" << this << ")::SetQUp(" << index << ")");
01485     StateAttr attr=BASE::StateAttribute(index);
01486     attr.SetQU();
01487     attr.SetQP();
01488     attr.ClrQY();
01489     attr.ClrQC();
01490     attr.ClrQE();
01491     attr.ClrQL();
01492     attr.ClrQYcUp();
01493     attr.ClrQYlUe();
01494     BASE::pStates->Attribute(index,attr);
01495   } 
01496 
01497   // SetQUp(rName)
01498   TEMP void THIS::SetQUp(const std::string& rName) {
01499     FD_DG("HioController(" << this << ")::SetQUp(" << rName << ")");
01500     Idx index = BASE::StateIndex(rName);
01501     SetQUp(index);
01502   }
01503 
01504   //SetQUp(rStates)
01505   TEMP void THIS::SetQUp(const StateSet& rStates) {
01506     FD_DG("HioController(" << this << ")::SetQUp(rStates)");
01507     StateSet::Iterator sit;
01508     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01509       SetQUp(*sit);
01510     }
01511   }
01512 
01513   // ClrQUp(index)
01514   TEMP void THIS::ClrQUp(Idx index) {
01515     FD_DG("HioController(" << this << ")::ClrQUp(" << index << ")");
01516     StateAttr attr=BASE::StateAttribute(index);
01517     attr.ClrQU();
01518     attr.ClrQP();
01519     BASE::pStates->Attribute(index,attr);
01520   } 
01521 
01522   // ClrQUp(rName)
01523   TEMP void THIS::ClrQUp(const std::string& rName) {
01524     FD_DG("HioController(" << this << ")::ClrQUp(" << rName << ")");
01525     Idx index = BASE::StateIndex(rName);
01526     ClrQUp(index);
01527   }
01528 
01529   //ClrQUp(rStates)
01530   TEMP void THIS::ClrQUp(const StateSet& rStates) {
01531     FD_DG("HioController(" << this << ")::ClrQUp(rStates)");
01532     StateSet::Iterator sit;
01533     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01534       ClrQUp(*sit);
01535     }
01536   }
01537 
01538   // IsQUp(index)
01539   TEMP bool THIS::IsQUp(Idx index) const {
01540     StateAttr attr=BASE::StateAttribute(index);
01541     return attr.IsQU() && attr.IsQP();
01542   } 
01543   
01544   // IsQUp(rName)
01545   TEMP bool THIS::IsQUp(const std::string& rName) const {
01546     Idx index = BASE::StateIndex(rName);
01547     return IsQUp(index);
01548   }
01549 
01550   //QUpStates()
01551   TEMP StateSet THIS::QUpStates(void) const {
01552     FD_DG("HioController(" << this << ")::QUpStates()");
01553     StateSet res;
01554     StateSet::Iterator sit;
01555     for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
01556       if(IsQUp(*sit)) res.Insert(*sit);
01557     }
01558     return res;
01559   }
01560 /***************************************************************************/
01561 
01562 /***************************************************************************/
01563 
01564   // SetQUc(index)
01565   TEMP void THIS::SetQUc(Idx index) {
01566     FD_DG("HioController(" << this << ")::SetQUc(" << index << ")");
01567     StateAttr attr=BASE::StateAttribute(index);
01568     attr.SetQU();
01569     attr.SetQC();
01570     attr.ClrQY();
01571     attr.ClrQP();
01572     attr.ClrQE();
01573     attr.ClrQL();
01574     attr.ClrQYcUp();
01575     attr.ClrQYlUe();
01576     BASE::pStates->Attribute(index,attr);
01577   } 
01578 
01579   // SetQUc(rName)
01580   TEMP void THIS::SetQUc(const std::string& rName) {
01581     FD_DG("HioController(" << this << ")::SetQUc(" << rName << ")");
01582     Idx index = BASE::StateIndex(rName);
01583     SetQUc(index);
01584   }
01585 
01586   //SetQUc(rStates)
01587   TEMP void THIS::SetQUc(const StateSet& rStates) {
01588     FD_DG("HioController(" << this << ")::SetQUc(rStates)");
01589     StateSet::Iterator sit;
01590     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01591       SetQUc(*sit);
01592     }
01593   }
01594 
01595   // ClrQUc(index)
01596   TEMP void THIS::ClrQUc(Idx index) {
01597     FD_DG("HioController(" << this << ")::ClrQUc(" << index << ")");
01598     StateAttr attr=BASE::StateAttribute(index);
01599     attr.ClrQU();
01600     attr.ClrQC();
01601     BASE::pStates->Attribute(index,attr);
01602   } 
01603 
01604   // ClrQUc(rName)
01605   TEMP void THIS::ClrQUc(const std::string& rName) {
01606     FD_DG("HioController(" << this << ")::ClrQUc(" << rName << ")");
01607     Idx index = BASE::StateIndex(rName);
01608     ClrQUc(index);
01609   }
01610 
01611   //ClrQUc(rStates)
01612   TEMP void THIS::ClrQUc(const StateSet& rStates) {
01613     FD_DG("HioController(" << this << ")::ClrQUc(rStates)");
01614     StateSet::Iterator sit;
01615     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01616       ClrQUc(*sit);
01617     }
01618   }
01619 
01620   // IsQUc(index)
01621   TEMP bool THIS::IsQUc(Idx index) const {
01622     StateAttr attr=BASE::StateAttribute(index);
01623     return attr.IsQU() && attr.IsQC();
01624   } 
01625   
01626   // IsQUc(rName)
01627   TEMP bool THIS::IsQUc(const std::string& rName) const {
01628     Idx index = BASE::StateIndex(rName);
01629     return IsQUc(index);
01630   }
01631 
01632   //QUcStates()
01633   TEMP StateSet THIS::QUcStates(void) const {
01634     FD_DG("HioController(" << this << ")::QUcStates()");
01635     StateSet res;
01636     StateSet::Iterator sit;
01637     for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
01638       if(IsQUc(*sit)) res.Insert(*sit);
01639     }
01640     return res;
01641   }
01642 
01643 /***************************************************************************/
01644 
01645   // SetQYcUp(index)
01646   TEMP void THIS::SetQYcUp(Idx index) {
01647     FD_DG("HioController(" << this << ")::SetQYcUp(" << index << ")");
01648     StateAttr attr=BASE::StateAttribute(index);
01649     attr.SetQYcUp();
01650     attr.ClrQY();
01651     attr.ClrQU();
01652     attr.ClrQC();
01653     attr.ClrQP();
01654     attr.ClrQE();
01655     attr.ClrQL();
01656     attr.ClrQYlUe();
01657     BASE::pStates->Attribute(index,attr);
01658   } 
01659 
01660   // SetQYcUp(rName)
01661   TEMP void THIS::SetQYcUp(const std::string& rName) {
01662     FD_DG("HioController(" << this << ")::SetQYcUp(" << rName << ")");
01663     Idx index = BASE::StateIndex(rName);
01664     SetQYcUp(index);
01665   }
01666 
01667   //SetQYcUp(rStates)
01668   TEMP void THIS::SetQYcUp(const StateSet& rStates) {
01669     FD_DG("HioController(" << this << ")::SetQYcUp(rStates)");
01670     StateSet::Iterator sit;
01671     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01672       SetQYcUp(*sit);
01673     }
01674   }
01675 
01676   // ClrQYcUp(index)
01677   TEMP void THIS::ClrQYcUp(Idx index) {
01678     FD_DG("HioController(" << this << ")::ClrQYcUp(" << index << ")");
01679     StateAttr attr=BASE::StateAttribute(index);
01680     attr.ClrQYcUp();
01681     BASE::pStates->Attribute(index,attr);
01682   } 
01683 
01684   // ClrQYcUp(rName)
01685   TEMP void THIS::ClrQYcUp(const std::string& rName) {
01686     FD_DG("HioController(" << this << ")::ClrQYcUp(" << rName << ")");
01687     Idx index = BASE::StateIndex(rName);
01688     ClrQYcUp(index);
01689   }
01690 
01691   //ClrQYcUp(rStates)
01692   TEMP void THIS::ClrQYcUp(const StateSet& rStates) {
01693     FD_DG("HioController(" << this << ")::ClrQYcUp(rStates)");
01694     StateSet::Iterator sit;
01695     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01696       ClrQYcUp(*sit);
01697     }
01698   }
01699 
01700   // IsQYcUp(index)
01701   TEMP bool THIS::IsQYcUp(Idx index) const {
01702     StateAttr attr=BASE::StateAttribute(index);
01703     return attr.IsQYcUp();
01704   } 
01705   
01706   // IsQYcUp(rName)
01707   TEMP bool THIS::IsQYcUp(const std::string& rName) const {
01708     Idx index = BASE::StateIndex(rName);
01709     return IsQYcUp(index);
01710   }
01711 
01712   //QYcUpStates()
01713   TEMP StateSet THIS::QYcUpStates(void) const {
01714     FD_DG("HioController(" << this << ")::QYcUpStates()");
01715     StateSet res;
01716     StateSet::Iterator sit;
01717     for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
01718       if(IsQYcUp(*sit)) res.Insert(*sit);
01719     }
01720     return res;
01721   }
01722 
01723   // SetErr(index)
01724   TEMP void THIS::SetErr(Idx index) {
01725     FD_DG("HioPlant(" << this << ")::SetErr(" << index << ")");
01726     StateAttr attr=BASE::StateAttribute(index);
01727     attr.SetErr();
01728     BASE::pStates->Attribute(index,attr);
01729   } 
01730 
01731   // SetErr(rName)
01732   TEMP void THIS::SetErr(const std::string& rName) {
01733     FD_DG("HioPlant(" << this << ")::SetErr(" << rName << ")");
01734     Idx index = BASE::StateIndex(rName);
01735     SetErr(index);
01736   }
01737 
01738   //SetErr(rStates)
01739   TEMP void THIS::SetErr(const StateSet& rStates) {
01740     FD_DG("HioPlant(" << this << ")::SetErr(rStates)");
01741     StateSet::Iterator sit;
01742     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01743       SetErr(*sit);
01744     }
01745   }
01746 
01747   // ClrErr(index)
01748   TEMP void THIS::ClrErr(Idx index) {
01749     FD_DG("HioPlant(" << this << ")::ClrErr(" << index << ")");
01750     StateAttr attr=BASE::StateAttribute(index);
01751     attr.ClrErr();
01752     BASE::pStates->Attribute(index,attr);
01753   } 
01754 
01755   // ClrErr(rName)
01756   TEMP void THIS::ClrErr(const std::string& rName) {
01757     FD_DG("HioPlant(" << this << ")::ClrErr(" << rName << ")");
01758     Idx index = BASE::StateIndex(rName);
01759     ClrErr(index);
01760   }
01761 
01762   //ClrErr(rStates)
01763   TEMP void THIS::ClrErr(const StateSet& rStates) {
01764     FD_DG("HioPlant(" << this << ")::ClrErr(rStates)");
01765     StateSet::Iterator sit;
01766     for(sit=rStates.Begin(); sit!=rStates.End(); sit++) {
01767       ClrErr(*sit);
01768     }
01769   }
01770 
01771   // IsErr(index)
01772   TEMP bool THIS::IsErr(Idx index) const {
01773     StateAttr attr=BASE::StateAttribute(index);
01774     return attr.IsErr();
01775   } 
01776   
01777   // IsErr(rName)
01778   TEMP bool THIS::IsErr(const std::string& rName) const {
01779     Idx index = BASE::StateIndex(rName);
01780     return IsErr(index);
01781   }
01782 
01783   //ErrStates()
01784   TEMP StateSet THIS::ErrStates(void) const {
01785     FD_DG("HioPlant(" << this << ")::ErrStates()");
01786     StateSet res;
01787     StateSet::Iterator sit;
01788     for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) {
01789       if(IsErr(*sit)) res.Insert(*sit);
01790     }
01791     return res;
01792   }
01793 
01794 /***************************************************************************/
01795 
01796 #undef TEMP
01797 #undef BASE
01798 #undef THIS
01799 
01800 /**
01801      * IsHioControllerForm: check if rHioController is in I/O-controller form and assign state
01802      * attributes.
01803      * This function tests if rHioController meets the I/O-controller form that has been formally
01804      * defined by S.Perk. If so, then the alphabet of and the language marked by
01805      * rHioController formally describe an I/O controller. During the test, the HioStateFlags are
01806      * set according to the active event set or the respective state, for example:
01807      * The QYcUp flag is assigned to a state if its active eventset is a subset of the
01808      * union of the YC- and the UP-Alphabet.
01809      * The assignment of HioStateFlags is complete only if IsHioControllerForm() returns true.
01810      * Method: all conditions in the formal I/O-controller form definition are checked
01811      * individually. If crucial conditions are violated, the test of remaining
01812      * conditions is omitted.
01813      *
01814      * @param rHioController
01815      *   HioController to check, HioStateFlags are set
01816      * @param rQUc
01817      *   State set containing all QUc states
01818      * @param rQYP
01819      *   State set containing all QYP states
01820      * @param rQUp
01821      *   State set containing all QUp states
01822      * @param rQYcUp
01823      *   State set containing all QYcUp states
01824      * @param rErrEvSet
01825      *   Event set for possible 'bad' events
01826      * @param rErrTrSet
01827      *   Event set for possible 'bad' transition relations
01828      * @param rErrStSet
01829      *   Event set for possible 'bad' states
01830      * @param rReportStr
01831      *   Information about test results
01832      * @return
01833      *   true if rHioController is in I/O-controller form
01834      */
01835 bool IsHioControllerForm(HioController& rHioController,
01836                 StateSet& rQUc,
01837                 StateSet& rQYP,
01838                 StateSet& rQUp,
01839                 StateSet& rQYcUp,
01840                 EventSet& rErrEvSet,
01841                 TransSet& rErrTrSet,
01842                 StateSet& rErrStSet,
01843                 std::string& rReportStr);
01844 
01845 /**
01846      * IsHioControllerForm: check if rHioController is in I/O-controller form and assign state
01847      * attributes.
01848      * This function tests if rHioController meets the I/O-controller form that has been formally
01849      * defined by S.Perk. If so, then the alphabet of and the language marked by
01850      * rHioController formally describe an I/O controller. During the test, the HioStateFlags are
01851      * set according to the active event set or the respective state, for example:
01852      * The QYcUp flag is assigned to a state if its active eventset is a subset of the
01853      * union of the YC- and the UP-Alphabet.
01854      * The assignment of HioStateFlags is complete only if IsHioControllerForm() returns true.
01855      * Method: all conditions in the formal I/O-controller form definition are checked
01856      * individually. If crucial conditions are violated, the test of remaining
01857      * conditions is omitted.
01858      *
01859      * @param rHioController
01860      *   HioController to check, HioStateFlags are set
01861      * @param rReportStr
01862      *   Information about test results
01863      * @return
01864      *   true if rHioController is in I/O-controller form
01865      */
01866 bool IsHioControllerForm(HioController& rHioController,std::string& rReportStr);
01867 
01868 /**
01869      * IsHioControllerForm: check if rHioController is in I/O-controller form and assign state
01870      * attributes.
01871      * This function tests if rHioController meets the I/O-controller form that has been formally
01872      * defined by S.Perk. If so, then the alphabet of and the language marked by
01873      * rHioController formally describe an I/O controller. During the test, the HioStateFlags are
01874      * set according to the active event set or the respective state, for example:
01875      * The QYcUp flag is assigned to a state if its active eventset is a subset of the
01876      * union of the YC- and the UP-Alphabet.
01877      * The assignment of HioStateFlags is complete only if IsHioControllerForm() returns true.
01878      * Method: all conditions of the formal I/O-controller form definition are checked
01879      * individually. If crucial conditions are violated, the test of remaining
01880      * conditions is omitted.
01881      *
01882      * @param rHioController
01883      *   HioController to check, HioStateFlags are set
01884      * @return
01885      *   true if rHioController is in I/O-controller form
01886      */
01887 bool IsHioControllerForm(HioController& rHioController);
01888 
01889 /**
01890  * Function definition for run-time interface 
01891  *
01892  * @param rController
01893  *   HioController
01894  */  
01895 void HioStatePartition(HioController& rController);
01896 
01897 
01898 } // namespace faudes
01899 
01900 #endif

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen