hio_plant.h

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

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