libFAUDES

Sections

Index

ios_system.h

Go to the documentation of this file.
00001 /** @file ios_system.h Generator with I/O-system attributes */
00002 
00003 /* 
00004    Standart IO Systems Plug-In for FAU Discrete Event Systems 
00005    Library (libfaudes)
00006 
00007    Copyright (C) 2010, Thomas Wittmann, Thomas Moor
00008 
00009 */
00010 
00011 #ifndef FAUDES_IOS_SYSTEM_H
00012 #define FAUDES_IOS_SYSTEM_H
00013 
00014 #include "corefaudes.h"       
00015 #include "ios_attributes.h"
00016 
00017 namespace faudes {
00018 
00019 
00020 /**
00021  * Generator with I/O-system attributes. 
00022  *
00023  * An IoSystem is a generator with attributes for the
00024  * representation of I/O systems, i.e., systems with alternating
00025  * input events U and output events Y. 
00026  *
00027  * The IoSystem template assumes that the StateAttr and EventAttr parameter is
00028  * derived from AttributeIosState and AttributeIosEvent, respectively.
00029  *
00030  * @ingroup IoSysPlugin 
00031  */
00032 
00033 template <class GlobalAttr,class StateAttr,class EventAttr,class TransAttr>
00034   class TIoSystem : public TaGenerator<GlobalAttr,StateAttr,EventAttr,TransAttr>  {    
00035 
00036  public:
00037 
00038     /** @name Constructors & Destructor */
00039     /** @{ doxygen group */
00040 
00041     /**
00042      * Default constructor  
00043      */
00044     TIoSystem(void);
00045 
00046     /**
00047      * Default destructor
00048      */
00049     ~TIoSystem(void);
00050 
00051     /**
00052      * Construtor 
00053      *
00054      * Create IoSystem from file 
00055      *
00056      * @param rFileName
00057      *   Filename
00058      *
00059      * @exception Exception
00060      *   - File io error (id 1)
00061      *   - Token mismatch (id 50, 51, ...)
00062      */
00063     TIoSystem(const std::string& rFileName);
00064 
00065     /**
00066      * Constructor 
00067      *
00068      * Create IoSystem on heap
00069      *
00070      * @return 
00071      *   new Generator 
00072      */
00073     virtual TIoSystem* New(void) const;
00074 
00075 
00076     /** 
00077      * Copy constructor 
00078      *
00079      * Create IoSystem from a std. Generator
00080      *
00081      * @param rOtherGen
00082      */
00083     TIoSystem(const Generator& rOtherGen);
00084 
00085 
00086     /** 
00087      * Copy constructor 
00088      *
00089      * Create IoSystem from another IoSystem
00090      *
00091      * @param rOtherGen
00092      */
00093     TIoSystem(const TIoSystem& rOtherGen);
00094 
00095     
00096     /**
00097      * Copy Constructor
00098      *
00099      * Construct copy on heap
00100      *
00101      * @return 
00102      *   new Generator 
00103      */
00104     virtual TIoSystem* Copy(void) const;
00105 
00106 
00107     /**
00108      * Create empty IoSystem with same symboltable as this
00109      *
00110      * @return
00111      *   New Generator
00112      */
00113     TIoSystem NewIoSystem(void) const;
00114 
00115 
00116     /** @} */
00117 
00118     /** @name Assignment */
00119     /** @{ doxygen group */
00120 
00121 
00122     /**
00123      * Assignment operator 
00124      *
00125      * Note: you must reimplement this operator in derived 
00126      * classes in order to handle internal pointers correctly
00127      *
00128      * @param rOtherGen
00129      *   Other generator
00130      */
00131     virtual TIoSystem& operator= (const TIoSystem& rOtherGen) {
00132       this->Assign(rOtherGen); 
00133       return *this;
00134     };
00135 
00136     /**
00137      * Assignment operator 
00138      *
00139      * @param rOtherGen
00140      *   Other generator
00141      */
00142     virtual TIoSystem& operator= (const vGenerator& rOtherGen) 
00143       {
00144   this->Assign(rOtherGen); 
00145   return *this;
00146       };
00147     
00148 
00149     /** @} */
00150 
00151     /** @name Insertion with attributes */
00152     /** @{ doxygen group */
00153 
00154 
00155     /**
00156      * Insert an output-event by index
00157      * 
00158      * An entry in the global event table will be made.
00159      *
00160      * Note: event has to exist in the global event table
00161      *
00162      * @param index
00163      *   Event index
00164      */
00165     void InsOutputEvent(Idx index);
00166 
00167     /**
00168      * Insert output event by name.
00169      *
00170      * An entry in the global event table will be made if event is new.
00171      *
00172      * @param rName
00173      *   Name of the event to add
00174      *
00175      * @return 
00176      *   New global unique index
00177      */
00178     Idx InsOutputEvent(const std::string& rName);
00179     
00180     /**
00181      * Insert a input event by index.
00182      *
00183      * Note: event must to exist in the global event table
00184      *
00185      * @param index
00186      *   Event index
00187      */
00188     void InsInputEvent(Idx index);
00189 
00190 
00191     /**
00192      * Insert input event by name.
00193      *
00194      * An entry in the global event table will be made if event is new.
00195      *
00196      * @param rName
00197      *   Name of the event to add
00198      *
00199      * @return 
00200      *   New global unique index
00201      */
00202     Idx InsInputEvent(const std::string& rName);
00203         
00204 
00205     /** @} */
00206 
00207     /** @name Event attributes  */
00208     /** @{ doxygen group */
00209 
00210     /**
00211      * Retrieve all output events
00212      *
00213      * @return
00214      *   Set of all output events
00215      */
00216     EventSet OutputEvents(void) const;
00217     
00218     /**
00219      * Set all output events.
00220      *
00221      * Mark given events as output events, unmark
00222      * any other event.
00223      *
00224      * @parem rEventSet
00225      *   Set of all output events
00226      * @exception Exception
00227      *   - Event does ot exist in generator (id 60)
00228      */
00229     void OutputEvents(const EventSet& rEventSet);
00230     
00231     /**
00232      * Test for output event
00233      *
00234      * @param index
00235      *   Event index
00236      * @return
00237      *   True / false
00238      * @exception Exception
00239      *   - Event does ot exist in generator(id 60)
00240      */
00241     bool OutputEvent(Idx index) const;
00242 
00243     /**
00244      * Test for output event
00245      *
00246      * @param rName
00247      *   Event name
00248      * @return
00249      *   True / false
00250      * @exception Exception
00251      *   - Event does ot exist in generator (id 60)
00252      */
00253     bool OutputEvent(const std::string& rName) const;
00254     
00255     /**
00256      * Mark event as output event 
00257      *
00258      * @param index
00259      *   Event index
00260      * @exception Exception
00261      *   - Event does ot exist in generator (id 60)
00262      */
00263     void SetOutputEvent(Idx index);
00264 
00265     /**
00266      * Mark event as output event 
00267      *
00268      * @param rName
00269      *   Event name
00270      * @exception Exception
00271      *   - Event does ot exist in generator (id 60)
00272      */
00273     void SetOutputEvent(const std::string& rName);
00274 
00275     /**
00276      * Mark event as output events 
00277      *
00278      * @param rEventSet
00279      *   Set of events to mark
00280      * @exception Exception
00281      *   - Some event does ot exist in generator (id 60)
00282      */
00283     void SetOutputEvent(const EventSet& rEventSet);
00284 
00285     /**
00286      * Unmark event as output event 
00287      *
00288      * @param index
00289      *   Event index
00290      * @exception Exception
00291      *   - Event does ot exist in generator (id 60)
00292      */
00293     void ClrOutputEvent(Idx index);
00294 
00295     /**
00296      * Unmark event as output event 
00297      *
00298      * @param rName
00299      *   Event name
00300      * @exception Exception
00301      *   - Event does ot exist in generator (id 60)
00302      */
00303     void ClrOutputEvent(const std::string& rName);
00304 
00305     /**
00306      * Unmak events as output events 
00307      *
00308      * @param rEventSet
00309      *   Set of events to unmark
00310      * @exception Exception
00311      *   - Some event does ot exist in generator (id 60)
00312      */
00313     void ClrOutputEvent(const EventSet& rEventSet);
00314 
00315 
00316     /**
00317      * Retrieve all input events
00318      *
00319      * @return
00320      *   Set of all input events
00321      */
00322     EventSet InputEvents(void) const;
00323     
00324     /**
00325      * Set all input events.
00326      *
00327      * Mark given events as input events, unmark
00328      * any other event.
00329      *
00330      * @param rEventSet
00331      *   Set of all input events
00332      * @exception Exception
00333      *   - Event does ot exist in generator (id 60)
00334      */
00335     void InputEvents(const EventSet& rEventSet);
00336     
00337     /**
00338      * Test for input event
00339      *
00340      * @param index
00341      *   Event index
00342      *
00343      * @return
00344      *   True / false
00345      * @exception Exception
00346      *   - Event not found in alphabet (id 60)
00347      */
00348     bool InputEvent(Idx index) const;
00349 
00350     /**
00351      * Test for input event
00352      *
00353      * @param rName
00354      *   Event name
00355      *
00356      * @return
00357      *   True / false
00358      * @exception Exception
00359      *   - Event not found in alphabet (id 60)
00360      */
00361     bool InputEvent(const std::string& rName) const;
00362     
00363     /**
00364      * Mark event as input event 
00365      *
00366      * @param index
00367      *   Event index
00368      * @exception Exception
00369      *   - Event not found in alphabet (id 60)
00370      */
00371     void SetInputEvent(Idx index);
00372 
00373     /**
00374      * Mark event as input event 
00375      *
00376      * @param rName
00377      *   Event name
00378      * @exception Exception
00379      *   - Event not found in alphabet (id 60)
00380      */
00381     void SetInputEvent(const std::string& rName);
00382 
00383     /**
00384      * Mark event as input events 
00385      *
00386      * @param rEventSet
00387      *   Set of events to mark
00388      * @exception Exception
00389      *   - Some event not found in alphabet (id 60)
00390      */
00391     void SetInputEvent(const EventSet& rEventSet);
00392 
00393     /**
00394      * Unmark event as input event 
00395      *
00396      * @param index
00397      *   Event index
00398      * @exception Exception
00399      *   - Event not found in alphabet (id 60)
00400      */
00401     void ClrInputEvent(Idx index);
00402 
00403     /**
00404      * Unmark event as input event 
00405      *
00406      * @param rName
00407      *   Event name
00408      * @exception Exception
00409      *   - Event not found in alphabet (id 60)
00410      */
00411     void ClrInputEvent(const std::string& rName);
00412 
00413     /**
00414      * Unmak events as input events 
00415      *
00416      * @param rEventSet
00417      *   Set of events to unmark
00418      * @exception Exception
00419      *   - Some event not found in alphabet (id 60)
00420      */
00421     void ClrInputEvent(const EventSet& rEventSet);
00422 
00423 
00424     /** @} */
00425 
00426     /** @name State attributes  */
00427     /** @{ doxygen group */
00428 
00429     /**
00430      * Retrieve all output states
00431      *
00432      * @return
00433      *   Set of all output states
00434      */
00435     StateSet OutputStates(void) const;
00436     
00437     /**
00438      * Set all output states.
00439      *
00440      * Mark given states as output states, unmark
00441      * any other state.
00442      *
00443      * @param rStateSet
00444      *   Set of all output states
00445      * @exception Exception
00446      *   - State does ot exist in generator (id 60)
00447      */
00448     void OutputStates(const StateSet& rStateSet);
00449     
00450     /**
00451      * Test for output state
00452      *
00453      * @param index
00454      *   State index
00455      * @return
00456      *   True / false
00457      * @exception Exception
00458      *   - State does ot exist in generator(id 60)
00459      */
00460     bool OutputState(Idx index) const;
00461 
00462     /**
00463      * Test for output state
00464      *
00465      * @param rName
00466      *   State name
00467      * @return
00468      *   True / false
00469      * @exception Exception
00470      *   - State does ot exist in generator (id 60)
00471      */
00472     bool OutputState(const std::string& rName) const;
00473     
00474     /**
00475      * Mark state as output state 
00476      *
00477      * @param index
00478      *   State index
00479      * @exception Exception
00480      *   - State does ot exist in generator (id 60)
00481      */
00482     void SetOutputState(Idx index);
00483 
00484     /**
00485      * Mark state as output state 
00486      *
00487      * @param rName
00488      *   State name
00489      * @exception Exception
00490      *   - State does ot exist in generator (id 60)
00491      */
00492     void SetOutputState(const std::string& rName);
00493 
00494     /**
00495      * Mark state as output states 
00496      *
00497      * @param rStateSet
00498      *   Set of states to mark
00499      * @exception Exception
00500      *   - Some state does ot exist in generator (id 60)
00501      */
00502     void SetOutputState(const StateSet& rStateSet);
00503 
00504     /**
00505      * Unmark state as output state 
00506      *
00507      * @param index
00508      *   State index
00509      * @exception Exception
00510      *   - State does ot exist in generator (id 60)
00511      */
00512     void ClrOutputState(Idx index);
00513 
00514     /**
00515      * Unmark state as output state 
00516      *
00517      * @param rName
00518      *   State name
00519      * @exception Exception
00520      *   - State does ot exist in generator (id 60)
00521      */
00522     void ClrOutputState(const std::string& rName);
00523 
00524     /**
00525      * Unmak states as output states 
00526      *
00527      * @param rStateSet
00528      *   Set of states to unmark
00529      * @exception Exception
00530      *   - Some state does ot exist in generator (id 60)
00531      */
00532     void ClrOutputState(const StateSet& rStateSet);
00533 
00534 
00535     /**
00536      * Retrieve all input states
00537      *
00538      * @return
00539      *   Set of all input states
00540      */
00541     StateSet InputStates(void) const;
00542     
00543     /**
00544      * Set all input states.
00545      *
00546      * Mark given states as input states, unmark
00547      * any other state.
00548      *
00549      * @param rStateSet
00550      *   Set of all input states
00551      * @exception Exception
00552      *   - State does ot exist in generator (id 60)
00553      */
00554     void InputStates(const StateSet& rStateSet);
00555     
00556     /**
00557      * Test for input state
00558      *
00559      * @param index
00560      *   State index
00561      *
00562      * @return
00563      *   True / false
00564      * @exception Exception
00565      *   - State not found in alphabet (id 60)
00566      */
00567     bool InputState(Idx index) const;
00568 
00569     /**
00570      * Test for input state
00571      *
00572      * @param rName
00573      *   State name
00574      *
00575      * @return
00576      *   True / false
00577      * @exception Exception
00578      *   - State not found in alphabet (id 60)
00579      */
00580     bool InputState(const std::string& rName) const;
00581     
00582     /**
00583      * Mark state as input state 
00584      *
00585      * @param index
00586      *   State index
00587      * @exception Exception
00588      *   - State not found in alphabet (id 60)
00589      */
00590     void SetInputState(Idx index);
00591 
00592     /**
00593      * Mark state as input state 
00594      *
00595      * @param rName
00596      *   State name
00597      * @exception Exception
00598      *   - State not found in alphabet (id 60)
00599      */
00600     void SetInputState(const std::string& rName);
00601 
00602     /**
00603      * Mark state as input states 
00604      *
00605      * @param rStateSet
00606      *   Set of states to mark
00607      * @exception Exception
00608      *   - Some state not found in alphabet (id 60)
00609      */
00610     void SetInputState(const StateSet& rStateSet);
00611 
00612     /**
00613      * Unmark state as input state 
00614      *
00615      * @param index
00616      *   State index
00617      * @exception Exception
00618      *   - State not found in alphabet (id 60)
00619      */
00620     void ClrInputState(Idx index);
00621 
00622     /**
00623      * Unmark state as input state 
00624      *
00625      * @param rName
00626      *   State name
00627      * @exception Exception
00628      *   - State not found in alphabet (id 60)
00629      */
00630     void ClrInputState(const std::string& rName);
00631 
00632     /**
00633      * Unmak states as input states 
00634      *
00635      * @param rStateSet
00636      *   Set of states to unmark
00637      * @exception Exception
00638      *   - Some state not found in alphabet (id 60)
00639      */
00640     void ClrInputState(const StateSet& rStateSet);
00641 
00642 
00643     /**
00644      * Retrieve all error states
00645      *
00646      * @return
00647      *   Set of all error states
00648      */
00649     StateSet ErrorStates(void) const;
00650     
00651     /**
00652      * Set all error states.
00653      *
00654      * Mark given states as error states, unmark
00655      * any other state.
00656      *
00657      * @param rStateSet
00658      *   Set of all error states
00659      * @exception Exception
00660      *   - State does ot exist in generator (id 60)
00661      */
00662     void ErrorStates(const StateSet& rStateSet);
00663     
00664     /**
00665      * Test for error state
00666      *
00667      * @param index
00668      *   State index
00669      * @return
00670      *   True / false
00671      * @exception Exception
00672      *   - State does ot exist in generator(id 60)
00673      */
00674     bool ErrorState(Idx index) const;
00675 
00676     /**
00677      * Test for error state
00678      *
00679      * @param rName
00680      *   State name
00681      * @return
00682      *   True / false
00683      * @exception Exception
00684      *   - State does ot exist in generator (id 60)
00685      */
00686     bool ErrorState(const std::string& rName) const;
00687     
00688     /**
00689      * Mark state as error state 
00690      *
00691      * @param index
00692      *   State index
00693      * @exception Exception
00694      *   - State does ot exist in generator (id 60)
00695      */
00696     void SetErrorState(Idx index);
00697 
00698     /**
00699      * Mark state as error state 
00700      *
00701      * @param rName
00702      *   State name
00703      * @exception Exception
00704      *   - State does ot exist in generator (id 60)
00705      */
00706     void SetErrorState(const std::string& rName);
00707 
00708     /**
00709      * Mark state as error states 
00710      *
00711      * @param rStateSet
00712      *   Set of states to mark
00713      * @exception Exception
00714      *   - Some state does ot exist in generator (id 60)
00715      */
00716     void SetErrorState(const StateSet& rStateSet);
00717 
00718     /**
00719      * Unmark state as error state 
00720      *
00721      * @param index
00722      *   State index
00723      * @exception Exception
00724      *   - State does ot exist in generator (id 60)
00725      */
00726     void ClrErrorState(Idx index);
00727 
00728     /**
00729      * Unmark state as error state 
00730      *
00731      * @param rName
00732      *   State name
00733      * @exception Exception
00734      *   - State does ot exist in generator (id 60)
00735      */
00736     void ClrErrorState(const std::string& rName);
00737 
00738     /**
00739      * Unmak states as error states 
00740      *
00741      * @param rStateSet
00742      *   Set of states to unmark
00743      * @exception Exception
00744      *   - Some state does ot exist in generator (id 60)
00745      */
00746     void ClrErrorState(const StateSet& rStateSet);
00747 
00748 
00749 
00750     /** @} */
00751 
00752     /** @name Misc  */
00753     /** @{ doxygen group */
00754 
00755     /**
00756      * Updates internal attributes. 
00757      * This method sets the state partition attributes.
00758      * 
00759      * @return True if value changed
00760      */
00761    
00762     virtual bool UpdateAttributes(void);
00763 
00764     /** @} */
00765  private:
00766 
00767  protected:
00768 
00769 }; // end class IoSystem
00770 
00771 
00772 /*
00773 **********************************************************************
00774 **********************************************************************
00775 **********************************************************************
00776 
00777 implementation of IoSystem
00778 
00779 
00780 **********************************************************************
00781 **********************************************************************
00782 **********************************************************************
00783 */  
00784  
00785 
00786 // typedef for std IoSystem
00787     
00788 //   globalAttribute: Void
00789 //   stateAttribute:  IosStateFlags
00790 //   eventAttribute:  IosEventFlags
00791 //   transAttribute:  Void
00792 typedef TIoSystem<AttributeVoid,AttributeIosState, AttributeIosEvent, AttributeVoid> IoSystem;
00793 
00794 // convenience shortcuts for relevant class and template types 
00795 #define THIS TIoSystem<GlobalAttr,StateAttr,EventAttr,TransAttr>
00796 #define BASE TaGenerator<GlobalAttr,StateAttr,EventAttr,TransAttr>
00797 #define TEMP template <class GlobalAttr,class StateAttr,class EventAttr,class TransAttr>
00798 
00799 
00800 // TIoSystem(void)
00801 TEMP THIS::TIoSystem(void) : BASE() {
00802   //FD_DIO("IoSystem(" << this << ")::IoSystem()");
00803 }
00804 
00805 // ~TIOSystem(void)
00806 TEMP THIS::~TIoSystem(void) {
00807   //FD_DIO("IoSystem(" << this << "::~IoSystem()");
00808 }
00809 
00810 // TIoSystem(rFileName)
00811 TEMP THIS::TIoSystem(const std::string& rFileName) : BASE(rFileName) {
00812   //FD_DIO("IoSystem(" << this << ")::IoSystem(rFilename) : done");
00813 }
00814 
00815 
00816 // TIoSystem(rOtherGen)
00817 TEMP THIS::TIoSystem(const TIoSystem& rOtherGen) : BASE(rOtherGen) {
00818   //FD_DIO("IoSystem(" << this << ")::IoSystem(rOtherGen)");
00819 }
00820 
00821 // TIoSystem(rOtherGen)
00822 TEMP THIS::TIoSystem(const Generator& rOtherGen) : BASE(rOtherGen) {
00823   //FD_DIO("IoSystem(" << this << ")::IoSystem(rOtherGen)");
00824 }
00825 
00826 // New()
00827 TEMP THIS* THIS::New(void) const {
00828   //FD_DIO("IoSystem(" << this << ")::New()");
00829   // allocate
00830   THIS* res = new THIS();
00831   // fix base data
00832   res->EventSymbolTablep(BASE::mpEventSymbolTable);
00833   res->mStateNamesEnabled=BASE::mStateNamesEnabled;
00834   return res;
00835 }
00836 
00837 // Copy()
00838 TEMP THIS* THIS::Copy(void) const {
00839   return new THIS(*this);
00840 }
00841 
00842 // NewIoSystem()
00843 TEMP THIS THIS::NewIoSystem(void) const {
00844   // call base (fixes by assignment constructor)
00845   THIS res= BASE::NewAGen();
00846   return res;
00847 }
00848 
00849 // InsOutputEvent(index)
00850 TEMP void THIS::InsOutputEvent(Idx index){
00851   FD_DIO("IoSystem(" << this << ")::InsOutputEvent(" << index << ")");
00852   EventAttr attr;
00853   attr.SetOutput();   
00854   BASE::InsEvent(index,attr);
00855 }
00856 
00857 // InsOutputEvent(rName)
00858 TEMP Idx THIS::InsOutputEvent(const std::string& rName) {
00859   //FD_DIO("IoSystem(" << this << ")::InsOutputEvent(" << rName << ")");
00860   EventAttr attr;
00861   attr.SetOutput();
00862   return BASE::InsEvent(rName,attr);
00863 } 
00864 
00865 // InsInputEvent(index)
00866 TEMP void THIS::InsInputEvent(Idx index){
00867   //FD_DIO("IoSystem(" << this << ")::InsInputEvent(" << index << ")");
00868   EventAttr attr;
00869   attr.SetInput();   
00870   BASE::InsEvent(index,attr);
00871 }
00872 
00873 // InsInputEvent(rName)
00874 TEMP Idx THIS::InsInputEvent(const std::string& rName) {
00875   //FD_DIO("IoSystem(" << this << ")::InsInputEvent(" << rName << ")");
00876   EventAttr attr;
00877   attr.SetInput();
00878   return BASE::InsEvent(rName,attr);
00879 } 
00880 
00881 
00882 
00883 // OutputEvents()
00884 TEMP EventSet THIS::OutputEvents(void) const {
00885   //FD_DIO("IoSystem(" << this << ")::OutputEvents()");
00886   EventSet res;
00887   res.Name("OutputEvents");
00888   EventSet::Iterator eit;
00889   for(eit=BASE::AlphabetBegin(); eit!=BASE::AlphabetEnd(); eit++) 
00890     if(OutputEvent(*eit)) res.Insert(*eit);
00891   return res;
00892 }
00893 
00894 // OutputEvents(rEventSet)
00895 TEMP void THIS::OutputEvents(const EventSet& rEventSet) {
00896   //FD_DIO("IoSystem(" << this << ")::OutputEvents(" << rEventSet.Name() << ")");
00897   EventSet::Iterator eit;
00898   for(eit=BASE::AlphabetBegin(); eit!=BASE::AlphabetEnd(); eit++) 
00899     if(rEventSet.Exists(*eit)) SetOutputEvent(*eit);
00900     else ClrOutputEvent(*eit);
00901 }
00902 
00903 // OutputEvent(index)
00904 TEMP bool THIS::OutputEvent(Idx index) const {
00905   return BASE::EventAttribute(index).Output();
00906 } 
00907 
00908 // OutputEvent(rName)
00909 TEMP bool THIS::OutputEvent(const std::string& rName) const {
00910   return BASE::EventAttribute(rName).Output();
00911 } 
00912 
00913 // SetOutputEvent(index)
00914 TEMP void THIS::SetOutputEvent(Idx index) {
00915   //FD_DIO("IoSystem(" << this << ")::SetOutputEvent(" << index << ")");   
00916   EventAttr attr=BASE::EventAttribute(index);
00917   attr.SetOutput();
00918   BASE::pAlphabet->Attribute(index,attr);
00919 } 
00920 
00921 // SetOutputEvent(rName)
00922 TEMP void THIS::SetOutputEvent(const std::string& rName) {
00923   //FD_DIO("IoSystem(" << this << ")::SetOutputEvent(" << rName << ")");
00924   Idx index = BASE::EventIndex(rName);
00925   SetOutputEvent(index);
00926 }
00927 
00928 // SetOutputEvent(rEventSet)
00929 TEMP void THIS::SetOutputEvent(const EventSet& rEventSet) {
00930   //FD_DIO("IoSystem(" << this << ")::SetOutputEvent(" << rEventSet.Name() << ")");
00931   for(EventSet::Iterator eit=rEventSet.Begin(); eit!=rEventSet.End(); eit++) 
00932     SetOutputEvent(*eit);
00933 }
00934 
00935 
00936 // ClrOutputEvent(index)
00937 TEMP void THIS::ClrOutputEvent(Idx index) {
00938   //FD_DIO("IoSystem(" << this << ")::ClrOutputEvent(" << index << ")");   
00939   EventAttr attr=BASE::EventAttribute(index);
00940   attr.ClrOutput();
00941   BASE::pAlphabet->Attribute(index,attr);
00942 } 
00943 
00944 // ClrOutputEvent(rName)
00945 TEMP void THIS::ClrOutputEvent(const std::string& rName) {
00946   //FD_DIO("IoSystem(" << this << ")::ClrOutputEvent(" << rName << ")");
00947   Idx index = BASE::EventIndex(rName);
00948   ClrOutputEvent(index);
00949 }
00950 
00951 // ClrOutputEvent(rEventSet)
00952 TEMP void THIS::ClrOutputEvent(const EventSet& rEventSet) {
00953   //FD_DIO("IoSystem(" << this << ")::ClrOutputEvent(" << rEventSet.Name() << ")");
00954   for(EventSet::Iterator eit=rEventSet.Begin(); eit!=rEventSet.End(); eit++) 
00955     ClrOutputEvent(*eit);
00956 }
00957 
00958 
00959 // InputEvents()
00960 TEMP EventSet THIS::InputEvents(void) const {
00961   //FD_DIO("IoSystem(" << this << ")::InputEvents()");
00962   EventSet res;
00963   res.Name("InputEvents");
00964   EventSet::Iterator eit;
00965   for(eit=BASE::AlphabetBegin(); eit!=BASE::AlphabetEnd(); eit++) 
00966     if(InputEvent(*eit)) res.Insert(*eit);
00967   return res;
00968 }
00969 
00970 // InputEvents(rEventSet)
00971 TEMP void THIS::InputEvents(const EventSet& rEventSet) {
00972   //FD_DIO("IoSystem(" << this << ")::InputEvents(" << rEventSet.Name() << ")");
00973   EventSet::Iterator eit;
00974   for(eit=BASE::AlphabetBegin(); eit!=BASE::AlphabetEnd(); eit++) 
00975     if(rEventSet.Exists(*eit)) SetInputEvent(*eit);
00976     else ClrInputEvent(*eit);
00977 }
00978 
00979 
00980 // InputEvent(index)
00981 TEMP bool THIS::InputEvent(Idx index) const {
00982   return BASE::EventAttribute(index).Input();
00983 } 
00984 
00985 // InputEvent(rName)
00986 TEMP bool THIS::InputEvent(const std::string& rName) const {
00987   return BASE::EventAttribute(rName).Input();
00988 } 
00989 
00990 // SetInputEvent(index)
00991 TEMP void THIS::SetInputEvent(Idx index) {
00992   //FD_DIO("IoSystem(" << this << ")::SetInputEvent(" << index << ")");   
00993   EventAttr attr=BASE::EventAttribute(index);
00994   attr.SetInput();
00995   BASE::pAlphabet->Attribute(index,attr);
00996 } 
00997 
00998 // SetInputEvent(rName)
00999 TEMP void THIS::SetInputEvent(const std::string& rName) {
01000   //FD_DIO("IoSystem(" << this << ")::SetInputEvent(" << rName << ")");
01001   Idx index = BASE::EventIndex(rName);
01002   SetInputEvent(index);
01003 }
01004 
01005 // SetInputEvent(rEventSet)
01006 TEMP void THIS::SetInputEvent(const EventSet& rEventSet) {
01007   //FD_DIO("IoSystem(" << this << ")::SetInputEvent(" << rEventSet.Name() << ")");
01008   for(EventSet::Iterator eit=rEventSet.Begin(); eit!=rEventSet.End(); eit++) 
01009     SetInputEvent(*eit);
01010 }
01011 
01012 
01013 // ClrInputEvent(index)
01014 TEMP void THIS::ClrInputEvent(Idx index) {
01015   //FD_DIO("IoSystem(" << this << ")::ClrInputEvent(" << index << ")");   
01016   EventAttr attr=BASE::EventAttribute(index);
01017   attr.ClrInput();
01018   BASE::pAlphabet->Attribute(index,attr);
01019 } 
01020 
01021 // ClrInputEvent(rName)
01022 TEMP void THIS::ClrInputEvent(const std::string& rName) {
01023   //FD_DIO("IoSystem(" << this << ")::ClrInputEvent(" << rName << ")");
01024   Idx index = BASE::EventIndex(rName);
01025   ClrInputEvent(index);
01026 }
01027 
01028 // ClrInputEvent(rEventSet)
01029 TEMP void THIS::ClrInputEvent(const EventSet& rEventSet) {
01030   //FD_DIO("IoSystem(" << this << ")::ClrInputEvent(" << rEventSet.Name() << ")");
01031   for(EventSet::Iterator eit=rEventSet.Begin(); eit!=rEventSet.End(); eit++) 
01032     ClrInputEvent(*eit);
01033 }
01034 
01035 
01036 // OutputStates()
01037 TEMP StateSet THIS::OutputStates(void) const {
01038   //FD_DIO("IoSystem(" << this << ")::OutputStates()");
01039   StateSet res;
01040   res.Name("OutputStates");
01041   StateSet::Iterator sit;
01042   for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) 
01043     if(OutputState(*sit)) res.Insert(*sit);
01044   return res;
01045 }
01046 
01047 // OutputStates(rStateSet)
01048 TEMP void THIS::OutputStates(const StateSet& rStateSet) {
01049   FD_DIO("IoSystem(" << this << ")::OutputStates(" << rStateSet.Name() << ")");
01050   StateSet::Iterator sit;
01051   for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) 
01052     if(rStateSet.Exists(*sit)) SetOutputState(*sit);
01053     else ClrOutputState(*sit);
01054 }
01055 
01056 // OutputState(index)
01057 TEMP bool THIS::OutputState(Idx index) const {
01058   return BASE::StateAttribute(index).Output();
01059 } 
01060 
01061 // OutputState(rName)
01062 TEMP bool THIS::OutputState(const std::string& rName) const {
01063   Idx index = BASE::StateIndex(rName);
01064   return BASE::StateAttribute(index).Output();
01065 } 
01066 
01067 // SetOutputState(index)
01068 TEMP void THIS::SetOutputState(Idx index) {
01069   //FD_DIO("IoSystem(" << this << ")::SetOutputState(" << index << ")");   
01070   StateAttr attr=BASE::StateAttribute(index);
01071   attr.SetOutput();
01072   BASE::pStates->Attribute(index,attr);
01073 } 
01074 
01075 // SetOutputState(rName)
01076 TEMP void THIS::SetOutputState(const std::string& rName) {
01077   //FD_DIO("IoSystem(" << this << ")::SetOutputState(" << rName << ")");
01078   Idx index = BASE::StateIndex(rName);
01079   SetOutputState(index);
01080 }
01081 
01082 // SetOutputState(rStateSet)
01083 TEMP void THIS::SetOutputState(const StateSet& rStateSet) {
01084   //FD_DIO("IoSystem(" << this << ")::SetOutputState(" << rStateSet.Name() << ")");
01085   for(StateSet::Iterator eit=rStateSet.Begin(); eit!=rStateSet.End(); eit++) 
01086     SetOutputState(*eit);
01087 }
01088 
01089 
01090 // ClrOutputState(index)
01091 TEMP void THIS::ClrOutputState(Idx index) {
01092   //FD_DIO("IoSystem(" << this << ")::ClrOutputState(" << index << ")");   
01093   StateAttr attr=BASE::StateAttribute(index);
01094   attr.ClrOutput();
01095   BASE::pStates->Attribute(index,attr);
01096 } 
01097 
01098 // ClrOutputStateLRName)
01099 TEMP void THIS::ClrOutputState(const std::string& rName) {
01100   //FD_DIO("IoSystem(" << this << ")::ClrOutputState(" << rName << ")");
01101   Idx index = BASE::StateIndex(rName);
01102   ClrOutputState(index);
01103 }
01104 
01105 // ClrOutputState(rStateSet)
01106 TEMP void THIS::ClrOutputState(const StateSet& rStateSet) {
01107   //FD_DIO("IoSystem(" << this << ")::ClrOutputState(" << rStateSet.Name() << ")");
01108   for(StateSet::Iterator sit=rStateSet.Begin(); sit!=rStateSet.End(); sit++) 
01109     ClrOutputState(*sit);
01110 }
01111 
01112 
01113 // InputStates()
01114 TEMP StateSet THIS::InputStates(void) const {
01115   //FD_DIO("IoSystem(" << this << ")::InputStates()");
01116   StateSet res;
01117   res.Name("InputStates");
01118   StateSet::Iterator sit;
01119   for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) 
01120     if(InputState(*sit)) res.Insert(*sit);
01121   return res;
01122 }
01123 
01124 // InputStates(rStateSet)
01125 TEMP void THIS::InputStates(const StateSet& rStateSet) {
01126   //FD_DIO("IoSystem(" << this << ")::InputStates(" << rStateSet.Name() << ")");
01127   StateSet::Iterator sit;
01128   for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) 
01129     if(rStateSet.Exists(*sit)) SetInputState(*sit);
01130     else ClrInputState(*sit);
01131 }
01132 
01133 // InputState(index)
01134 TEMP bool THIS::InputState(Idx index) const {
01135   return BASE::StateAttribute(index).Input();
01136 } 
01137 
01138 // InputState(rName)
01139 TEMP bool THIS::InputState(const std::string& rName) const {
01140   Idx index = BASE::StateIndex(rName);
01141   return BASE::StateAttribute(index).Input();
01142 } 
01143 
01144 // SetInputState(index)
01145 TEMP void THIS::SetInputState(Idx index) {
01146   //FD_DIO("IoSystem(" << this << ")::SetInputState(" << index << ")");   
01147   StateAttr attr=BASE::StateAttribute(index);
01148   attr.SetInput();
01149   BASE::pStates->Attribute(index,attr);
01150 } 
01151 
01152 // SetInputState(rName)
01153 TEMP void THIS::SetInputState(const std::string& rName) {
01154   //FD_DIO("IoSystem(" << this << ")::SetInputState(" << rName << ")");
01155   Idx index = BASE::StateIndex(rName);
01156   SetInputState(index);
01157 }
01158 
01159 // SetInputState(rStateSet)
01160 TEMP void THIS::SetInputState(const StateSet& rStateSet) {
01161   //FD_DIO("IoSystem(" << this << ")::SetInputState(" << rStateSet.Name() << ")");
01162   for(StateSet::Iterator sit=rStateSet.Begin(); sit!=rStateSet.End(); sit++) 
01163     SetInputState(*sit);
01164 }
01165 
01166 
01167 // ClrInputState(index)
01168 TEMP void THIS::ClrInputState(Idx index) {
01169   //FD_DIO("IoSystem(" << this << ")::ClrInputState(" << index << ")");   
01170   StateAttr attr=BASE::StateAttribute(index);
01171   attr.ClrInput();
01172   BASE::pStates->Attribute(index,attr);
01173 } 
01174 
01175 // ClrInputState(rName)
01176 TEMP void THIS::ClrInputState(const std::string& rName) {
01177   //FD_DIO("IoSystem(" << this << ")::ClrInputState(" << rName << ")");
01178   Idx index = BASE::StateIndex(rName);
01179   ClrInputState(index);
01180 }
01181 
01182 // ClrInputState(rStateSet)
01183 TEMP void THIS::ClrInputState(const StateSet& rStateSet) {
01184   //FD_DIO("IoSystem(" << this << ")::ClrInputState(" << rStateSet.Name() << ")");
01185   for(StateSet::Iterator sit=rStateSet.Begin(); sit!=rStateSet.End(); sit++) 
01186     ClrInputState(*sit);
01187 }
01188 
01189 
01190 
01191 
01192 // ErrorStates()
01193 TEMP StateSet THIS::ErrorStates(void) const {
01194   //FD_DIO("IoSystem(" << this << ")::ErrorStates()");
01195   StateSet res;
01196   res.Name("ErrorStates");
01197   StateSet::Iterator sit;
01198   for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) 
01199     if(ErrorState(*sit)) res.Insert(*sit);
01200   return res;
01201 }
01202 
01203 // ErrorStates(rStateSet)
01204 TEMP void THIS::ErrorStates(const StateSet& rStateSet) {
01205   //FD_DIO("IoSystem(" << this << ")::ErrorStates(" << rStateSet.Name() << ")");
01206   StateSet::Iterator sit;
01207   for(sit=BASE::StatesBegin(); sit!=BASE::StatesEnd(); sit++) 
01208     if(rStateSet.Exists(*sit)) SetErrorState(*sit);
01209     else ClrErrorState(*sit);
01210 }
01211 
01212 // ErrorState(index)
01213 TEMP bool THIS::ErrorState(Idx index) const {
01214   return BASE::StateAttribute(index).Error();
01215 } 
01216 
01217 // ErrorState(rName)
01218 TEMP bool THIS::ErrorState(const std::string& rName) const {
01219   Idx index = BASE::StateIndex(rName);
01220   return BASE::StateAttribute(index).Error();
01221 } 
01222 
01223 // SetErrorState(index)
01224 TEMP void THIS::SetErrorState(Idx index) {
01225   //FD_DIO("IoSystem(" << this << ")::SetErrorState(" << index << ")");   
01226   StateAttr attr=BASE::StateAttribute(index);
01227   attr.SetError();
01228   BASE::pStates->Attribute(index,attr);
01229 } 
01230 
01231 // SetErrorState(rName)
01232 TEMP void THIS::SetErrorState(const std::string& rName) {
01233   //FD_DIO("IoSystem(" << this << ")::SetErrorState(" << rName << ")");
01234   Idx index = BASE::StateIndex(rName);
01235   SetErrorState(index);
01236 }
01237 
01238 // SetErrorState(rStateSet)
01239 TEMP void THIS::SetErrorState(const StateSet& rStateSet) {
01240   //FD_DIO("IoSystem(" << this << ")::SetErrorState(" << rStateSet.Name() << ")");
01241   for(StateSet::Iterator sit=rStateSet.Begin(); sit!=rStateSet.End(); sit++) 
01242     SetErrorState(*sit);
01243 }
01244 
01245 
01246 // ClrErrorState(index)
01247 TEMP void THIS::ClrErrorState(Idx index) {
01248   //FD_DIO("IoSystem(" << this << ")::ClrErrorState(" << index << ")");   
01249   StateAttr attr=BASE::StateAttribute(index);
01250   attr.ClrError();
01251   BASE::pStates->Attribute(index,attr);
01252 } 
01253 
01254 // ClrErrorState(rName)
01255 TEMP void THIS::ClrErrorState(const std::string& rName) {
01256   //FD_DIO("IoSystem(" << this << ")::ClrErrorState(" << rName << ")");
01257   Idx index = BASE::StateIndex(rName);
01258   ClrErrorState(index);
01259 }
01260 
01261 // ClrErrorState(rStateSet)
01262 TEMP void THIS::ClrErrorState(const StateSet& rStateSet) {
01263   //FD_DIO("IoSystem(" << this << ")::ClrErrorState(" << rStateSet.Name() << ")");
01264   for(StateSet::Iterator sit=rStateSet.Begin(); sit!=rStateSet.End(); sit++) 
01265     ClrErrorState(*sit);
01266 }
01267 
01268 
01269 // Update faudes attributes
01270 TEMP bool THIS::UpdateAttributes(void) {
01271   //IsIoSystem(*this); 
01272  return true;
01273 }
01274 
01275     
01276 
01277 #undef TEMP
01278 #undef BASE
01279 #undef THIS
01280 
01281 
01282 } // namespace faudes
01283 
01284 #endif

libFAUDES 2.18b --- 2010-12-17 --- c++ source docu by doxygen 1.6.3