libFAUDES
Sections
Index
|
cfl_generator.hGo to the documentation of this file.00001 /** @file cfl_generator.h Class vGenerator */ 00002 00003 /* FAU Discrete Event Systems Library (libfaudes) 00004 00005 Copyright (C) 2006 Bernd Opitz 00006 Copyright (C) 2007 Thomas Moor 00007 Exclusive copyright is granted to Klaus Schmidt 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the Free Software 00021 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00022 00023 00024 #ifndef FAUDES_VGENERATOR_H 00025 #define FAUDES_VGENERATOR_H 00026 00027 #include "cfl_definitions.h" 00028 #include "cfl_exception.h" 00029 #include "cfl_types.h" 00030 #include "cfl_symboltable.h" 00031 #include "cfl_indexset.h" 00032 #include "cfl_nameset.h" 00033 #include "cfl_transset.h" 00034 #include "cfl_token.h" 00035 #include "cfl_tokenreader.h" 00036 #include "cfl_tokenwriter.h" 00037 00038 #include <map> 00039 #include <set> 00040 #include <sstream> 00041 #include <cstdlib> 00042 #include <cassert> 00043 00044 namespace faudes { 00045 00046 /** 00047 * Base class of all FAUDES generators. 00048 * 00049 * \section GeneratorMembers Overview 00050 * 00051 * The faudes::vGenerator models the plain five-tupel G = (X, Sigma, Delta, X_0, X_m) to represent 00052 * the marked language L(G) and closed language L_m(G), respectively. It provides read and write 00053 * access to core menbers, e.g. methods for inserting/deleting events, states 00054 * and transitions. 00055 * 00056 * 00057 * States, events and transitions in a generator can be addressed in three alternative methods: 00058 * 00059 * - by index, involves a search on a sorted set (efficient) 00060 * - by name, involves two searches on sorted sets (not quite so efficient) 00061 * - by iterator, involves pointer dereferencing (very efficient) 00062 * 00063 * For read access, const refererences to sets are provided. In order to allow for consistency checks, 00064 * write access is via generator methods only. When the compiletime option FAUDES_CHECKED is 00065 * defined, write methods throw an exception on inconsistent data, eg. setting an initial state 00066 * that is not an element of the state set, or introducing a transition with an event label that 00067 * is not in the alphabet. 00068 * 00069 * 00070 * \section SecEventsVersusStates Events Versus States 00071 * 00072 * While both, events and states, are represented by the integer type faudes::Idx, there 00073 * is a fundamental distinction between both, which stems from the design choice to use generators 00074 * as a tool to represent formal languages. From this perspective, events are global enteties while states 00075 * are local to the respective generator. Any two events within libFAUDES are related while states only 00076 * compare within a generator. 00077 * 00078 * In consequence, there is global sybmoltable for event name resolution, 00079 * while there is one local state symboltable for 00080 * each generator. Furthermore, state names are considered cosmetic and hence are optional, while 00081 * event names are mandatory. 00082 * 00083 * Example: two machines both refer to the event name "alpha" that models the process of passing 00084 * a workpiece from one machine to the other. In libFAUDES this is indeed modelled as one event 00085 * which is represented by one index. However, both machines may have a state "Idle" which indicates 00086 * that the respective machine is idle. In libFAUDES the two states are treated locally to the 00087 * generators and whether or not they have the same index is regarded irrelevant. 00088 * 00089 * The generator class carries a flag to indicate that functions with result type 00090 * generator shall attach names to the newly created states, based on the state names 00091 * of the respective arguments. Turning of this feature and avoiding state names alltogether 00092 * considerably increases libFAUDES performance. 00093 * 00094 * \section GeneratorFileFormat File I/O (default format) 00095 * 00096 * Generators inherit the standard token IO interface from the libFAUDES general purpose base Type, 00097 * so you may use Read and Write functions for generators. The file-format consists of a generator 00098 * section that includes one subsection for each core member. It is illustrated by the below example 00099 * 00100 * @code 00101 * <Generator> 00102 * % libFAUDES Generator for the simple machine 00103 * "simple machine" 00104 * 00105 * <Alphabet> 00106 * "alpha" "beta" "mue" "lambda" 00107 * </Alphabet> 00108 * 00109 * <States> 00110 * "idle" "busy" "down" 00111 * </States> 00112 * 00113 * <TransRel> 00114 * "idle" "alpha" "busy" 00115 * "busy" "beta" "idle" 00116 * "busy" "mue" "down" 00117 * "down" "lambda" "idle" 00118 * </TransRel> 00119 * 00120 * <InitStates> 00121 * "idle" 00122 * </InitStates> 00123 * 00124 * <MarkedStates> 00125 * "idle" 00126 * </MarkedStates> 00127 * </Generator> 00128 * @endcode 00129 * 00130 * Technical Detail: Since symbolic state names are optional, states may alternatively be represented 00131 * by their index. In order to consitently read a generator from a token stream, the convention 00132 * was introduced that states are indexed consecutively starting from 1. This convention 00133 * produces nice and human-readable output. However, it requires a re-indexing when writing 00134 * the generator. As of libFAUDES 2.20j, the token format was extended to allow for explicit 00135 * symbol table entries in the format "symbolic_state_name#index". Whether or not re-indexing 00136 * is applied can be configured via ReindexOnWrite(bool). The default is not to re-index. 00137 * If you want to read your token stream with libFAUDES pre 2.20j, you must turn 00138 * re-index on. 00139 * 00140 * \section GeneratorFileFormat File I/O (XML file-format) 00141 * 00142 * The alternative file file format prodiced by XWrite() is meant to accomodate 00143 * for additional attributes attached to states, events and transitions, including e.g. 00144 * graph data for a graphical representation. It starts with the outer element "Generator" which optionally 00145 * has a name and a type attribute. 00146 * 00147 * 00148 * @code 00149 * <Generator name="simpla machine> 00150 * <Alphabet> 00151 * <Event name="alpha"/> 00152 * <Event name="beta"/> 00153 * <Event name="mue"/> 00154 * <Event name="lambda"/> 00155 * </Alphabet> 00156 * 00157 * <StateSet> 00158 * <State name="idle" id="1"> 00159 <Marked/><Initial/> 00160 <State/> 00161 * <State name="busy" id="2"/> 00162 * <State name="down" id="3"/> 00163 * </StateSet> 00164 * 00165 * <TransitionRelation> 00166 * <Transition x1="1" event="alphs" x2="2"/> 00167 * <Transition x1="2" event="beta" x2="2"/> 00168 * <Transition x1="2" event="mue" x2="3"/> 00169 * <Transition x1="3" event="lambda" x2="1"/> 00170 * <TransitionRelation/> 00171 * 00172 * </Generator> 00173 * @endcode 00174 * 00175 * 00176 * \section GeneratorAttributes Attributes 00177 * 00178 * libFAUDES generators provide an interface to access so called attributes, ie data that 00179 * is optionally attached to individual states, events, transitions, or globally to the generator. 00180 * 00181 * The faudes::Generator's interface to attributes is abstract in the sense that a generator 00182 * is not aware of the actual type of its attributes. 00183 * Instances of the class Generator indeed have trivial attributes that hold no data at all. 00184 * To use attributes, you are meant to instantiate objects of the derived class TaGenerator 00185 * with template parameters to specify attribute types. Basic algorithms 00186 * implemented for plain generators will accept attributed generators as arguments. Such algorithms may 00187 * occasionally inspect or set attributes using the abstract interface and C++ dynamic casts. For 00188 * specialised algorithms that refer to extended generator semantics, we recommend derived 00189 * generator classes as argument type. 00190 * 00191 * 00192 * @ingroup GeneratorClasses 00193 */ 00194 00195 00196 class vGenerator : public Type { 00197 00198 public: 00199 00200 /** @name Constructors & Destructor */ 00201 /** @{ doxygen group */ 00202 00203 /** 00204 * Default constructor 00205 */ 00206 vGenerator(void); 00207 00208 /** 00209 * Copy-constructror 00210 */ 00211 vGenerator(const vGenerator& rOtherGen); 00212 00213 /** 00214 * Construct from file. This constructor 00215 * effectively uses the DoRead(TokenReader&) function to read. 00216 * 00217 * @param rFileName 00218 * Name of file 00219 * 00220 * @exception Exception 00221 * - IO errors (id 1) 00222 * - Token mismatch (id 50, 51, 52, 80, 85) 00223 */ 00224 vGenerator(const std::string& rFileName); 00225 00226 /** 00227 * Construct on heap. 00228 * Technically not a constructor, this function creates a vGenerator with the 00229 * same event symboltable. It is the callers responsebilty to delete the object 00230 * when no longer needed. Derived classes must reimplement 00231 * this function to create an object of the same class and the same event 00232 * symboltable. 00233 * 00234 * @return 00235 * New vGenerator 00236 */ 00237 virtual vGenerator* New(void) const; 00238 00239 /** 00240 * Construct copy on heap. 00241 * Technically not a constructor, this function creates a vGenerator with the 00242 * same event symboltable. It is the callers responsebilty to delete the object 00243 * when no longer needed. Derived classes must reimplement 00244 * this function to create an object of the same class and the same event 00245 * symboltable. 00246 * 00247 * @return 00248 * New vGenerator 00249 */ 00250 virtual vGenerator* Copy(void) const; 00251 00252 /** 00253 * Type test. 00254 * Uses C++ dynamic cast to test whether the specified object 00255 * casts to a vGenerator. 00256 * 00257 * @return 00258 * vGenerator reference if dynamic cast succeeds, else NULL 00259 */ 00260 virtual const Type* Cast(const Type* pOther) const; 00261 00262 /** 00263 * Destructor 00264 */ 00265 virtual ~vGenerator(void); 00266 00267 /** @} doxygen group */ 00268 00269 /***************************************** 00270 ***************************************** 00271 ***************************************** 00272 *****************************************/ 00273 00274 /** @name Copy and Assignment */ 00275 /** @{ doxygen group */ 00276 00277 00278 /** 00279 * Copy from other vGenerator. 00280 * The current implementation tries to be smart and copies attributes 00281 * if types can be casted. Use AssignWithoutAttributes to 00282 * explicitely ignore attributes. 00283 * 00284 * @param rSrc 00285 * Source to copy from. 00286 */ 00287 virtual vGenerator& Assign(const vGenerator& rSrc); 00288 00289 /** 00290 * Copy from other faudes type. 00291 * The current implementation tests whether the source 00292 * object can be casted to a generator and then performs 00293 * the according assignment. 00294 * 00295 * @param rSrc 00296 * Source to copy from. 00297 */ 00298 virtual vGenerator& Assign(const Type& rSrc); 00299 00300 /** 00301 * Copy from other vGenerator, ignore attributes. 00302 * 00303 * @param rGen 00304 * Source to copy from. 00305 */ 00306 virtual vGenerator& AssignWithoutAttributes(const vGenerator& rGen); 00307 00308 /** 00309 * Destructive copy to other vGenerator. 00310 * Copy method with increased performance at the cost of invalidating 00311 * the source data. If attribute types of source and destination differ, 00312 * a std copy is invoked. 00313 * 00314 * 00315 * @param rGen 00316 * Destination for copy operation. 00317 */ 00318 virtual void Move(vGenerator& rGen); 00319 00320 /** 00321 * Assignment operator (uses Assign method) 00322 * Note: you must reimplement this operator in derived 00323 * classes in order to handle internal pointers correctly. 00324 * 00325 * @param rOtherGen 00326 * Other generator 00327 */ 00328 virtual vGenerator& operator= (const vGenerator& rOtherGen); 00329 00330 /** 00331 * Create another version of this generator. 00332 * Assembles a copy of this generator, however, with versioned events. 00333 * The new event names are created by appending an underscore and a specified string. 00334 * State names and indices as well as any attributes are maintained. 00335 * 00336 * @param rVersion 00337 * String value to be appended to event names 00338 * @param rResGen 00339 * Resulting versioned generator 00340 * 00341 * @exception Exception 00342 * - Source must not match destination (id 96) 00343 */ 00344 virtual void Version(const std::string& rVersion, vGenerator& rResGen) const; 00345 00346 /** 00347 * Create another version of this generator. 00348 * Assembles a copy of this generator, however, with versioned events. 00349 * The new event names are created by appending an underscore and a numeric index. 00350 * State names and indices as well as any attributes are maintained. 00351 * 00352 * @param version 00353 * Numeric value to be appended to event names 00354 * @param rResGen 00355 * Resulting versioned generator 00356 * @exception Exception 00357 * - Source must not match destination (id 96) 00358 */ 00359 virtual void Version(Idx version, vGenerator& rResGen) const; 00360 00361 /** 00362 * Create another version of this generator. 00363 * Assembles a copy of this generator, however, with versioned events. 00364 * The new event names are created by replacing all substrings matching 00365 * a specified string pattern by a replacement string. 00366 * State names and indices as well as any attributes are maintained. 00367 * 00368 * @param rPattern 00369 * String value to be replaced in event names 00370 * @param rReplacement 00371 * String value to be inserted in event names in place of rPattern 00372 * @param rResGen 00373 * Resulting versioned generator 00374 * @exception Exception 00375 * - Source must not match destination (id 96) 00376 */ 00377 virtual void Version(const std::string& rPattern,const std::string& rReplacement, vGenerator& rResGen) const; 00378 00379 00380 00381 /** @} doxygen group */ 00382 00383 00384 /***************************************** 00385 ***************************************** 00386 ***************************************** 00387 *****************************************/ 00388 00389 /** @name Basic Maintenance */ 00390 /** @{ doxygen group */ 00391 00392 00393 /** 00394 * Set the generator's name 00395 * 00396 * @param rName 00397 * Generator name 00398 */ 00399 void Name(const std::string& rName); 00400 00401 /** 00402 * Get generator's name 00403 * 00404 * @return 00405 * Name of generator 00406 */ 00407 const std::string& Name(void) const; 00408 00409 /** 00410 * Check if generator is valid. 00411 * Performs internal consistency tests, This method is intendend 00412 * to test generators that have been manipulated by methods without 00413 * consistency tests, eg InjectAlphabet. 00414 * 00415 * @return 00416 * True for success 00417 */ 00418 virtual bool Valid(void); 00419 00420 /** 00421 * Clear generator data. 00422 * Clears state set, alphabet and transitionrealtion. Behavioural flags 00423 * eg StateNamesEnabled are maintained. 00424 */ 00425 virtual void Clear(void); 00426 00427 00428 /** 00429 * Clear all states and transitions, maintain alphabet. 00430 */ 00431 void ClearStates(void); 00432 00433 /** 00434 * Get number of events in alphabet 00435 * 00436 * @return 00437 * Number of events 00438 */ 00439 Idx AlphabetSize(void) const; 00440 00441 /** 00442 * Get generator size (number of states) 00443 * 00444 * @return 00445 * Number of states 00446 */ 00447 Idx Size(void) const; 00448 00449 /** 00450 * Get number of transitions 00451 * 00452 * @return 00453 * Number of transitions 00454 */ 00455 Idx TransRelSize(void) const; 00456 00457 /** 00458 * Get number of initial states 00459 * 00460 * @return 00461 * Number of initial states 00462 */ 00463 Idx InitStatesSize(void) const; 00464 00465 /** 00466 * Get number of marked states 00467 * 00468 * @return 00469 * Number of marked states 00470 */ 00471 Idx MarkedStatesSize(void) const; 00472 00473 /** 00474 * Check if generator is empty (no states) 00475 * 00476 * @return 00477 * True if state set is empty 00478 */ 00479 bool Empty(void) const; 00480 00481 /** 00482 * Check if alphabet is Empty 00483 * 00484 * @return 00485 * True if mpAlphabet is empty 00486 */ 00487 bool AlphabetEmpty(void) const; 00488 00489 /** 00490 * Check if transition relation is empty 00491 * 00492 * @return 00493 * True if transition relation is empty 00494 */ 00495 bool TransRelEmpty(void) const; 00496 00497 /** 00498 * Check if set of initial states are empty 00499 * 00500 * @return 00501 * True if mInitStates is empty 00502 */ 00503 bool InitStatesEmpty(void) const; 00504 00505 /** 00506 * Check if set of marked states are empty 00507 * 00508 * @return 00509 * True if mMarkedStates is empty 00510 */ 00511 bool MarkedStatesEmpty(void) const; 00512 00513 00514 /** @} doxygen group */ 00515 00516 /***************************************** 00517 ***************************************** 00518 ***************************************** 00519 *****************************************/ 00520 00521 /** @name Event Symboltable */ 00522 /** @{ doxygen group */ 00523 00524 /** 00525 * Get Pointer to EventSymbolTable currently used 00526 * by this vGenerator. 00527 * 00528 * @return 00529 * Pointer to EventSymbolTable 00530 */ 00531 SymbolTable* EventSymbolTablep(void) const; 00532 00533 /** 00534 * Set EventSymbolTable to be used by this vGenerator. 00535 * This function sets the reference to the event symboltable. The current implementation 00536 * in derived classes clears the generator, future versions may implement a re-indexing. 00537 * 00538 * @param pSymTab 00539 * Pointer to SymbolTable 00540 */ 00541 virtual void EventSymbolTablep(SymbolTable* pSymTab); 00542 00543 /** 00544 * Set EventSymbolTable as given by rOtherGen. 00545 * This function sets the reference to the event symboltable. The current implementation 00546 * clears the generator, future versions may implement a re-indexing. 00547 * 00548 * @param rOtherGen 00549 * Other generator 00550 * 00551 */ 00552 virtual void EventSymbolTablep(const vGenerator& rOtherGen); 00553 00554 /** 00555 * Create EventSet with generator's EventSymbolTable (on stack). 00556 * 00557 * @return 00558 * New empty EventSet on stack 00559 */ 00560 EventSet NewEventSet(void) const; 00561 00562 /** 00563 * Create EventSet with generator's EventSymbolTable (on heap). 00564 * 00565 * @return 00566 * Pointer to new empty EventSet on heap 00567 */ 00568 EventSet* NewEventSetp(void) const; 00569 00570 /** 00571 * Event index lookup 00572 * 00573 * @param rName 00574 * Name of event to lookup 00575 * 00576 * @return 00577 * Valid index or 0 if name unknown to symboltable 00578 */ 00579 Idx EventIndex(const std::string& rName) const; 00580 00581 /** 00582 * Event name lookup 00583 * 00584 * @param index 00585 * Index of event to look up 00586 * 00587 * @return 00588 * Name or empty std::string if non-existent 00589 */ 00590 std::string EventName(Idx index) const; 00591 00592 /** 00593 * Set name for existing event 00594 * 00595 * Note: since the event symboltable is global, this affect all 00596 * generators that refer to the specified event. 00597 * 00598 * @param index 00599 * Event index 00600 * @param rName 00601 * New name 00602 * 00603 * @exception Exception 00604 * - index not found in EventSymbolMap (id 42) 00605 * - name already associated with another index (id 44) 00606 * - event does not exist in generator (id 89) 00607 */ 00608 void EventName(Idx index, const std::string& rName); 00609 00610 /** 00611 * Create a new unique symbolic event name. 00612 * See also SymbolTable::UniqueSymbol(). 00613 * 00614 * @param rName 00615 * suggestion for new state name 00616 */ 00617 std::string UniqueEventName(const std::string& rName) const; 00618 00619 00620 /** 00621 * Rename event in this generator. 00622 * This method renames the specified event. It does so by 00623 * removing and adding transitions. This does not 00624 * effect other generators. 00625 * 00626 * @param event 00627 * Event to rename 00628 * @param rNewName 00629 * New name 00630 * @return 00631 * True, if the new name did already exist 00632 * 00633 * @exception Exception 00634 * - specified event does not exist (id 89) 00635 */ 00636 bool EventRename(Idx event, const std::string& rNewName); 00637 00638 00639 /** 00640 * Rename event in this generator. 00641 * Convenience wrapper for EventRename(Idx, const std::string&). 00642 * 00643 * @param event 00644 * Event to rename 00645 * @param rNewName 00646 * New name 00647 * @return 00648 * True, if the new name did already exist 00649 * 00650 * @exception Exception 00651 * - specified event does not exist (id 89) 00652 */ 00653 bool EventRename(const std::string& rOldName, const std::string& rNewName); 00654 00655 00656 /** @} doxygen group */ 00657 00658 /* statics outside doxygen group */ 00659 00660 /** 00661 * Get Pointer to global EventSymbolTable. This is 00662 * a static member of SymbolTable and used as default 00663 * for all derived generator classes and instantiated objects. 00664 * 00665 * @return 00666 * Pointer to global EventSymbolTable 00667 */ 00668 static SymbolTable* GlobalEventSymbolTablep(void); 00669 00670 00671 /***************************************** 00672 ***************************************** 00673 ***************************************** 00674 *****************************************/ 00675 00676 /** @name State Symboltable */ 00677 /** @{ doxygen group */ 00678 00679 00680 /** 00681 * Get StateSymbolTable. 00682 * 00683 * @return 00684 * ref to state-symboltable 00685 */ 00686 const SymbolTable& StateSymbolTable(void) const; 00687 00688 /** 00689 * Set StateSymbolTable. 00690 * 00691 * By convention, state names and indices are local to the 00692 * respective generator. It is most unlikely that you want to use 00693 * this function. 00694 * 00695 * @return 00696 * Pointer to mpStateSymbolTable 00697 */ 00698 void StateSymbolTable(const SymbolTable& rSymTab); 00699 00700 /** 00701 * State index lookup. 00702 * 00703 * @param rName 00704 * 00705 * @return 00706 * Valid index (or 0 for non-existent) 00707 */ 00708 Idx StateIndex(const std::string& rName) const; 00709 00710 /** 00711 * State name lookup 00712 * 00713 * @param index 00714 * 00715 * @return name (or empty string if no such exists) 00716 */ 00717 std::string StateName(Idx index) const; 00718 00719 /** 00720 * Set name of state 00721 * 00722 * @param index 00723 * Index 00724 * @param rName 00725 * Name 00726 * 00727 * @exception Exception 00728 * - name already associated with another index (id 44) 00729 * - state does not exist in generator (id 90) 00730 */ 00731 void StateName(Idx index, const std::string& rName); 00732 00733 /** 00734 * Remove all names from generator's StateSymbolTable 00735 */ 00736 void ClearStateNames(void); 00737 00738 /** 00739 * Clear name for individual state 00740 * 00741 * @param index 00742 * State index 00743 * @exception Exception 00744 * - state does not exist in generator (id 90) 00745 */ 00746 void ClrStateName(Idx index); 00747 00748 /** 00749 * Clear name for individual state 00750 * 00751 * @param rName 00752 * State name 00753 */ 00754 void ClrStateName(const std::string& rName); 00755 00756 /** 00757 * Whether libFAUEDS functions are requested to generate state names. 00758 * Most libFAUDES functions that introduce new states to a generator can be enabled 00759 * to also assign (more or less sensible) names to those states. This feature is 00760 * purely cosmetic and may be disabled for performance reasons. 00761 * 00762 * 00763 * @return 00764 * True, if generation of statenames is enabled. 00765 */ 00766 bool StateNamesEnabled(void) const; 00767 00768 /** 00769 * Enable/disable libFAUEDS functions to automatically generate state names. 00770 * Disabling state name generation implies ClearStateNames(). 00771 * 00772 * @param flag 00773 * True enables statenames / false disables them 00774 */ 00775 void StateNamesEnabled(bool flag); 00776 00777 /** 00778 * Assign each state a default name based on its index. 00779 */ 00780 void SetDefaultStateNames(void); 00781 00782 /** 00783 * For all states without a symbolic name, assign a name 00784 * based on suggested template and the index. 00785 * 00786 * @param rTemplate 00787 * Basis for name generation 00788 */ 00789 void EnforceStateNames(const std::string& rTemplate); 00790 00791 /** 00792 * Create a new unique symbolic state name. 00793 * See also SymbolTable::UniqueSymbol(). 00794 * 00795 * @param rName 00796 * suggestion for new state name 00797 */ 00798 std::string UniqueStateName(const std::string& rName) const; 00799 00800 00801 /** @} doxygen group */ 00802 00803 /* statics outside doxygen group */ 00804 00805 /** 00806 * Sets the default for automatic state name generation. 00807 * This flag takes effect only on generators newly created by the default 00808 * constructor. The copy constructor copies the state name flag from the 00809 * source generator. See also StateNamesEnabled(bool). 00810 * 00811 * @param flag 00812 * True enables statenames / false disables them 00813 */ 00814 static void StateNamesEnabledDefault(bool flag); 00815 00816 00817 /***************************************** 00818 ***************************************** 00819 ***************************************** 00820 ***************************************** 00821 *****************************************/ 00822 00823 /** @name Read Access to Core Members */ 00824 /** @{ doxygen group */ 00825 00826 /** 00827 * Iterator to Begin() of alphabet 00828 * 00829 * @return 00830 * Iterator to begin of mpAlphabet 00831 */ 00832 EventSet::Iterator AlphabetBegin(void) const; 00833 00834 /** 00835 * Iterator to End() of alphabet 00836 * 00837 * @return 00838 * Iterator to end of mpAlphabet 00839 */ 00840 EventSet::Iterator AlphabetEnd(void) const; 00841 00842 /** 00843 * Test existence of event in alphabet 00844 * 00845 * @param index 00846 * Event index 00847 * 00848 * @return 00849 * True / false 00850 */ 00851 bool ExistsEvent(Idx index) const; 00852 00853 /** 00854 * Test existence of event in alphabet 00855 * 00856 * @param rName 00857 * Event name 00858 * 00859 * @return 00860 * True / false 00861 */ 00862 bool ExistsEvent(const std::string& rName) const; 00863 00864 /** 00865 * Returns a iterator to event index in alphabet 00866 * 00867 * @param index 00868 * Index to find 00869 * 00870 * @return 00871 * Iterator to event index 00872 */ 00873 EventSet::Iterator FindEvent(Idx index) const; 00874 00875 /** 00876 * Returns a iterator to event index in alphabet 00877 * 00878 * @param rName 00879 * Event name of index to find 00880 * 00881 * @return 00882 * Iterator to event index 00883 */ 00884 EventSet::Iterator FindEvent(const std::string& rName) const; 00885 00886 /** 00887 * Return const reference to alphabet 00888 * 00889 * @return EventSet 00890 * Reference to mpAlphabet 00891 */ 00892 const EventSet& Alphabet(void) const; 00893 00894 /** 00895 * Iterator to Begin() of state set 00896 * 00897 * @return 00898 * Iterator to begin of state set 00899 */ 00900 StateSet::Iterator StatesBegin(void) const; 00901 00902 /** 00903 * Iterator to End() of state set 00904 * 00905 * @return 00906 * Iterator to end of state set 00907 */ 00908 StateSet::Iterator StatesEnd(void) const; 00909 00910 /** 00911 * Test existence of state in state set 00912 * 00913 * @param index 00914 * State index 00915 * 00916 * @return 00917 * true / false 00918 */ 00919 bool ExistsState(Idx index) const; 00920 00921 /** 00922 * Test existence of state in state set 00923 * 00924 * @param name 00925 * State name 00926 * 00927 * @return 00928 * true / false 00929 */ 00930 bool ExistsState(const std::string& name) const; 00931 00932 /** 00933 * Returns a iterator to state index in state set 00934 * 00935 * @param index 00936 * Index to find 00937 * 00938 * @return 00939 * StateSet::Iterator to state index 00940 */ 00941 StateSet::Iterator FindState(Idx index) const; 00942 00943 /** 00944 * Returns a iterator to state with specified name 00945 * 00946 * @param rName 00947 * name of state to find 00948 * 00949 * @return 00950 * StateSet::Iterator to state 00951 */ 00952 StateSet::Iterator FindState(const std::string& rName) const; 00953 00954 00955 /** 00956 * Return reference to state set 00957 * 00958 * @return 00959 * StateSet reference incl actual attribute type 00960 */ 00961 const StateSet& States(void) const; 00962 00963 /** 00964 * Return initial state 00965 * 00966 * If the initial state is not unique, this function 00967 * returns 0. 00968 * 00969 * @return 00970 * Index of initial state 00971 * 00972 */ 00973 Idx InitState(void) const; 00974 00975 /** 00976 * Return the successor state of state x1 with event ev. 00977 * If no such transition exists, return 0. 00978 * If multiple such transitions exit, throug expection. 00979 * 00980 * @return next state 00981 * @exception Exception 00982 * - Successor state does not exist uniquely (id 92) 00983 */ 00984 Idx SuccessorState(Idx x1, Idx ev) const; 00985 00986 /** 00987 * Iterator to Begin() of mInitStates 00988 * 00989 * @return 00990 * Iterator to begin of mInitStates 00991 */ 00992 StateSet::Iterator InitStatesBegin(void) const; 00993 00994 /** 00995 * Iterator to End() of mInitStates 00996 * 00997 * @returns 00998 * Iterator to end of mInitStates 00999 */ 01000 StateSet::Iterator InitStatesEnd(void) const; 01001 01002 /** 01003 * Test existence of state in mInitStates 01004 * 01005 * @param index 01006 * State index 01007 * 01008 * @return 01009 * true / false 01010 */ 01011 bool ExistsInitState(Idx index) const; 01012 01013 /** 01014 * Iterator to state index in mInitStates 01015 * 01016 * @param index 01017 * Index to find 01018 * 01019 * @return 01020 * StateSet::Iterator to state index 01021 */ 01022 StateSet::Iterator FindInitState(Idx index) const; 01023 01024 /** 01025 * Const ref to initial states 01026 * 01027 * @return StateSet 01028 */ 01029 const StateSet& InitStates(void) const; 01030 01031 /** 01032 * Iterator to Begin() of mMarkedStates 01033 * 01034 * @returns 01035 * iterator to Begin of mMarkedStates 01036 */ 01037 StateSet::Iterator MarkedStatesBegin(void) const; 01038 01039 /** 01040 * Iterator to End() of mMarkedStates 01041 * 01042 * @returns 01043 * iterator to End of mMarkedStates 01044 */ 01045 StateSet::Iterator MarkedStatesEnd(void) const; 01046 01047 /** 01048 * Test existence of state in mMarkedStates 01049 * 01050 * @param index 01051 * State index 01052 * 01053 * @return 01054 * true / false 01055 */ 01056 bool ExistsMarkedState(Idx index) const; 01057 01058 /** 01059 * Returns a iterator to state index in mMarkedStates 01060 * 01061 * @param index 01062 * Index to find 01063 * 01064 * @return 01065 * StateSet::Iterator to state index 01066 */ 01067 StateSet::Iterator FindMarkedState(Idx index) const; 01068 01069 /** 01070 * Return const ref of marked states 01071 * 01072 * @return StateSet 01073 */ 01074 const StateSet& MarkedStates(void) const; 01075 01076 /** 01077 * Iterator to Begin() of transition relation 01078 * 01079 * @return 01080 * Iterator to Begin of mpTransRel 01081 */ 01082 TransSet::Iterator TransRelBegin(void) const; 01083 01084 /** 01085 * Iterator to End() of transition relation 01086 * 01087 * @return 01088 * Iterator to End of mpTransRel 01089 */ 01090 TransSet::Iterator TransRelEnd(void) const; 01091 01092 /** 01093 * Iterator to begin of transitions with x1 as predecessor state. 01094 * 01095 * @param x1 01096 * Predecessor state 01097 * 01098 * @return 01099 * iterator to begin of transitions with x1 01100 */ 01101 TransSet::Iterator TransRelBegin(Idx x1) const; 01102 01103 /** 01104 * iterator to end of transitions with x1 as predecessor state. 01105 * 01106 * Note: Set the End(x1) iterator to a variable, so it won't be 01107 * recalculated every iteration. 01108 * 01109 * @param x1 01110 * Predecessor state 01111 * 01112 * @return 01113 * iterator to end of transitions with x1 01114 * (one after last matching transition) 01115 */ 01116 TransSet::Iterator TransRelEnd(Idx x1) const; 01117 01118 /** 01119 * iterator to begin of transitions with x1 as predecessor state and 01120 * event ev. 01121 * 01122 * @param x1 01123 * Predecessor state 01124 * @param ev 01125 * Event 01126 * 01127 * @return 01128 * iterator to begin of transitions with x1 and ev 01129 */ 01130 TransSet::Iterator TransRelBegin(Idx x1, Idx ev) const; 01131 01132 /** 01133 * Iterator to end of transitions with x1 as predecessor state and 01134 * event ev. 01135 * 01136 * Note: Set the End(x1,ev) iterator to a variable, so it won't be 01137 * recalculated every iteration. 01138 * 01139 * @param x1 01140 * Predecessor state 01141 * @param ev 01142 * Event 01143 * 01144 * @return 01145 * iterator to end of transitions with x1 and ev 01146 * (one after last matching transition) 01147 */ 01148 TransSet::Iterator TransRelEnd(Idx x1, Idx ev) const; 01149 01150 /** 01151 * iterator to transition given by x1, ev, x2 01152 * 01153 * 01154 * @param rX1 01155 * name of Predecessor state 01156 * @param rEv 01157 * name of Event 01158 * @param rX2 01159 * name of Successor state 01160 * 01161 * @return 01162 * iterator to transition or end() if not exists 01163 */ 01164 TransSet::Iterator FindTransition( 01165 const std::string& rX1, const std::string& rEv, const std::string& rX2) const; 01166 01167 /** 01168 * Iterator to transition given by x1, ev, x2 01169 * 01170 * 01171 * @param x1 01172 * Predecessor state 01173 * @param ev 01174 * Event 01175 * @param x2 01176 * Successor state 01177 * 01178 * @return 01179 * iterator to transition or End() if not exists 01180 */ 01181 TransSet::Iterator FindTransition(Idx x1, Idx ev, Idx x2) const; 01182 01183 /** 01184 * Iterator to transition 01185 * 01186 * 01187 * @param rTrans 01188 * transition 01189 * 01190 * @return 01191 * iterator to transition or end() if not exists 01192 */ 01193 TransSet::Iterator FindTransition(const Transition& rTrans) const; 01194 01195 /** 01196 * Test for transition given by x1, ev, x2 01197 * 01198 * 01199 * @param rX1 01200 * name of Predecessor state 01201 * @param rEv 01202 * name of Event 01203 * @param rX2 01204 * name of Successor state 01205 * 01206 * @return 01207 * true / false 01208 */ 01209 bool ExistsTransition( 01210 const std::string& rX1, const std::string& rEv, const std::string& rX2) const; 01211 01212 /** 01213 * Test for transition given by x1, ev, x2 01214 * 01215 * @param x1 01216 * Predecessor state 01217 * @param ev 01218 * Event 01219 * @param x2 01220 * Successor state 01221 * 01222 * @return 01223 * true / false 01224 */ 01225 bool ExistsTransition(Idx x1, Idx ev, Idx x2) const; 01226 01227 /** 01228 * test for transition 01229 * 01230 * 01231 * @param rTrans 01232 * transition 01233 * 01234 * @return 01235 * true / false 01236 */ 01237 bool ExistsTransition(const Transition& rTrans) const; 01238 01239 /** 01240 * Test for transition given by x1, ev 01241 * 01242 * @param x1 01243 * Predecessor state 01244 * @param ev 01245 * Event 01246 * 01247 * @return 01248 * true / false 01249 */ 01250 bool ExistsTransition(Idx x1, Idx ev) const; 01251 01252 /** 01253 * Test for transition given by x1 01254 * 01255 * @param x1 01256 * Predecessor state 01257 * 01258 * @return 01259 * true / false 01260 */ 01261 bool ExistsTransition(Idx x1) const; 01262 01263 /** 01264 * Return reference to transition relation 01265 * 01266 * @return TransRel 01267 */ 01268 const TransSet& TransRel(void) const; 01269 01270 /** 01271 * Get copy of trantision relation sorted by other compare 01272 * operator, e.g. "x2,ev,x1" 01273 * 01274 * @param res 01275 * resulting transition relation 01276 */ 01277 void TransRel(TransSetX1EvX2& res) const; 01278 void TransRel(TransSetEvX1X2& res) const; 01279 void TransRel(TransSetEvX2X1& res) const; 01280 void TransRel(TransSetX2EvX1& res) const; 01281 void TransRel(TransSetX2X1Ev& res) const; 01282 void TransRel(TransSetX1X2Ev& res) const; 01283 01284 /** 01285 * Convebience function. 01286 * 01287 * @param rX1 01288 * Name of Predecessor state 01289 * @param rEv 01290 * Name of Event 01291 * @param rX2 01292 * Name of Successor state 01293 * 01294 * @return 01295 * Transition as specified. 01296 */ 01297 Transition TransitionByNames( 01298 const std::string& rX1, const std::string& rEv, const std::string& rX2) const; 01299 01300 /** @} doxygen group */ 01301 01302 01303 01304 /***************************************** 01305 ***************************************** 01306 ***************************************** 01307 *****************************************/ 01308 01309 /** @name Write Access to Core Members */ 01310 /** @{ doxygen group */ 01311 01312 01313 /** 01314 * Add an existing event to alphabet by index. It is an error to insert 01315 * an event index that is not known to the mpEventSymbolTable. 01316 * 01317 * @param index 01318 * Event index 01319 * @return 01320 * True, if event was new to alphabet 01321 */ 01322 bool InsEvent(Idx index); 01323 01324 /** 01325 * Add named event to generator. An entry in the mpEventSymbolTable will 01326 * be made if event name is not known so far. 01327 * 01328 * @param rName 01329 * Name of the event to add 01330 * 01331 * @return 01332 * New unique index 01333 */ 01334 Idx InsEvent(const std::string& rName); 01335 01336 /** 01337 * Add new named events to generator. 01338 * If the event allready exists, the attribute is maintained. 01339 * 01340 * @param events 01341 * EventSet 01342 */ 01343 void InsEvents(const EventSet& events); 01344 01345 /** 01346 * Delete event from generator by index. mpEventSymbolTable stays untouched. 01347 * Transitions containing event will be removed too. 01348 * 01349 * @param index 01350 * Index of event 01351 * @return 01352 * True, if event was in alphabet 01353 * 01354 */ 01355 bool DelEvent(Idx index); 01356 01357 /** 01358 * Delete event from generator by name. mpEventSymbolTable stays untouched. 01359 * Transitions containing event will be removed too. 01360 * 01361 * @param rName 01362 * Name of event 01363 * @return 01364 * True, if event was in alphabet 01365 * 01366 */ 01367 bool DelEvent(const std::string& rName); 01368 01369 /** 01370 * Delete a set of events from generator. mpEventSymbolTable stays untouched. 01371 * Transitions containing events will be removed too. 01372 * 01373 * @param rEvents 01374 * EventSet containing events to remove 01375 */ 01376 void DelEvents(const EventSet& rEvents); 01377 01378 /** 01379 * Delete event from alphabet without consistency check. The event is only 01380 * deleted from mpAlphabet but not from transition relation. 01381 * 01382 * @param index 01383 * Index of event 01384 * @return 01385 * True, if event was in alphabet 01386 * 01387 */ 01388 bool DelEventFromAlphabet(Idx index); 01389 01390 /** 01391 * Set mpAlphabet without consistency check. 01392 * Sets the alphabet incl attributes, if provided. 01393 * 01394 * @param rNewalphabet 01395 * EventSet with new alphabet 01396 */ 01397 void InjectAlphabet(const EventSet& rNewalphabet); 01398 01399 /** 01400 * Restricts mpAlphabet without consistency check. 01401 * Maintains attributes if any. 01402 * 01403 * @param rNewalphabet 01404 * EventSet with alphabet 01405 */ 01406 void RestrictAlphabet(const EventSet& rNewalphabet); 01407 01408 /** 01409 * Add new anonymous state to generator 01410 * 01411 * @return 01412 * Index of new unique state 01413 */ 01414 Idx InsState(void); 01415 01416 /** 01417 * Add (perhaps new) state to generator 01418 * 01419 * @return 01420 * True to indicate that state was new to generator 01421 */ 01422 bool InsState(Idx index); 01423 01424 /** 01425 * Add new named state to generator. 01426 * 01427 * @param rName 01428 * Name of the state to add 01429 * 01430 * @return 01431 * Index of new unique state 01432 * 01433 * @exception Exception 01434 * Name already exists (id 44) 01435 */ 01436 Idx InsState(const std::string& rName); 01437 01438 /** 01439 * Add anonymous states to generator 01440 * 01441 * @param rStates 01442 * Set of states to add 01443 */ 01444 void InsStates(const StateSet& rStates); 01445 01446 /** 01447 * Delete a state from generator by index. 01448 * Cleans mpStates, mInitStates, mMarkedStates, mpTransRel and mpStateSymbolTable. 01449 * 01450 * @param index 01451 * Index of state to delete. 01452 * @return 01453 * True, if state was in stateset 01454 */ 01455 bool DelState(Idx index); 01456 01457 /** 01458 * Delete a state from generator by name. 01459 * Cleans mpStates, mInitStates, mMarkedStates, mpTransRel and mpStateSymbolTable. 01460 * 01461 * @param rName 01462 * Name of state to delete. Will be erased in mpStateSymbolTable too 01463 * @return 01464 * True, if state was in stateset 01465 * 01466 * @exception Exception 01467 * - Symbolic name not known (id 90) 01468 */ 01469 bool DelState(const std::string& rName); 01470 01471 /** 01472 * Delete a set of states 01473 * Cleans mpStates, mInitStates, mMarkedStates, mpTransrel, and mpStateSymboltable 01474 * 01475 * @param rDelStates 01476 * StateSet containing states aka indicees to delete 01477 */ 01478 void DelStates(const StateSet& rDelStates); 01479 01480 01481 /** 01482 * Delete a state from generator without consistency check. This removes the 01483 * state from mpStates and mpStateSymbolTable but doesn't touch mpTransRel, 01484 * mInitStates and mMarkedStates. 01485 * 01486 * @param index 01487 * Index of state to delete. 01488 * @return 01489 * True, if state was in stateset 01490 * 01491 */ 01492 bool DelStateFromStates(Idx index); 01493 01494 /** 01495 * Delete a state from generator without consistency check. This removes the 01496 * state from mpStates and mpStateSymbolTable but doesn't touch mpTransRel, 01497 * mInitStates and mMarkedStates. 01498 * Index to delete is given by iterator. 01499 * 01500 * @param pos 01501 * StateSet::Iterator 01502 * @return 01503 * Iteraror to next state 01504 */ 01505 StateSet::Iterator DelStateFromStates(StateSet::Iterator pos); 01506 01507 /** 01508 * Inject an existing state index into generators mStates 01509 * Use with care! For use in performance optimized functions. 01510 * 01511 * @param index 01512 * State index to inject 01513 */ 01514 void InjectState(Idx index); 01515 01516 /** 01517 * Inject a complete state set without consistency checks (without attributes) 01518 * 01519 * @param rNewStates 01520 * StateSet 01521 */ 01522 void InjectStates(const StateSet& rNewStates); 01523 01524 01525 /** 01526 * Create new anonymous state and set as initial state 01527 * 01528 * @return 01529 * Index of new unique 01530 */ 01531 Idx InsInitState(void); 01532 01533 /** 01534 * Add (perhaps new) state to generator and turn it 01535 * into a initial state. 01536 * 01537 * @param index 01538 * State to insert 01539 * @return 01540 * True to indicate that state was new to generator 01541 */ 01542 bool InsInitState(Idx index); 01543 01544 /** 01545 * Create a new named state and set as initial state 01546 * 01547 * @param rName 01548 * Name of the state to add 01549 * 01550 * @return 01551 * Index of new unique state 01552 */ 01553 Idx InsInitState(const std::string& rName); 01554 01555 /** 01556 * Add (perhaps new) anonymous initial states to generator 01557 * 01558 * @param rStates 01559 * Set of states to add 01560 */ 01561 void InsInitStates(const StateSet& rStates); 01562 01563 /** 01564 * Create new anonymous state and set as marked state 01565 * 01566 * @return 01567 * Index of new unique state 01568 */ 01569 Idx InsMarkedState(void); 01570 01571 /** 01572 * Add (perhaps new) state to generator and turn it 01573 * into a marked state. 01574 * 01575 * @param index 01576 * State to insert 01577 * @return 01578 * True to indicate that state was new to generator 01579 */ 01580 bool InsMarkedState(Idx index); 01581 01582 /** 01583 * Create a new named state and set as marked state 01584 * 01585 * @param rName 01586 * Name of the state to add 01587 * 01588 * @return 01589 * Index of new unique state 01590 */ 01591 Idx InsMarkedState(const std::string& rName); 01592 01593 /** 01594 * Add (perhaps new) anonymous initial states to generator 01595 * 01596 * @param rStates 01597 * Set of states to add 01598 */ 01599 void InsMarkedStates(const StateSet& rStates); 01600 01601 /** 01602 * Set an existing state as initial state by index. 01603 * 01604 * @param index 01605 * Index of state to set as initial state 01606 * @exception Exception 01607 * - State index not found in generator (id 91) 01608 */ 01609 void SetInitState(Idx index); 01610 01611 /** 01612 * Set an existing state as initial state by name. 01613 * 01614 * @param rName 01615 * Name of state to set as initial state 01616 * 01617 * @exception Exception 01618 * - State name not known in generator (id 90) 01619 */ 01620 void SetInitState(const std::string& rName); 01621 01622 /** 01623 * Replace mInitStates with StateSet given as parameter without consistency checks. 01624 * 01625 * @param rNewInitStates 01626 * StateSet containing new mInitStates 01627 */ 01628 void InjectInitStates(const StateSet& rNewInitStates); 01629 01630 /** 01631 * Unset an existing state as initial state by index 01632 * 01633 * Define FAUDES_CHECKED for consistency checks. 01634 * 01635 * @param index 01636 * State index 01637 * 01638 * @exception Exception 01639 * - State index not found in generator (id 91) 01640 */ 01641 void ClrInitState(Idx index); 01642 01643 /** 01644 * Unset an existing state as initial state by name 01645 * 01646 * @param rName 01647 * State name 01648 * 01649 * @exception Exception 01650 * - State name not known in generator (id 90) 01651 */ 01652 void ClrInitState(const std::string& rName); 01653 01654 /** 01655 * Unset an existing state as initial state by iterator 01656 * 01657 * @param pos 01658 * StateSet::iterator 01659 * @return 01660 * Iterator to next init state 01661 */ 01662 StateSet::Iterator ClrInitState(StateSet::Iterator pos); 01663 01664 /** 01665 * Clear all mInitStates 01666 */ 01667 void ClearInitStates(void); 01668 01669 /** 01670 * Set an existing state as marked state by index 01671 * 01672 * @param index 01673 * Index of state to set as initial state 01674 * @exception Exception 01675 * - State index not found in generator (id 91) 01676 */ 01677 void SetMarkedState(Idx index); 01678 01679 /** 01680 * Set an existing state as marked state by name. 01681 * 01682 * @param rName 01683 * Name of state to set as marked state 01684 * 01685 * @exception Exception 01686 * - State name not known in generator (id 90) 01687 */ 01688 void SetMarkedState(const std::string& rName); 01689 01690 /** 01691 * Unset an existing state as marked state by index 01692 * 01693 * @param index 01694 * State index 01695 * 01696 * @exception Exception 01697 * - State index not found in generator (id 91) 01698 */ 01699 void ClrMarkedState(Idx index); 01700 01701 /** 01702 * Unset an existing state as marked state by name 01703 * 01704 * @param rName 01705 * State name 01706 * 01707 * @exception Exception 01708 * - State index not found in generator (id 91) 01709 */ 01710 void ClrMarkedState(const std::string& rName); 01711 01712 /** 01713 * Unset an existing state as marked state by iterator 01714 * 01715 * @param pos 01716 * StateSet::iterator 01717 * @return 01718 * Iterator to next marked state 01719 */ 01720 StateSet::Iterator ClrMarkedState(StateSet::Iterator pos); 01721 01722 /** 01723 * Clear all marked states 01724 */ 01725 void ClearMarkedStates(void); 01726 01727 /** 01728 * Replace mMarkedStates with StateSet given as parameter without consistency checks. 01729 * 01730 * @param rNewMarkedStates 01731 * StateSet containing new marked states 01732 */ 01733 void InjectMarkedStates(const StateSet& rNewMarkedStates); 01734 01735 /** 01736 * Add a transition to generator by indices. States and event 01737 * must already exist. 01738 * 01739 * @param x1 01740 * Predecessor state index 01741 * @param ev 01742 * Event index 01743 * @param x2 01744 * Successor state index 01745 * 01746 * @return 01747 * True, if the transition was new the generator 01748 * 01749 * @exception Exception 01750 * - state or event not in generator (id 95) 01751 */ 01752 bool SetTransition(Idx x1, Idx ev, Idx x2); 01753 01754 /** 01755 * Add a transition to generator by names. Statename and eventname 01756 * must already exist. 01757 * 01758 * @param rX1 01759 * Predecessor state name 01760 * @param rEv 01761 * Event name 01762 * @param rX2 01763 * Successor state name 01764 * 01765 * @return 01766 * True, if the transition was new the generator 01767 * 01768 * @exception Exception 01769 * - state or event not in generator (id 95) 01770 * - state name not known (id 90) 01771 * - event name not known (id 66) 01772 */ 01773 bool SetTransition(const std::string& rX1, const std::string& rEv, 01774 const std::string& rX2); 01775 01776 /** 01777 * Add a transition to generator. States and event 01778 * must already exist. 01779 * 01780 * 01781 * @param rTransition 01782 * Transition 01783 * 01784 * @return 01785 * True, if the transition was new the generator 01786 * @exception Exception 01787 * - state or event not in generator (id 95) 01788 */ 01789 bool SetTransition(const Transition& rTransition); 01790 01791 /** 01792 * Remove a transition by indices 01793 * 01794 * @param x1 01795 * Predecessor state index 01796 * @param ev 01797 * Event index 01798 * @param x2 01799 * Successor state index 01800 */ 01801 void ClrTransition(Idx x1, Idx ev, Idx x2); 01802 01803 /** 01804 * Remove a transition by transition object 01805 * 01806 * @param rTrans 01807 * Transition object 01808 */ 01809 void ClrTransition(const Transition& rTrans); 01810 01811 /** 01812 * Remove a transition by iterator 01813 * 01814 * @param it 01815 * TransSet::iterator 01816 * @return 01817 * Iterator to next transition 01818 */ 01819 TransSet::Iterator ClrTransition(TransSet::Iterator it); 01820 01821 /** 01822 * Remove a transitions by state and event 01823 * 01824 * @param x1 01825 * Predecessor state index 01826 * @param ev 01827 * Event index 01828 */ 01829 void ClrTransitions(Idx x1, Idx ev); 01830 01831 /** 01832 * Remove a transitions by state 01833 * 01834 * @param x1 01835 * Predecessor state index 01836 */ 01837 void ClrTransitions(Idx x1); 01838 01839 /** 01840 * Clear all transitions 01841 */ 01842 void ClearTransRel(void); 01843 01844 /** 01845 * Set transition without consistency check. 01846 * 01847 * @param rTrans 01848 * Transition to insert 01849 */ 01850 void InjectTransition(const Transition& rTrans); 01851 01852 /** 01853 * Set transition relation without consistency check (no attributes) 01854 * 01855 * @param rNewtransrel 01856 * TransRel to insert 01857 */ 01858 void InjectTransRel(const TransSet& rNewtransrel); 01859 01860 /** @} doxygen group */ 01861 01862 01863 01864 /***************************************** 01865 ***************************************** 01866 ***************************************** 01867 *****************************************/ 01868 01869 /** @name Attributes */ 01870 /** @{ doxygen group */ 01871 01872 01873 /** 01874 * Clear Attributes 01875 */ 01876 virtual void ClearAttributes(void); 01877 01878 /** 01879 * Updates internal attributes. 01880 * This method does nothing and may be reimplemented 01881 * by a any class that adds semantics to attributes 01882 * Eg. you may set a particular state flag, if this state 01883 * is reachable. 01884 * 01885 * @return True if value changed 01886 */ 01887 virtual bool UpdateAttributes(void) {return false;}; 01888 01889 /** 01890 * Clear event attributes 01891 */ 01892 virtual void ClearEventAttributes(void); 01893 01894 /** 01895 * Clear attribute for existing event 01896 * 01897 * @param index 01898 * Event index 01899 */ 01900 virtual void ClrEventAttribute(Idx index); 01901 01902 /** 01903 * Set attribute for existing event. 01904 * This version uses a dynamic cast 01905 * to test the actual type of the provided attribute. An exception is 01906 * thrown for an invalid attribute type. 01907 * In a context where 01908 * the attribute type is known, you may prefer the TaGenerator method. 01909 * 01910 * @param index 01911 * Event index 01912 * @param rAttr 01913 * New attribute 01914 * 01915 * @exception Exception 01916 * - Index not found in alphabet (id 60) 01917 * - Cannot cast attribute (id 63) 01918 */ 01919 virtual void EventAttribute(Idx index, const Type& rAttr); 01920 01921 /** 01922 * Set attributes for existing events. 01923 * This version uses a dynamic cast 01924 * to test the actual type of the provided attributes. An exception is 01925 * thrown for an invalid attribute type. 01926 * 01927 * @param rEventSet 01928 * Set of attributed events 01929 * @exception Exception 01930 * - Element not found in alphabet (id 60) 01931 * - Cannot cast attribute (id 63) 01932 */ 01933 virtual void EventAttributes(const EventSet& rEventSet); 01934 01935 /** 01936 * Event attribute lookup. 01937 * In a context where 01938 * the attribute type is known, you may prefer the TaGenerator method. 01939 * 01940 * @param index 01941 * 01942 * @return 01943 * reference to attribute 01944 */ 01945 virtual const AttributeVoid& EventAttribute(Idx index) const; 01946 01947 /** 01948 * Event attribute lookup. 01949 * In a context where the attribute type is known, 01950 * you may prefer the TaGenerator method. 01951 * 01952 * @param rName 01953 * 01954 * @return 01955 * reference to attribute 01956 */ 01957 virtual const AttributeVoid& EventAttribute(const std::string& rName) const; 01958 01959 /** 01960 * Event attribute pointer to access Attribute methods. 01961 * If there are no attributes (plain vGenerator) this method 01962 * returs 0. If there are attributes, an explicit default value 01963 * may be inserted. 01964 * In a context where the attribute type is known, 01965 * you may prefer the TaGenerator method. 01966 * 01967 * @param index 01968 * 01969 * @return 01970 * pointer to attribute 01971 */ 01972 virtual AttributeVoid* EventAttributep(Idx index); 01973 01974 /** 01975 * Event attribute pointer to access Attribute methods. 01976 * If there are no attributes (plain vGenerator) this method 01977 * returs 0. If there are attributes, an explicit default value 01978 * may be inserted. 01979 * In a context where the attribute type is known, 01980 * you may prefer the TaGenerator method. 01981 * 01982 * @param rName 01983 * 01984 * @return 01985 * pointer to attribute 01986 */ 01987 virtual AttributeVoid* EventAttributep(const std::string& rName); 01988 01989 01990 /** 01991 * Clear state attributes 01992 */ 01993 virtual void ClearStateAttributes(void); 01994 01995 /** 01996 * Clear attribute for existing state 01997 * 01998 * @param index 01999 * State index 02000 */ 02001 virtual void ClrStateAttribute(Idx index); 02002 02003 /** 02004 * Set attribute for existing state. 02005 * This version uses a dynamic cast 02006 * to test the actual type of the provided attribute. An exception is 02007 * thrown for an invalid attribute type. 02008 * In a context where 02009 * the attribute type is known, you may prefer the TaGenerator method. 02010 * 02011 * @param index 02012 * State index 02013 * @param rAttr 02014 * New attribute 02015 * 02016 * @exception Exception 02017 * - Index not found in Stateset (id 60) 02018 * - Cannot cast attribute (id 63) 02019 */ 02020 virtual void StateAttribute(Idx index, const Type& rAttr); 02021 02022 /** 02023 * State attribute lookup. 02024 * In a context where the attribute type is known, 02025 * you may prefer the TaGenerator method. 02026 * 02027 * @param index 02028 * State index 02029 * 02030 * @return Ref to attribute of state 02031 */ 02032 virtual const AttributeVoid& StateAttribute(Idx index) const; 02033 02034 /** 02035 * State attribute pointer to access Attribute methods. 02036 * If there are no attributes (plain vGenerator) this method 02037 * returns 0. If there are attributes, an explicit default value 02038 * may be inserted. 02039 * In a context where the attribute type is known, 02040 * you may prefer the TaGenerator method. 02041 * 02042 * @param index 02043 * State index 02044 * 02045 * @return Pointer to attribute of state 02046 */ 02047 virtual AttributeVoid* StateAttributep(Idx index); 02048 02049 /** 02050 * Clear transition attributes 02051 */ 02052 virtual void ClearTransAttributes(void); 02053 02054 /** 02055 * Set attribute for existing transition. 02056 * This version uses a dynamic cast 02057 * to test the actual type of the provided attribute. An exception is 02058 * thrown for an invalid attribute type. 02059 * In a context where 02060 * the attribute type is known, you may prefer the TaGenerator method. 02061 * 02062 * @param rTrans 02063 * Transition 02064 * @param rAttr 02065 * New attribute 02066 * 02067 * @exception Exception 02068 * - Transition not found in transition relation(id 60) 02069 * - Cannot cast attribute (id 63) 02070 */ 02071 virtual void TransAttribute(const Transition& rTrans, const Type& rAttr); 02072 02073 02074 /** 02075 * Clear attribute for existing transition 02076 * 02077 * @param rTrans 02078 * transition 02079 */ 02080 virtual void ClrTransAttribute(const Transition& rTrans); 02081 02082 /** 02083 * Transition attribute lookup. 02084 * In a context where the attribute type is known, 02085 * you may prefer the TaGenerator method. 02086 * 02087 * @return 02088 * Attribute 02089 * 02090 */ 02091 virtual const AttributeVoid& TransAttribute(const Transition& rTrans) const; 02092 02093 /** 02094 * Transition attribute pointer to access Attribute methods. 02095 * If there are no attributes (plain vGenerator) this method 02096 * returns 0. If there are attributes, an explicit default value 02097 * may be inserted. 02098 * In a context where the attribute type is known, 02099 * you may prefer the TaGenerator method. 02100 * 02101 * @return 02102 * Attribute pointer 02103 * 02104 */ 02105 virtual AttributeVoid* TransAttributep(const Transition& rTrans); 02106 02107 /** 02108 * Clear global attribute 02109 */ 02110 virtual void ClearGlobalAttribute(void); 02111 02112 /** 02113 * Set global attribute. 02114 * The vGenerator does not have attributes, so this function throws an exception for 02115 * any specified attribute different to AttributeVoid. 02116 * The TaGenarator provides a re-implementation to actually set the global attribute. 02117 * 02118 * @param rAttr 02119 * Attribute 02120 * @exception Exception 02121 * - Cannot cast attribute (id 63) 02122 */ 02123 virtual void GlobalAttribute(const Type& rAttr); 02124 02125 /** 02126 * Set global attribute. 02127 * The vGenerator does not have attributes, so this function does nothing. 02128 * The TaGenarator provides a re-implementation to actually set the global attribute. 02129 * 02130 * @param rAttr 02131 * Attribute 02132 */ 02133 virtual void GlobalAttributeTry(const Type& rAttr); 02134 02135 /** 02136 * Global attribute lookup. 02137 * In a context where the attribute type is known, 02138 * you may prefer the TaGenerator method. 02139 */ 02140 virtual const AttributeVoid& GlobalAttribute(void) const; 02141 02142 02143 /** 02144 * Get attribute pointer 02145 * The global attribute allways exits. For the vGenerator its of 02146 * type AttributeVoid, the TaGenerator sets a nontrivial type. 02147 * In a context where the attribute type is known, 02148 * you may prefer the TaGenerator method. 02149 */ 02150 virtual AttributeVoid* GlobalAttributep(void); 02151 02152 02153 /** @} doxygen group */ 02154 02155 02156 02157 /***************************************** 02158 ***************************************** 02159 ***************************************** 02160 *****************************************/ 02161 02162 /** @name Reachability */ 02163 /** @{ doxygen group */ 02164 02165 02166 /** 02167 * Compute set of accessible states 02168 */ 02169 StateSet AccessibleSet(void) const; 02170 02171 /** 02172 * Make generator accessible. 02173 * 02174 * @return 02175 * True if generator contains at least one initial state 02176 */ 02177 bool Accessible(void); 02178 02179 /** 02180 * Check if generator is accessible 02181 * 02182 * @return 02183 * True if generator is accesssible 02184 */ 02185 bool IsAccessible(void) const; 02186 02187 /** 02188 * Compute set of Coaccessible states 02189 */ 02190 StateSet CoaccessibleSet(void) const; 02191 02192 /** 02193 * Make generator Coaccessible 02194 * 02195 * @return 02196 * True if generator contains at least one marked state 02197 */ 02198 bool Coaccessible(void); 02199 02200 /** 02201 * Check if generator is Coaccessible 02202 * 02203 * @return 02204 * True if generator is coaccessible 02205 */ 02206 bool IsCoaccessible(void) const; 02207 02208 /** 02209 * Compute set of blocking states. 02210 * 02211 * A state is considered blocking it is accessible but not coaccessible. 02212 */ 02213 StateSet BlockingStates(void) const; 02214 02215 02216 /** 02217 * Compute set of terminal states. 02218 * 02219 * A terminal state is a state with no successor state. 02220 * If and only if the set of terminal states is empty, the generator is complete. 02221 * @return 02222 * Set of terminal states. 02223 */ 02224 StateSet TerminalStates(void) const; 02225 02226 02227 /** 02228 * Compute set of terminal states. 02229 * 02230 * A terminal state is a state with no successor state. 02231 * This function returns the the set terminal states contained 02232 * in the specified state ste. 02233 * 02234 * @param rStates 02235 * Set of state indices to restrict the search 02236 * @return 02237 * Set of terminal states. 02238 */ 02239 StateSet TerminalStates(const StateSet& rStates) const; 02240 02241 /** 02242 * Make generator Complete. 02243 * 02244 * This procedure removes all states that are guaranteed to evolve 02245 * into a terminal state within a finite number of transitios. 02246 * The current implementations in initialized by 02247 * the set of terminal states and then performs a backward 02248 * reachability analysis. 02249 * 02250 * @return 02251 * True if generator contains at least one initial state 02252 */ 02253 bool Complete(void); 02254 02255 /** 02256 * Check if generator is complete. 02257 * 02258 * A generator is considered complete, if each state has at least 02259 * one successor state. If the generator is trim, completeness 02260 * is equivalent to completeness of the markede language, ie 02261 * forall s in Lm(G) there exists r in Lm(G) with s<r 02262 * @return 02263 * True if generator is complete 02264 */ 02265 bool IsComplete(void) const; 02266 02267 /** 02268 * Check if generator is complete. 02269 * 02270 * Same as IsComplete(void), however, only the specified 02271 * states are considered. The rational is to e.g. apply the test 02272 * to accessible states only. In that case, the test is equivalent 02273 * to completeness of the generated language. 02274 * 02275 * @param rStates 02276 * Set of state indices to restrict the completeness test 02277 * @return 02278 * True if generator is relatively complete 02279 */ 02280 bool IsComplete(const StateSet& rStates) const; 02281 02282 02283 /** 02284 * Compute set of trim states 02285 */ 02286 StateSet TrimSet(void) const; 02287 02288 /** 02289 * Make generator trim 02290 * 02291 * This function removes all states are not accessible or not 02292 * coaccessible. In other words: only those states are kept, that 02293 * contribute to that marked language. 02294 * 02295 * @return 02296 * True if resulting generator contains at least one initial state and at least one marked state. 02297 */ 02298 bool Trim(void); 02299 02300 /** 02301 * Check if generator is trim. 02302 * 02303 * Returns true if all states are rechable and coreachale. 02304 * 02305 * @return 02306 * True if generator is trim 02307 */ 02308 bool IsTrim(void) const; 02309 02310 02311 /** 02312 * Make generator omega-trim 02313 * 02314 * This function removes states such that the generator becomes 02315 * omega trim while not affecting the induced omega language. 02316 * 02317 * The implementation first makes the generator accessible 02318 * and then iteratively removes state that either 02319 * never reach a marked state or that are guaranteed to eventually 02320 * reach a terminal state. There might be a more efficient 02321 * approach. 02322 * 02323 * @return 02324 * True if resulting generator contains at least one initial state and at least one marked state. 02325 */ 02326 bool OmegaTrim(void); 02327 02328 02329 /** 02330 * Check if generator is omega-trim. 02331 * 02332 * Returns true if all states are accessible, coacessible, and 02333 * have a successor state. 02334 * 02335 * @return 02336 * True if generator is omega-trim 02337 */ 02338 bool IsOmegaTrim(void) const; 02339 02340 02341 02342 /** @} doxygen group */ 02343 02344 /***************************************** 02345 ***************************************** 02346 ***************************************** 02347 *****************************************/ 02348 02349 /** @name File IO */ 02350 /** @{ doxygen group */ 02351 02352 /** 02353 * Write generators alphabet to console 02354 */ 02355 void WriteAlphabet(void) const; 02356 02357 /** 02358 * Write generators alphabet to string 02359 * 02360 * @return 02361 * std::string 02362 * @exception Exception 02363 * - IO errors (id 2) 02364 */ 02365 std::string AlphabetToString(void) const; 02366 02367 /** 02368 * Write generators alphabet to tokenwriter 02369 * 02370 * @param rTw 02371 * Reference to TokenWriter 02372 * 02373 * @exception Exception 02374 * - IO errors (id 2) 02375 */ 02376 void WriteAlphabet(TokenWriter& rTw) const; 02377 02378 /** 02379 * Write a stateset to console (no re-indexing). 02380 * Uses WriteStateSet(TokenWriter& rTw, const StateSet&) const to write 02381 * the specified state set to console referring to this generators state names. 02382 * 02383 * @param rStateSet 02384 * Reference to stateset 02385 */ 02386 void WriteStateSet(const StateSet& rStateSet) const; 02387 02388 /** 02389 * Write a stateset to string (no re-indexing). 02390 * Uses WriteStateSet(TokenWriter& rTw, const StateSet&) const to write 02391 * the specified state set to a string referring to this generators state names. 02392 * 02393 * @param rStateSet 02394 * Reference to stateset 02395 * @return 02396 * std::string 02397 * @exception Exception 02398 * - IO errors (id 2) 02399 */ 02400 std::string StateSetToString(const StateSet& rStateSet) const; 02401 02402 /** 02403 * Write a stateset to formated text (no re-indexing). 02404 * Uses WriteStateSet(TokenWriter& rTw, const StateSet&) const to write 02405 * the specified state set to a string referring to this generators state names. 02406 * 02407 * @param rStateSet 02408 * Reference to stateset 02409 * @return 02410 * std::string 02411 * @exception Exception 02412 * - IO errors (id 2) 02413 */ 02414 std::string StateSetToText(const StateSet& rStateSet) const; 02415 02416 /** 02417 * Write a stateset to TokenWriter. 02418 * All native output of external state sets done with this function. 02419 * Technically, a StateSet is a set of plain indices with no references 02420 * to symbolic names. Thus, it is only the context of a Generator that provides 02421 * the symbolic names for file output. 02422 * 02423 * Output of state sets always uses the mMinStateIndexMap to re-index states. 02424 * However, this map is only set up automatically for file output. If You require 02425 * re-indexed output to e.g. a string, you must set up the map by calling SetMinStateIndexMap(). 02426 * To ensure that no re-indexing takes place, call ClearMinStateIndexMap(). 02427 * 02428 * @param rTw 02429 * Reference to TokenWriter 02430 * @param rStateSet 02431 * Reference to stateset 02432 * 02433 * @exception Exception 02434 * - IO errors (id 2) 02435 */ 02436 void WriteStateSet(TokenWriter& rTw, const StateSet& rStateSet) const; 02437 02438 /** 02439 * Write a stateset to TokenWriter (debug version, no re-indexing) 02440 * 02441 * @param rTw 02442 * Reference to TokenWriter 02443 * @param rStateSet 02444 * Reference to stateset 02445 * 02446 * @exception Exception 02447 * - IO errors (id 2) 02448 */ 02449 void DWriteStateSet(TokenWriter& rTw, const StateSet& rStateSet) const; 02450 02451 /** 02452 * Write stateset of this generator to a string (no re-indexing) 02453 * 02454 * @return 02455 * std::string 02456 * @exception Exception 02457 * - IO errors (id 2) 02458 */ 02459 std::string StatesToString(void) const; 02460 02461 /** 02462 * Write stateset of this generator to formated text (no re-indexing) 02463 * 02464 * @return 02465 * std::string 02466 * @exception Exception 02467 * - IO errors (id 2) 02468 */ 02469 std::string StatesToText(void) const; 02470 02471 /** 02472 * Write set of marked states to a string (no re-indexing) 02473 * 02474 * @return 02475 * std::string 02476 * @exception Exception 02477 * - IO errors (id 2) 02478 */ 02479 std::string MarkedStatesToString(void) const; 02480 02481 /** 02482 * Write set of initial states to a string (no re-indexing) 02483 * 02484 * @return 02485 * std::string 02486 * @exception Exception 02487 * - IO errors (id 2) 02488 */ 02489 std::string InitStatesToString(void) const; 02490 02491 /** 02492 * Write transition relation to console (no re-indexing) 02493 */ 02494 void WriteTransRel(void) const; 02495 02496 /** 02497 * Write transition relation to string (no re-indexing) 02498 */ 02499 std::string TransRelToString(void) const; 02500 02501 /** 02502 * Write transition relation to formated text (no re-indexing) 02503 */ 02504 std::string TransRelToText(void) const; 02505 02506 /** 02507 * Write transition relation to tokenwriter. 02508 * Re-indexing and symbolic state names are handled in the same way 02509 * as with state sets: this function refers to the generators state symboltable to 02510 * obtain state names and uses the mMinStateIndexMap to re-index the output. 02511 * 02512 * @param rTw 02513 * Reference to TokenWriter 02514 * 02515 * @exception Exception 02516 * - IO errors (id 2) 02517 */ 02518 void WriteTransRel(TokenWriter& rTw) const; 02519 02520 /** 02521 * Write transition relation to tokenwriter (debug version) 02522 * @param rTw 02523 * Reference to TokenWriter 02524 * 02525 * @exception Exception 02526 * - IO errors (id 2) 02527 */ 02528 void DWriteTransRel(TokenWriter& rTw) const; 02529 02530 02531 /** 02532 * Writes generator to dot input format. 02533 * The dot file format is specified by the graphiz package; see http://www.graphviz.org. 02534 * The package includes the dot command line tool to generate a graphical 02535 * representation of the generators graph. See also GraphWrite(). 02536 * This functions sets the re-indexing to minimal indices. 02537 * 02538 * @param rFileName 02539 * File to write 02540 * 02541 * @exception Exception 02542 * - IO errors (id 2) 02543 */ 02544 virtual void DotWrite(const std::string& rFileName) const; 02545 02546 /** 02547 * Writes generator to dot input format (no re-indexing). 02548 * Variant of DotWrite() without re-indexing. 02549 * 02550 * @param rFileName 02551 * File to write 02552 * 02553 * @exception Exception 02554 * - IO errors (id 2) 02555 */ 02556 virtual void DDotWrite(const std::string& rFileName) const; 02557 02558 /** 02559 * Writes generator to dot input format for export to VioLib. 02560 * Variant of DotWrite() using strategic state and event names 02561 * to simplify import to VioLib (qt widget for graphical representation 02562 * of FAUDES generators). 02563 * 02564 * @param rFileName 02565 * File to write 02566 * @exception Exception 02567 * - IO errors (id 2) 02568 */ 02569 virtual void XDotWrite(const std::string& rFileName) const; 02570 02571 /** 02572 * Read a state set. 02573 * Refer to the generators state symboltable while reading a state set. 02574 * Ignore any attributes. 02575 * 02576 * @param rTr 02577 * Reference to TokenReader 02578 * @param rLabel 02579 * Label of set in source 02580 * @param rStateSet 02581 * Destination state set 02582 * 02583 * @exception Exception 02584 * - IO errors (id 1) 02585 * - token mismatch (id 50, 51, 52, 80, 85) 02586 */ 02587 void ReadStateSet(TokenReader& rTr, const std::string& rLabel, StateSet& rStateSet) const; 02588 02589 02590 /** 02591 * Test whether file-i/o uses minimal state indicees. 02592 * 02593 * @return 02594 * True when minimal state indicees are enabled 02595 */ 02596 bool ReindexOnWrite(void) const; 02597 02598 /** 02599 * Enable/disable minimal state indicees for file-i/o. 02600 * 02601 * @param flag 02602 * True enables reindexing. 02603 */ 02604 void ReindexOnWrite(bool flag); 02605 02606 02607 /** 02608 * Enable/disable reindexing states for file-i/o. 02609 * 02610 * Set default value for re-indexing. Initially, the default 02611 * is set to "false". 02612 * 02613 * @param flag 02614 * True enables reindexing. 02615 */ 02616 static void ReindexOnWriteDefault(bool flag); 02617 02618 02619 /** 02620 * Enable/disable reindexing states for file-i/o. 02621 * 02622 * Set default value for re-indexing. 02623 * 02624 * @return 02625 * True for reindexing enabled. 02626 */ 02627 static bool ReindexOnWriteDefault(void); 02628 02629 02630 /** @} doxygen group */ 02631 02632 02633 /***************************************** 02634 ***************************************** 02635 ***************************************** 02636 *****************************************/ 02637 02638 /** @name Misc */ 02639 /** @{ doxygen group */ 02640 02641 /** 02642 * Return used events (executed in transitions) 02643 * 02644 * @return EventSet 02645 */ 02646 EventSet UsedEvents(void) const; 02647 02648 /** 02649 * Return unused events 02650 * 02651 * @return EventSet 02652 */ 02653 EventSet UnusedEvents(void) const; 02654 02655 /** 02656 * Set the alphabet to used events 02657 */ 02658 void MinimizeAlphabet(void); 02659 02660 /** 02661 * Return active event set at state x1 02662 * 02663 * @param x1 02664 * Index of x1 02665 * 02666 * @return EventSet 02667 */ 02668 EventSet ActiveEventSet(Idx x1) const; 02669 02670 /** 02671 * Return active transition set at state x1 02672 * 02673 * @param x1 02674 * Index of x1 02675 * 02676 * @return EventSet 02677 */ 02678 TransSet ActiveTransSet(Idx x1) const; 02679 02680 /** 02681 * Return the states covered by transitions 02682 * 02683 * @return StateSet 02684 */ 02685 StateSet TransRelStateSpace(void) const; 02686 02687 /** 02688 * Return the successor states of state x1 02689 * 02690 * @return StateSet 02691 */ 02692 StateSet TransRelStateSpace(Idx x1) const; 02693 02694 /** 02695 * Return the successor states of state x1 with event ev 02696 * 02697 * @return StateSet 02698 */ 02699 StateSet TransRelStateSpace(Idx x1, Idx ev) const; 02700 02701 /** 02702 * Check if generator is deterministic. 02703 * 02704 * We require the transition relation to be a partial function 02705 * and at most one initial state. 02706 * 02707 * Note: pre 2.19 libFAUDES also insisted in exactly one initial state. 02708 * 02709 * 02710 * @return 02711 * True if generator is deterministic 02712 */ 02713 bool IsDeterministic(void) const; 02714 02715 /** 02716 * Set minimal index map for file io of generator states 02717 * 02718 * This function is implemented as fake-const to allow for 02719 * const Write function. 02720 * 02721 */ 02722 void SetMinStateIndexMap(void) const; 02723 02724 /** 02725 * Clear minimal index map for 1:1 file io 02726 * 02727 */ 02728 void ClearMinStateIndexMap(void) const; 02729 02730 /** 02731 * Get state index as is it will be written to file. 02732 * 02733 * @param index 02734 * state index 02735 * @return 02736 * minimal index 02737 */ 02738 Idx MinStateIndex(Idx index) const; 02739 02740 02741 /** 02742 * Re-enumerate states. 02743 * 02744 * This method re-enumerates states such that the resulting 02745 * state set consist of consecutive indexes; i.e. Size()=MaxStateIndex(). 02746 * The current implementation sets up the minimal-state-index map used for 02747 * file i/o and applies it to the state set and the transition relation. 02748 * 02749 * Note: libFAUDES does not maintain consecutive state indices. 02750 * This was a design decision and it comes pros and cons. The method MinStateIndex() 02751 * was implemented to provide some limited support for the implementation of algorithms in a 02752 * consecutive state enumeration paradigm. However, mixing both paradigms most likely 02753 * involves an overall performace penalty. 02754 */ 02755 void MinStateIndex(void); 02756 02757 02758 /** 02759 * Get maximum state index used in this generator. 02760 * Returns 0 if no states at all. 02761 * @return 02762 * maximal index 02763 */ 02764 Idx MaxStateIndex(void) const; 02765 02766 02767 /** 02768 * Get state index translation map 02769 * 02770 * @return 02771 * minimal index map 02772 */ 02773 const std::map<Idx,Idx>& MinStateIndexMap(void) const; 02774 02775 02776 /** 02777 * Pretty printable event name for index (eg for debugging). 02778 * 02779 * @param index 02780 * Event index 02781 * 02782 * @return 02783 * std::string 02784 */ 02785 std::string EStr(Idx index) const; 02786 02787 /** 02788 * Return pretty printable state name for index (eg for debugging) 02789 * 02790 * @param index 02791 * State index 02792 * 02793 * @return 02794 * std::string 02795 */ 02796 std::string SStr(Idx index) const; 02797 02798 02799 /** 02800 * Return pretty printable transition (eg for debugging) 02801 * 02802 * @param rTrans 02803 * Transition 02804 * 02805 * @return 02806 * std::string 02807 */ 02808 std::string TStr(const Transition& rTrans) const; 02809 02810 02811 /** 02812 * Produce graphical representation of this generator. 02813 * This method calls the generator's DotWrite function and then processes the output 02814 * with the dot tool from graphiz package. If no output format is given, 02815 * try to guess from filename extension. See also ProcessDot(). 02816 * 02817 * @param rFileName 02818 * Name of output file 02819 * @param rOutFormat 02820 * Graphics file format, eg "png", "jpg", "svg" 02821 * @param rDotExec 02822 * path/name of executable 02823 * @exception Exception 02824 * - IO errors (id 2) 02825 * - error during systemcall for dot (id 3) 02826 */ 02827 void GraphWrite(const std::string& rFileName, const std::string& rOutFormat="", 02828 const std::string& rDotExec="dot") const; 02829 02830 /** 02831 * Order for sorting containers of generators 02832 */ 02833 bool operator < (const vGenerator& rOtherGen) const { 02834 return (mId < rOtherGen.mId); 02835 } 02836 02837 02838 /** @} doxygen group */ 02839 02840 02841 protected: 02842 02843 /** Name of generator */ 02844 std::string mMyName; 02845 02846 /** Number of generator */ 02847 Idx mId; 02848 02849 /** Number of generator objects */ 02850 static Idx msObjectCount; 02851 02852 /** State symbol table (local per Generator)*/ 02853 SymbolTable mStateSymbolTable; 02854 02855 /** Pointer to State symbol table */ 02856 SymbolTable* mpStateSymbolTable; 02857 02858 /** Pointer to Event symbol table */ 02859 SymbolTable* mpEventSymbolTable; 02860 02861 /** Automatic state names */ 02862 bool mStateNamesEnabled; 02863 02864 /** Default for automatic statenames */ 02865 static bool msStateNamesEnabledDefault; 02866 02867 /** Reindex states on file-i/o */ 02868 bool mReindexOnWrite; 02869 02870 /** Default for automatic statenames */ 02871 static bool msReindexOnWriteDefault; 02872 02873 /** Pointer to alphabet (actual type depends on attributes) */ 02874 EventSet* mpAlphabet; 02875 02876 /** Pointer to state set (actual type depends on attributes) */ 02877 StateSet* mpStates; 02878 02879 /** Pointer to ransition relation (actual type depends on attributes) */ 02880 TransSet* mpTransRel; 02881 02882 /** Pointer to lobal attribute (actual type depends on attributes) */ 02883 AttributeVoid* mpGlobalAttribute; 02884 02885 /** Pointer to alphabet prototype (incl. attribute type) */ 02886 const EventSet* pAlphabetPrototype; 02887 02888 /** Pointer to state set prototype (incl. attribute type) */ 02889 const StateSet* pStatesPrototype; 02890 02891 /** Pointer to transition relation prototype (incl. attribute type) */ 02892 const TransSet* pTransRelPrototype; 02893 02894 /** Pointer to global attribute prototype (configures global attribute type) */ 02895 const AttributeVoid* pGlobalPrototype; 02896 02897 /** Static default alphabet prototype (incl. attribute type) */ 02898 static const EventSet& AlphabetVoid(void); 02899 02900 /** Static default state set prototype (incl. attribute type) */ 02901 static const StateSet& StatesVoid(void); 02902 02903 /** Static default transition relation prototype (incl. attribute type) */ 02904 static const TransSet& TransRelVoid(void); 02905 02906 /** Static default global attribute prototype (configures global attribute type) */ 02907 static const AttributeVoid& GlobalVoid(void); 02908 02909 /** Initial states */ 02910 StateSet mInitStates; 02911 02912 /** Marked states */ 02913 StateSet mMarkedStates; 02914 02915 /** Map State indices to consecutive indices */ 02916 std::map<Idx,Idx> mMinStateIndexMap; 02917 02918 /** Allocate my heap members (attribute dependent types) */ 02919 virtual void NewCore(void); 02920 02921 /** Free my heap members (attribute dependent types) */ 02922 virtual void DeleteCore(void); 02923 02924 /** Callback for core update */ 02925 virtual void UpdateCore(void); 02926 02927 /** Configure attribute types */ 02928 void ConfigureAttributeTypes(const AttributeVoid* pNewGlobalPrototype, 02929 const StateSet* pNewStatesPrototype, const EventSet* pNewAlphabetPrototype, 02930 const TransSet* pNewTransRelPrototype); 02931 02932 /** 02933 * Read generator object from TokenReader, see Type::Read for public wrappers. 02934 * 02935 * Virtual function for std token io interface. Context is ignored, 02936 * label defaults to "Generator". 02937 * 02938 * @param rTr 02939 * TokenReader to read from 02940 * @param rLabel 02941 * Section to read 02942 * @param pContext 02943 * Read context to provide contextual information (ignored) 02944 * 02945 * @exception Exception 02946 * - token mismatch (id 50, 51, 52, 80, 85) 02947 * - IO error (id 1) 02948 */ 02949 virtual void DoRead(TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0); 02950 02951 /** 02952 * Write generator to TokenWriter, see Type::Write for public wrappers. 02953 * 02954 * Virtual function for std token io interface. Context is ignored, 02955 * label defaults to "Generator". If the tokenwriter writes to a file, 02956 * state indices will be re-indext to start from 1. 02957 * 02958 * @param rTw 02959 * Reference to TokenWriter 02960 * @param rLabel 02961 * Label of section to write 02962 * @param pContext 02963 * Write context to provide contextual information (ignored) 02964 * 02965 * @exception Exception 02966 * - IO errors (id 2) 02967 */ 02968 virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="",const Type* pContext=0) const; 02969 02970 /** 02971 * Write generator in debugging format to TokenWriter, see Type::DWrite for public wrappers. 02972 * 02973 * Reimplement this method in derived classes to provide the std token io 02974 * interface defined in the public section of Type. 02975 * 02976 * @param rTw 02977 * Reference to TokenWriter 02978 * @param rLabel 02979 * Label of section to write 02980 * @param pContext 02981 * Write context to provide contextual information (ignored) 02982 * 02983 * @exception Exception 02984 * - IO errors (id 2) 02985 */ 02986 virtual void DoDWrite(TokenWriter& rTw, const std::string& rLabel="",const Type* pContext=0) const; 02987 02988 /** 02989 * Write generator statistics as comment to TokenWriter, see Type::SWrite for public wrappers. 02990 * 02991 * Reimplement this method in derived classes to provide the std token io 02992 * interface defined in the public section of Type. 02993 * 02994 * @param rTw 02995 * Reference to TokenWriter 02996 * 02997 * @exception Exception 02998 * - IO errors (id 2) 02999 */ 03000 virtual void DoSWrite(TokenWriter& rTw) const; 03001 03002 /** 03003 * Write generator to TokenWriter, see Type::XWrite for public wrappers. 03004 * 03005 * Virtual function for std token io interface. Context is ignored, 03006 * label defaults to "Generator". 03007 * 03008 * @param rTw 03009 * Reference to TokenWriter 03010 * @param rLabel 03011 * Label of section to write 03012 * @param pContext 03013 * Write context to provide contextual information (ignored) 03014 * 03015 * @exception Exception 03016 * - IO errors (id 2) 03017 */ 03018 virtual void DoXWrite(TokenWriter& rTw, const std::string& rLabel="",const Type* pContext=0) const; 03019 03020 /** 03021 * Read the generator's name from a file 03022 * 03023 * @param rFileName 03024 * File to read from 03025 * 03026 * @exception Exception 03027 * - IO errors (id 1) 03028 * - token mismatch (id 50, 51, 52) 03029 */ 03030 void ReadGeneratorName(const std::string& rFileName); 03031 03032 /** 03033 * Read the generator's name from a TokenReader 03034 * 03035 * @param rTr 03036 * Reference to TokenReader 03037 * 03038 * @exception Exception 03039 * - IO errors (id 1) 03040 * - token mismatch (id 50, 51, 52) 03041 */ 03042 void ReadGeneratorName(TokenReader& rTr); 03043 03044 /** 03045 * Read the generator's alphabet from a file. 03046 * 03047 * @param rFileName 03048 * File to read from 03049 * 03050 * @exception Exception 03051 * - IO errors (id 1) 03052 * - token mismatch (id 50, 51, 52) 03053 */ 03054 void ReadAlphabet(const std::string& rFileName); 03055 03056 /** 03057 * Read the generator's alphabet from a TokenReader 03058 * 03059 * @param rTr 03060 * Reference to TokenReader 03061 * 03062 * @exception Exception 03063 * - IO errors (id 1) 03064 * - token mismatch (id 50, 51, 52) 03065 */ 03066 void ReadAlphabet(TokenReader& rTr); 03067 03068 /** 03069 * Read the generator's state set from a file. 03070 * This sets up the StateSymbolTable. In contrast 03071 * to ReadStateSet(), this version will accept 03072 * explicit symbol table information. 03073 * 03074 * @param rFileName 03075 * File to read from 03076 * 03077 * @exception Exception 03078 * - IO errors (id 1) 03079 * - token mismatch (id 50, 51, 52) 03080 */ 03081 void ReadStates(const std::string& rFileName); 03082 03083 /** 03084 * Write generators stateset to TokenWriter. 03085 * 03086 * This method differs from the general purpos version 03087 * WriteStateSet(TokenWriter&, const StateSet&) in that it 03088 * can optionally write an explicit symbol table for state names. 03089 * This will happen whenever writing is done without re-indexing 03090 * states. 03091 * 03092 * @param rTw 03093 * Reference to TokenWriter 03094 * @param rStateSet 03095 * Reference to stateset 03096 * 03097 * @exception Exception 03098 * - IO errors (id 2) 03099 */ 03100 void WriteStates(TokenWriter& rTw) const; 03101 03102 /** 03103 * Read the generator's stateset from a TokenReader. 03104 * This sets up the StateSymbolTable 03105 * 03106 * @param rTr 03107 * Reference to TokenReader 03108 * 03109 * @exception Exception 03110 * - IO errors (id 1) 03111 * - token mismatch (id 50, 51, 52) 03112 */ 03113 void ReadStates(TokenReader& rTr); 03114 03115 /** 03116 * Read a stateset from TokenReader in XML format. 03117 * 03118 * This version for file IO supports the XML format introduced with libFAUDES 2.20. 03119 * Note that for Generators and derived classes, the native libFAUDES token 03120 * format is considered the default. To read XML fromated data, 03121 * use the XRead() interface. 03122 * 03123 * @param rTr 03124 * Reference to TokenReader 03125 * @param rStateSet 03126 * Reference to stateset 03127 * @param rLabel 03128 * Section name, defaults to name of set 03129 * 03130 * @exception Exception 03131 * - IO errors (id 1) 03132 * - token mismatch (id 50, 51, 52) 03133 */ 03134 void XReadStateSet(TokenReader& rTr, StateSet& rStateSet, const std::string& rLabel="") const; 03135 03136 /** 03137 * Read the generator's transition relation from a file. 03138 * 03139 * @param rFileName 03140 * File to read from 03141 * 03142 * @exception Exception 03143 * - IO errors (id 1) 03144 * - token mismatch (id 50, 51, 52) 03145 */ 03146 void ReadTransRel(const std::string& rFileName); 03147 03148 /** 03149 * Read the generator's transition relation from a TokenReader. 03150 * 03151 * @param rTr 03152 * Reference to TokenReader 03153 * 03154 * @exception Exception 03155 * - IO errors (id 1) 03156 * - token mismatch (id 50, 51, 52) 03157 */ 03158 void ReadTransRel(TokenReader& rTr); 03159 03160 /** 03161 * Read the generator's transition relation from a TokenReader. 03162 * 03163 * @param rTr 03164 * Reference to TokenReader 03165 * 03166 * @exception Exception 03167 * - IO errors (id 1) 03168 * - token mismatch (id 50, 51, 52) 03169 */ 03170 void XReadTransRel(TokenReader& rTr); 03171 03172 /** 03173 * Write a stateset to TokenWriter in XML format. 03174 * 03175 * This version for file IO supports the XML format introduced with libFAUDES 2.20. 03176 * Note that for Generators and derived classes, the native libFAUDES token 03177 * format is considered the default. To obtain XML fromated output of a Generator, 03178 * use the XWrite() interface. 03179 * 03180 * @param rTw 03181 * Reference to TokenWriter 03182 * @param rStateSet 03183 * Reference to stateset 03184 * @param rLabel 03185 * Section name, defaults to name of set 03186 * 03187 * @exception Exception 03188 * - IO errors (id 2) 03189 */ 03190 void XWriteStateSet(TokenWriter& rTw, const StateSet& rStateSet, const std::string& rLabel="") const; 03191 03192 /** 03193 * Write transition relation to tokenwriter in XML format. 03194 * 03195 * This version for file IO supports the XML format introduced with libFAUDES 2.20. 03196 * Note that for Generators and derived classes, the native libFAUDES token 03197 * format is considered the default. To obtain XML fromated output of a Generator, 03198 * use the XWrite() interface. 03199 * 03200 * 03201 * @param rTw 03202 * Reference to TokenWriter 03203 * 03204 * @exception Exception 03205 * - IO errors (id 2) 03206 */ 03207 void XWriteTransRel(TokenWriter& rTw) const; 03208 03209 03210 }; 03211 03212 /** 03213 * Plain generator, api typedef for generator with no attributes. 03214 * \ingroup GeneratorClasses 03215 */ 03216 typedef vGenerator Generator; 03217 03218 /** 03219 * Convenience typedef for vectors og generators 03220 * \ingroup GeneratorClasses 03221 */ 03222 typedef TBaseVector<Generator> GeneratorVector; 03223 03224 03225 /** 03226 * RTI wrapper function. See also vGenerator::IsAccessible(). 03227 * \ingroup GeneratorFunctions 03228 */ 03229 bool IsAccessible(const vGenerator& rGen); 03230 03231 /** 03232 * RTI wrapper function. See also vGenerator::IsCoaccessible(). 03233 * \ingroup GeneratorFunctions 03234 */ 03235 bool IsCoaccessible(const vGenerator& rGen); 03236 03237 /** 03238 * RTI wrapper function. See also vGenerator::IsTrim(). 03239 * \ingroup GeneratorFunctions 03240 */ 03241 bool IsTrim(const vGenerator& rGen); 03242 03243 /** 03244 * RTI wrapper function. See also vGenerator::IsOmegaTrim(). 03245 * \ingroup GeneratorFunctions 03246 */ 03247 bool IsOmegaTrim(const vGenerator& rGen); 03248 03249 /** 03250 * RTI wrapper function. See also vGenerator::IsComplete(). 03251 * \ingroup GeneratorFunctions 03252 */ 03253 bool IsComplete(const vGenerator& rGen); 03254 03255 /** 03256 * RTI wrapper function. See also vGenerator::IsDeterministic(). 03257 * \ingroup GeneratorFunctions 03258 */ 03259 bool IsDeterministic(const vGenerator& rGen); 03260 03261 03262 /** 03263 * RTI wrapper function. See also vGenerator::Accessible(). 03264 * \ingroup GeneratorFunctions 03265 */ 03266 void Accessible(vGenerator& rGen); 03267 03268 /** 03269 * RTI wrapper function. See also vGenerator::Accessible(). 03270 * \ingroup GeneratorFunctions 03271 */ 03272 void Accessible(const vGenerator& rGen, vGenerator& rRes); 03273 03274 /** 03275 * RTI wrapper function. See also vGenerator::Coaccessible(). 03276 * \ingroup GeneratorFunctions 03277 */ 03278 void Coaccessible(vGenerator& rGen); 03279 03280 /** 03281 * RTI wrapper function. See also vGenerator::Coaccessible(). 03282 * \ingroup GeneratorFunctions 03283 */ 03284 void Coaccessible(const vGenerator& rGen, vGenerator& rRes); 03285 03286 /** 03287 * RTI wrapper function. See also vGenerator::Complete(). 03288 * \ingroup GeneratorFunctions 03289 */ 03290 void Complete(vGenerator& rGen); 03291 03292 /** 03293 * RTI wrapper function. See also vGenerator::Complete(). 03294 * \ingroup GeneratorFunctions 03295 */ 03296 void Complete(const vGenerator& rGen, vGenerator& rRes); 03297 03298 /** 03299 * RTI wrapper function. See also vGenerator::Trim(). 03300 * \ingroup GeneratorFunctions 03301 */ 03302 void Trim(vGenerator& rGen); 03303 03304 /** 03305 * RTI wrapper function. See also vGenerator::Trim(). 03306 * \ingroup GeneratorFunctions 03307 */ 03308 void Trim(const vGenerator& rGen, vGenerator& rRes); 03309 03310 /** 03311 * RTI wrapper function. See also vGenerator::OmegaTrim(). 03312 * \ingroup GeneratorFunctions 03313 */ 03314 void OmegaTrim(vGenerator& rGen); 03315 03316 /** 03317 * RTI wrapper function. See also vGenerator::OmegaTrim(). 03318 * \ingroup GeneratorFunctions 03319 */ 03320 void OmegaTrim(const vGenerator& rGen, vGenerator& rRes); 03321 03322 /** 03323 * RTI wrapper function. 03324 * \ingroup GeneratorFunctions 03325 */ 03326 void MarkAllStates(vGenerator& rGen); 03327 03328 /** 03329 * RTI wrapper function. 03330 * \ingroup GeneratorFunctions 03331 */ 03332 void AlphabetExtract(const vGenerator& rGen, EventSet& rRes); 03333 03334 03335 /** 03336 * RTI convenience function. 03337 */ 03338 void SetIntersection(const vGenerator& rGenA, const vGenerator& rGenB, EventSet& rRes); 03339 03340 /** 03341 * RTI convenience function. 03342 */ 03343 void SetIntersection(const GeneratorVector& rGenVec, EventSet& rRes); 03344 03345 /** 03346 * RTI convenience function. 03347 */ 03348 void SetUnion(const vGenerator& rGenA, const vGenerator& rGenB, EventSet& rRes); 03349 03350 /** 03351 * RTI convenience function. 03352 */ 03353 void SetUnion(const GeneratorVector& rGenVec, EventSet& rRes); 03354 03355 /** 03356 * RTI convenience function. 03357 */ 03358 void SetDifference(const vGenerator& rGenA, const vGenerator& rGenB, EventSet& rRes); 03359 03360 03361 03362 03363 } // namespace faudes 03364 03365 /* 03366 03367 #define FAUDES_GENERATOR_DECLARATION(gtype,GlobalAttr,StateAttr,EventAttr,TransAttr) \ 03368 public: \ 03369 virtual void EventAttribute(Idx index, const EventAttr& rAttr); \ 03370 virtual void EventAttributes(const TaEventSet<EventAttr>& rEventSet); \ 03371 virtual const EventAttr& EventAttribute(Idx index) const; \ 03372 virtual const EventAttr& EventAttribute(const std::string& rName) const; \ 03373 virtual EventAttr* EventAttributep(Idx index); \ 03374 virtual EventAttr* EventAttributep(const std::string& rName); \ 03375 virtual void StateAttribute(Idx index, const StateAttr& rAttr); \ 03376 virtual const StateAttr& StateAttribute(Idx index) const; \ 03377 virtual StateAttr* StateAttributep(Idx index); \ 03378 virtual void TransAttribute(const Transition& rTrans, const TransAttr& rAttr); \ 03379 virtual const TransAttr& TransAttribute(const Transition& rTrans) const; \ 03380 virtual TransAttr* TransAttributep(const Transition& rTrans); \ 03381 virtual void GlobalAttribute(const GlobalAttr& rAttr); \ 03382 virtual void GlobalAttributeTry(const Type& rAttr); \ 03383 virtual const GlobalAttr& GlobalAttribute(void) const; \ 03384 virtual GlobalAttr* GlobalAttributep(void); 03385 03386 #define FAUDES_GENERATOR_IMPLEMENTATION(gtype,GlobalAttr,StateAttr,EventAttr,TransAttr) \ 03387 public: \ 03388 virtual void EventAttribute(Idx index, const EventAttr& rAttr); \ 03389 virtual void EventAttributes(const TaEventSet<EventAttr>& rEventSet); \ 03390 virtual const EventAttr& EventAttribute(Idx index) const; \ 03391 virtual const EventAttr& EventAttribute(const std::string& rName) const; \ 03392 virtual EventAttr* EventAttributep(Idx index); \ 03393 virtual EventAttr* EventAttributep(const std::string& rName); \ 03394 virtual void StateAttribute(Idx index, const StateAttr& rAttr); \ 03395 virtual const StateAttr& StateAttribute(Idx index) const; \ 03396 virtual StateAttr* StateAttributep(Idx index); \ 03397 virtual void TransAttribute(const Transition& rTrans, const TransAttr& rAttr); \ 03398 virtual const TransAttr& TransAttribute(const Transition& rTrans) const; \ 03399 virtual TransAttr* TransAttributep(const Transition& rTrans); \ 03400 virtual void GlobalAttribute(const GlobalAttr& rAttr); \ 03401 virtual void GlobalAttributeTry(const Type& rAttr); \ 03402 virtual const GlobalAttr& GlobalAttribute(void) const; \ 03403 virtual GlobalAttr* GlobalAttributep(void); 03404 03405 */ 03406 03407 03408 #endif 03409 |
libFAUDES 2.22s --- 2013.10.07 --- c++ source docu by doxygen