cfl_agenerator.h
Go to the documentation of this file.
1 /** @file cfl_agenerator.h Attributed generator class TaGenerator */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5 Copyright (C) 2006 Bernd Opitz
6 Copyright (C) 2007 Thomas Moor
7 Exclusive copyright is granted to Klaus Schmidt
8 
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13 
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 
24 #ifndef FAUDES_AGENERATOR_H
25 #define FAUDES_AGENERATOR_H
26 
27 #include "cfl_definitions.h"
28 #include "cfl_exception.h"
29 #include "cfl_symboltable.h"
30 #include "cfl_indexset.h"
31 #include "cfl_nameset.h"
32 #include "cfl_transset.h"
33 #include "cfl_token.h"
34 #include "cfl_tokenreader.h"
35 #include "cfl_tokenwriter.h"
36 #include "cfl_generator.h"
37 #include <map>
38 #include <set>
39 #include <sstream>
40 #include <cstdlib>
41 #include <assert.h>
42 
43 namespace faudes {
44 
45 /**
46  * Generator with specified attribute types.
47  *
48  * @section AGeneratorOverview Overview
49  *
50  * The TaGenerator takes four template parameters to specify attribute classes for
51  * the global attribute and state-, event- and transition-attributes.
52  *
53  * In the context of a TaGenerator, attributes still have only minimal sematics: they can be
54  * accessed in a per event, state and transition manner and they can have default or non-default value.
55  * The minimum interface that an attribute template parameter must provide, is given in
56  * faudes::AttributeVoid. Derived attribute classes are meant to provide addtional semantics, eg
57  * faudes::AttributeFlags for boolean flags and faudes::AttributeCFlags for controllability properties.
58  * The TaGenerator transparently supports extended attribute semantics, but does not provide
59  * taylored access functions. This is done in TaGenerator
60  * derivates eg TcGenerator.
61  *
62  * Technical detail: Attributes data types must be derived from AttributeVoid, which in turn is derived from
63  * the general purpose base faudes::Type. For your derived attribute class to be fully functional,
64  * you must reimplement the faudes::Type::New().
65  *
66  * @ingroup GeneratorClasses
67  */
68 
69 template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
71  public:
72 
73  /** Convenience typdef for member transiton set */
75 
76 
77  /*****************************************
78  *****************************************
79  *****************************************
80  *****************************************/
81 
82  /** @name Constructors & Destructor */
83  /** @{ doxygen group */
84 
85  /**
86  * Construct an emtpy Generator
87  */
88  TaGenerator(void);
89 
90  /**
91  * Copy-constructor (from TaGenerator, incl attributes)
92  *
93  * @param rOtherGen
94  */
95  TaGenerator(const TaGenerator& rOtherGen);
96 
97  /**
98  * Copy-constructor (from vGenerator, set attributes to default)
99  *
100  * @param rOtherGen
101  */
102  TaGenerator(const vGenerator& rOtherGen);
103 
104  /**
105  * Construct from file. This constructor
106  * effectively uses the Read(TokenReader&) function to read.
107  *
108  * @param rFileName
109  * Name of file
110  *
111  * @exception Exception
112  * - IO errors (id 1)
113  * - Token mismatch (id 50, 51, 52, 80, 85)
114  */
115  TaGenerator(const std::string& rFileName);
116 
117  /**
118  * Construct on heap.
119  * Technically not a constructor, this function creates a TaGenerator with the
120  * same event symboltable and the same attribute types. It is the callers reponsebilty to
121  * delete the object when no longer needed.
122  *
123  * @return
124  * new Generator
125  */
126  virtual TaGenerator* New(void) const;
127 
128  /**
129  * Construct copy on heap.
130  * Technically not a constructor, this function creates a TaGenerator with the
131  * same event symboltable and the same attribute types. It is the callers reponsebilty to
132  * delete the object when no longer needed.
133  *
134  * @return
135  * new Generator
136  */
137  virtual TaGenerator* Copy(void) const;
138 
139  /**
140  * Construct on stack.
141  * Technically not a constructor, this function creates a TaGenerator with the
142  * same event symboltable and the same attribute type.
143  *
144  * @return
145  * new Generator
146  */
147  virtual TaGenerator NewAGen(void) const;
148 
149  /**
150  * Type test.
151  * Uses C++ dynamic cast to test whether the specified object
152  * casts to a Generator.
153  *
154  * @return
155  * TcGenerator reference if dynamic cast succeeds, else NULL
156  */
157  virtual const Type* Cast(const Type* pOther) const;
158 
159 
160  /**
161  * Destructor
162  */
163  virtual ~TaGenerator(void);
164 
165  /** @} doxygen group */
166 
167  /*****************************************
168  *****************************************
169  *****************************************
170  *****************************************/
171 
172  /** @name Copy and Assignment */
173  /** @{ doxygen group */
174 
175 
176  /**
177  * Copy from other faudes Type (try to cast to agenerator or pass to base)
178  *
179  * @param rSrc
180  * Source for copy operation.
181  */
182  virtual TaGenerator& Assign(const Type& rSrc);
183 
184  /**
185  * Assignment operator (uses Assign(Generator&) )
186  *
187  * @param rOtherGen
188  * Other generator
189  */
190  virtual TaGenerator& operator= (const TaGenerator& rOtherGen);
191 
192  /**
193  * Destructive copy to other TaGenerator
194  * Copy method with increased performance at the cost of invalidating
195  * the source data. This version will copy attributes 1:1.
196  *
197  *
198  * @param rGen
199  * Destination for copy operation.
200  */
201  virtual void Move(TaGenerator& rGen);
202 
203  /**
204  * Destructive copy to other Generator.
205  * Copy method with increased performance at the cost of invalidating
206  * the source data. Convert attributes if possible.
207  *
208  *
209  * @param rGen
210  * Destination for copy operation.
211  */
212  virtual void Move(Generator& rGen);
213 
214 
215  /** @} doxygen group */
216 
217  /*****************************************
218  *****************************************
219  *****************************************
220  *****************************************/
221 
222  /** @name Basic Maintenance */
223  /** @{ doxygen group */
224 
225  /**
226  * Check if generator is valid
227  *
228  * @return
229  * Success
230  */
231  bool Valid(void) const;
232 
233 
234  /**
235  * Clear generator data.
236  * Clears state set, alphabet and transitionrealtion. Behavioural flags
237  * eg StateNamesEnabled are maintained.
238  */
239  virtual void Clear(void);
240 
241 
242 
243  /** @} doxygen group */
244 
245 
246 
247  /*****************************************
248  *****************************************
249  *****************************************
250  *****************************************/
251 
252  /** @name Read Access to Core Members */
253  /** @{ doxygen group */
254 
255  /**
256  * Return const reference to alphabet
257  *
258  * @return EventSet
259  * Reference to mpAlphabet
260  */
261  const TaEventSet<EventAttr>& Alphabet(void) const;
262 
263  /**
264  * Return reference to state set
265  *
266  * @return
267  * StateSet reference incl actual attribute type
268  */
269  const TaStateSet<StateAttr>& States(void) const;
270 
271  /**
272  * Return reference to transition relation
273  *
274  * @return TransRel
275  */
276  const ATransSet& TransRel(void) const;
277 
278  /**
279  * Get copy of trantision relation sorted by other compare
280  * operator, e.g. "x2,ev,x1"
281  *
282  * @param res
283  * resulting transition relation
284  */
285  void TransRel(TransSetX1EvX2& res) const;
286  void TransRel(TransSetEvX1X2& res) const;
287  void TransRel(TransSetEvX2X1& res) const;
288  void TransRel(TransSetX2EvX1& res) const;
289  void TransRel(TransSetX2X1Ev& res) const;
290  void TransRel(TransSetX1X2Ev& res) const;
291 
292  /** @} doxygen group */
293 
294 
295 
296  /*****************************************
297  *****************************************
298  *****************************************
299  *****************************************/
300 
301  /** @name Write Access to Core Members */
302  /** @{ doxygen group */
303 
304 
305  /**
306  * Add an existing event to alphabet by index. It is an error to insert
307  * an event index that is not known to the mpEventSymbolTable.
308  *
309  * @param index
310  * Event index
311  * @return
312  * True, if event was new to alphabet
313  */
314  bool InsEvent(Idx index);
315 
316  /**
317  * Add named event to generator. An entry in the mpEventSymbolTable will
318  * be made if event name is not known so far.
319  *
320  * @param rName
321  * Name of the event to add
322  *
323  * @return
324  * New unique index
325  */
326  Idx InsEvent(const std::string& rName);
327 
328  /**
329  * Add an existing event to alphabet by index, incl. attribute
330  * If the index allready exists, the attribute is overwritten by rAttr.
331  *
332  * @param rAttr
333  * Attribute of event
334  * @param index
335  * Event index
336  * @return
337  * True, if event was new to alphabet
338  */
339  bool InsEvent(Idx index, const EventAttr& rAttr);
340 
341  /**
342  * Add named event with attribute to generator. An entry in the
343  * mpEventSymbolTable will be made if event is not kown so far.
344  * If the event allready exits in the generator, the attribute will be
345  * overwritten by rAttr.
346  *
347  * @param rName
348  * Name of the event to add
349  * @param rAttr
350  * Attribute of event
351  *
352  * @return
353  * New unique index
354  */
355  Idx InsEvent(const std::string& rName, const EventAttr& rAttr);
356 
357  /**
358  * Set mpAlphabet without consistency check.
359  * Attributes will be casted if possible or silently ignored.
360  *
361  * @param rNewalphabet
362  * EventSet with new alphabet
363  */
364  void InjectAlphabet(const EventSet& rNewalphabet);
365 
366  /**
367  * Set mpAlphabet without consistency check.
368  *
369  * @param rNewalphabet
370  * EventSet with new alphabet
371  */
372  void InjectAlphabet(const TaEventSet<EventAttr>& rNewalphabet);
373 
374  /**
375  * Add new anonymous state to generator
376  *
377  * @return
378  * Index of new unique state
379  */
380  Idx InsState(void);
381 
382  /**
383  * Add new anonymous state with attribute to generator
384  *
385  * @param attr
386  * attribute of new state
387  *
388  * @return
389  * Index of new unique state
390  */
391  Idx InsState(const StateAttr& attr);
392 
393  /**
394  * Add (perhaps new) state to generator
395  *
396  * @return
397  * true to indicate that state was new to generator
398  */
399  bool InsState(Idx index);
400 
401  /**
402  * Add new named state to generator.
403  *
404  * @param rName
405  * Name of the state to add
406  *
407  * @return
408  * Index of new unique state
409  *
410  * @exception Exception
411  * Name already exists (id 44)
412  */
413  Idx InsState(const std::string& rName);
414 
415  /**
416  * Add new named state with attribute to generator.
417  *
418  * @param rName
419  * Name of the state to add
420  * @param attr
421  * attribute of new state
422  *
423  * @return
424  * Index of new unique state
425  * @exception Exception
426  * Name already exists (id 44)
427  */
428  Idx InsState(const std::string& rName, const StateAttr& attr);
429 
430  /**
431  * Add (perhaps new) state with attribute to generator.
432  *
433  * @param index
434  * Index of state to add
435  * @param attr
436  * Attribute of new state
437  *
438  * @return
439  * True, if event was new to alphabet
440  *
441  */
442  bool InsState(Idx index, const StateAttr& attr);
443 
444  /**
445  * Inject a complete state set without consistency checks.
446  * Attributes will be casted if possible or silently ignored.
447  *
448  * @param rNewStates
449  * StateSet
450  */
451  void InjectStates(const StateSet& rNewStates);
452 
453 
454  /**
455  * Inject a complete state set without consistency checks.
456  *
457  * @param rNewStates
458  * StateSet
459  */
460  void InjectStates(const TaStateSet<StateAttr>& rNewStates);
461 
462 
463  /**
464  * Add a transition to generator by indices. States and event
465  * must already exist!
466  *
467  * Define FAUDES_CHECKED for consistency checks.
468  *
469  * @param x1
470  * Predecessor state index
471  * @param ev
472  * Event index
473  * @param x2
474  * Successor state index
475  *
476  * @return
477  * True, if the transition was new the generator
478  *
479  * @exception Exception
480  * - state or event not in generator (id 95)
481  */
482  bool SetTransition(Idx x1, Idx ev, Idx x2);
483 
484  /**
485  * Add a transition to generator by names. Statename and eventname
486  * must already exist!
487  *
488  * @param rX1
489  * Predecessor state name
490  * @param rEv
491  * Event name
492  * @param rX2
493  * Successor state name
494  *
495  * @return
496  * True, if the transition was new the generator
497  *
498  * @exception Exception
499  * - state or event not in generator (id 95)
500  * - state name not known (id 90)
501  * - event name not known (id 66)
502  */
503  bool SetTransition(const std::string& rX1, const std::string& rEv,
504  const std::string& rX2);
505 
506  /**
507  * Add a transition to generator. States and event
508  * must already exist!
509  *
510  *
511  * @param rTransition
512  * Transition
513  *
514  * @return
515  * True, if the transition was new the generator
516  * @exception Exception
517  * - state or event not in generator (id 95)
518  */
519  bool SetTransition(const Transition& rTransition);
520 
521  /**
522  * Add a transition with attribute to generator. States and event
523  * must already exist!
524  *
525  *
526  * @param rTransition
527  * transition
528  * @param rAttr
529  * attribute
530  * @return
531  * True, if the transition was new the generator
532  * @exception Exception
533  * - state or event not in generator (id 95)
534  *
535  */
536  bool SetTransition(const Transition& rTransition, const TransAttr& rAttr);
537 
538  /**
539  * Set transition relation without consistency check.
540  * Attributes will be casted if possible or silently ignored.
541  *
542  * @param rNewtransrel
543  * TransRel to insert
544  */
545  void InjectTransRel(const TransSet& rNewtransrel);
546 
547  /**
548  * Set transition relation without consistency check.
549  *
550  * @param rNewtransrel
551  * TransRel to insert
552  */
553  void InjectTransRel(const ATransSet& rNewtransrel);
554 
555  /** @} doxygen group */
556 
557 
558 
559  /*****************************************
560  *****************************************
561  *****************************************
562  *****************************************/
563 
564  /** @name Attributes */
565  /** @{ doxygen group */
566 
567 
568  /**
569  * Set attribute for existing event
570  *
571  * @param index
572  * Event index
573  * @param rAttr
574  * New attribute
575  *
576  * @exception Exception
577  * Index not found in alphabet (id 60)
578  */
579  void EventAttribute(Idx index, const EventAttr& rAttr);
580 
581  /**
582  * Set attribute for existing event.
583  * This version uses a dynamic cast
584  * to test the actual type of the provided attribute. An exception is
585  * thrown for an invalid attribute type.
586  *
587  * @param index
588  * Event index
589  * @param rAttr
590  * New attribute
591  *
592  * @exception Exception
593  * - Index not found in alphabet (id 60)
594  * - Cannot cast attribute (id 63)
595  */
596  void EventAttribute(Idx index, const Type& rAttr);
597 
598  /**
599  * Event attribute lookup
600  *
601  * @param index
602  *
603  * @return
604  * reference to attribute
605  */
606  const EventAttr& EventAttribute(Idx index) const;
607 
608  /**
609  * Event attribute lookup
610  *
611  * @param rName
612  *
613  * @return
614  * reference to attribute
615  */
616  const EventAttr& EventAttribute(const std::string& rName) const;
617 
618  /**
619  * Event attribute pointer (to access Attribute methods)
620  * note: may insert explicit default attribute
621  *
622  * @param index
623  *
624  * @return
625  * pointer to attribute
626  */
627  EventAttr* EventAttributep(Idx index);
628 
629  /**
630  * Event attribute pointer (to access Attribute methods)
631  * note: may insert explicit default attribute
632  *
633  * @param rName
634  *
635  * @return
636  * pointer to attribute
637  */
638  EventAttr* EventAttributep(const std::string& rName);
639 
640 
641  /**
642  * Set attribute for existing state
643  *
644  * @param index
645  * Index
646  * @param rAttr
647  * attriute
648  *
649  * @exception Exception
650  * Name already associated with another index (id 44)
651  */
652  void StateAttribute(Idx index, const StateAttr& rAttr);
653 
654  /**
655  * Set attribute for existing state.
656  * This version uses a dynamic cast
657  * to test the actual type of the provided attribute. An exception is
658  * thrown for an invalid attribute type.
659  *
660  * @param index
661  * State index
662  * @param rAttr
663  * New attribute
664  *
665  * @exception Exception
666  * - Index not found in Stateset (id 60)
667  * - Cannot cast attribute (id 63)
668  */
669  void StateAttribute(Idx index, const Type& rAttr);
670 
671  /**
672  * State attribute lookup
673  *
674  * @param index
675  *
676  * @return ref to attribute of state
677  */
678  const StateAttr& StateAttribute(Idx index) const;
679 
680  /**
681  * State attribute pointer (to access Attribute methods)
682  * note: may insert explicit default attribute
683  *
684  * @param index
685  *
686  * @return pointer to attribute of state
687  */
688  StateAttr* StateAttributep(Idx index);
689 
690  /**
691  * Set attribute for existing transition
692  *
693  * @param rTrans
694  * transition
695  * @param rAttr
696  * New attribute
697  *
698  */
699  void TransAttribute(const Transition& rTrans, const TransAttr& rAttr);
700 
701  /**
702  * Set attribute for existing transition.
703  * This version uses a dynamic cast
704  * to test the actual type of the provided attribute. An exception is
705  * thrown for an invalid attribute type.
706  *
707  * @param rTrans
708  * transition
709  * @param rAttr
710  * New attribute
711  *
712  * @exception Exception
713  * - Transition not found in transition relation(id 60)
714  * - Cannot cast attribute (id 63)
715  */
716  void TransAttribute(const Transition& rTrans, const Type& rAttr);
717 
718 
719  /**
720  * Get attribute for existing transition
721  *
722  * @return
723  * attribute
724  *
725  */
726  const TransAttr& TransAttribute(const Transition& rTrans) const;
727 
728  /**
729  * Get attribute pointer for existing transition
730  * note: may insert explicit default attribute
731  *
732  * @return
733  * attribute pointer
734  *
735  */
736  TransAttr* TransAttributep(const Transition& rTrans);
737 
738  /**
739  * Set global attribute
740  *
741  * @param rAttr
742  * attribute
743  */
744  void GlobalAttribute(const GlobalAttr& rAttr) {*pGlobalAttribute=rAttr;};
745  void GlobalAttribute(const Type& rAttr) { const GlobalAttr* ap= dynamic_cast<const GlobalAttr*>(&rAttr); if(ap) *pGlobalAttribute=*ap;};
746 
747  /**
748  * Get global attribute ref
749  */
750  const GlobalAttr& GlobalAttribute(void) const {return *pGlobalAttribute;};
751 
752 
753  /**
754  * Get global attribute pointer
755  */
756  GlobalAttr* GlobalAttributep(void) {return pGlobalAttribute;};
757 
758 
759  /** @} doxygen group */
760 
761 
762 
763 
764  protected:
765 
766  /** Alphabet, pointer with actual attribute type */
768 
769  /** State set, pointer with actual attribute type */
771 
772  /** Transition relation, pointer with actual attribute type */
774 
775  /** Global attribute, pointer with actual attribute type */
776  GlobalAttr* pGlobalAttribute;
777 
778  /** Static default alphabet prototype (incl. attribute type) */
779  static const TaNameSet<EventAttr>& AlphabetTaGen(void);
780 
781  /** Static default state set prototype (incl. attribute type) */
782  static const TaIndexSet<StateAttr>& StatesTaGen(void);
783 
784  /** Static default transition relation prototype (incl. attribute type) */
785  static const ATransSet& TransRelTaGen(void);
786 
787  /** Static default global attribute prototype (configures global attribute type) */
788  static const GlobalAttr& GlobalTaGen(void);
789 
790  /** Allocate my heap members (attribute dependent types) */
791  virtual void NewCore(void);
792 
793  /** Update my secondary pointers for new core */
794  virtual void UpdateCore(void);
795 
796  /** Assignment */
797  void DoAssign(const TaGenerator& rGen);
798 
799 
800 };
801 
802 
803 
804 /* convenience access to relevant scopes */
805 #define THIS TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
806 #define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
807 #define BASE vGenerator
808 
809 // static default prototypes (construct on first use design pattern)
810 TEMP const TaNameSet<EventAttr>& THIS::AlphabetTaGen(void) {
811  static TaNameSet<EventAttr> fls;
812  return fls;
813 }
814 TEMP const TaIndexSet<StateAttr>& THIS::StatesTaGen(void) {
815  static TaIndexSet<StateAttr> fls;
816  return fls;
817 }
818 TEMP const TaTransSet<TransAttr>& THIS::TransRelTaGen(void) {
819  static TaTransSet<TransAttr> fls;
820  return fls;
821 }
822 TEMP const GlobalAttr& THIS::GlobalTaGen(void) {
823  static GlobalAttr fls;;
824  return fls;
825 }
826 
827 
828 // TaGenerator::Generator(void)
829 TEMP THIS::TaGenerator(void) :
830  // init base
831  vGenerator()
832 {
833  FD_DG("TaGenerator(" << this << ")::TaGenerator()");
834  // re-allocate core members with nontrivial attribute types
836  NewCore();
837  FD_DG("TaGenerator(" << this << ")::TaGenerator(): done");
838 }
839 
840 // TaGenerator::Generator(rOtherGen)
841 TEMP THIS::TaGenerator(const TaGenerator& rOtherGen) :
842  // init base
843  vGenerator()
844 {
845  FD_DG("TaGenerator(" << this << ")::TaGenerator(" << &rOtherGen << ")");
846  // re-allocate core members with nontrivial attribute types
848  NewCore();
849  // have a 1:1 copy (incl sym tables)
850  DoAssign(rOtherGen);
851 }
852 
853 
854 // TaGenerator::Generator(rOtherGen)
855 TEMP THIS::TaGenerator(const vGenerator& rOtherGen) :
856  // init base
857  vGenerator()
858 {
859  FD_DG("TaGenerator(" << this << ")::TaGenerator([v]" << &rOtherGen << ")");
860  // re-allocate core members with nontrivial attribute types
862  NewCore();
863  // have a 1:1 copy (incl sym tables)
864  Assign(rOtherGen);
865  FD_DG("TaGenerator(" << this << ")::TaGenerator([v]" << &rOtherGen << "): ok");
866 }
867 
868 // TaGenerator::Generator(rFileName)
869 TEMP THIS::TaGenerator(const std::string& rFileName) :
870  // init base
871  vGenerator()
872 {
873  FD_DG("TaGenerator(" << this << ")::TaGenerator(" << rFileName << ")");
874  // re-allocate core members with nontrivial attribute types
876  NewCore();
877  // set some defaults
878  mStateNamesEnabled=true;
879  // do read
880  Read(rFileName);
881  // get original statenames default
883 }
884 
885 // allocate core on heap
886 TEMP void THIS::NewCore(void) {
887  FD_DG("TaGenerator(" << this << ")::NewCore()");
888 
889  // MS Compilers did somehow mess up upcast with diamond inheritance of TaNameSet-member New()
890  // call base, incl virtual call back of UpdateCore
891  //BASE::NewCore();
892 
893  DeleteCore();
894  // allocate by our typed prototypes
895  mpAlphabet= AlphabetTaGen().New();
896  mpStates=StatesTaGen().New();
897  mpTransRel=TransRelTaGen().New();
898  mpGlobalAttribute=GlobalTaGen().New();
899  // update callback
900  UpdateCore();
901 }
902 
903 // indicate new core
904 TEMP void THIS::UpdateCore(void) {
905  // let base do an update (fixes names)
906  BASE::UpdateCore();
907  // have pointer with my attribute
908  pGlobalAttribute = dynamic_cast< GlobalAttr* >(mpGlobalAttribute);
909  pAlphabet = dynamic_cast< TaNameSet<EventAttr>* >(mpAlphabet);
910  pStates = dynamic_cast< TaIndexSet<StateAttr>* >(mpStates);
911  pTransRel = dynamic_cast< ATransSet* >(mpTransRel);
912  // check for type mismatch
913  bool tmm=false;
914  if(pGlobalAttribute==0 && mpGlobalAttribute!=0) tmm=true;
915  if(pAlphabet==0 && mpAlphabet!=0) tmm=true;
916  if(pStates==0 && mpStates!=0) tmm=true;
917  if(pTransRel==0 && mpTransRel!=0) tmm=true;
918  if(tmm) {
919  std::stringstream errstr;
920  errstr << "cannot cast attributes for generator type " << typeid(*this).name();
921  errstr << " ptrs " << pGlobalAttribute << "-" << pAlphabet << "-" << pStates << "-" << pTransRel;
922  throw Exception("Generator::UpdateCore", errstr.str(), 63);
923  }
924 }
925 
926 
927 // Copy(gen) from identical type
928 TEMP void THIS::DoAssign(const TaGenerator& rGen) {
929  FD_DG("TaGenerator(" << this << ")::DoAssign(" << &rGen << ")");
930  FD_DG("TaGenerator(" << this << ")::DoAssign(..): types " << typeid(*this).name() << " <= " << typeid(rGen).name());
931  // prepare result (call clear for virtual stuff)
932  Clear();
933  // have same event symboltable
934  EventSymbolTablep(rGen.mpEventSymbolTable);
935  // copy state symboltable
936  StateSymbolTable(rGen.mStateSymbolTable);
937  // set other members
938  Name(rGen.Name());
939  *pGlobalAttribute=*rGen.pGlobalAttribute;
940  *pStates= *rGen.pStates;
941  *pAlphabet = *rGen.pAlphabet;
942  *pTransRel= *rGen.pTransRel;
943  mInitStates = rGen.mInitStates;
944  mMarkedStates = rGen.mMarkedStates;
945  mStateNamesEnabled=rGen.mStateNamesEnabled;
946  mReindexOnWrite=rGen.mReindexOnWrite;
947  // copy add on stuff
948  mMinStateIndexMap=rGen.mMinStateIndexMap;
949 #ifdef FAUDES_DEBUG_CODE
950  if(!Valid()) {
951  FD_DG("TaGenerator()::DoAssign(): invalid generator");
952  DWrite();
953  abort();
954  }
955 #endif
956  FD_DG("TaGenerator(" << this << ")::DoAssign(" << &rGen << "): done");
957 }
958 
959 // copy from other faudes type
960 TEMP THIS& THIS::Assign(const Type& rSrc) {
961  FD_DG("TaGenerator(" << this << ")::Assign([type] " << &rSrc << ")");
962  FD_DG("TaGenerator(" << this << ")::Assign(..): types \n" << typeid(*this).name() << " <= \n" << typeid(rSrc).name());
963  FD_DG("TaGenerator(" << this << ")::Assign(..): match str " << (typeid(*this).name() == typeid(rSrc).name()));
964  FD_DG("TaGenerator(" << this << ")::Assign(..): match id " << (typeid(*this) == typeid(rSrc)));
965  // cast to this class
966  const TaGenerator* agen=dynamic_cast<const THIS*>(&rSrc);
967  FD_DG("TaGenerator(" << this << ")::Assign(..): agen " << agen);
968  // bail out on object match
969  if(this==agen) return *this;
970  // assign on type match
971  if(agen) {
972  FD_DG("TaGenerator(" << this << ")::Assign([type] " << &rSrc << "):: call aGenerator DoAssign");
973  DoAssign(*agen);
974  return *this;
975  }
976  FD_DG("TaGenerator(" << this << ")::Assign([type] " << &rSrc << "):: call vGenerator base");
977  // pass on to base
978  BASE::Assign(rSrc);
979  return *this;
980 }
981 
982 
983 // Move(gen) destructive copy
984 TEMP void THIS::Move(TaGenerator& rGen) {
985  FD_DG("TaGenerator(" << this << ")::Move(" << &rGen << ")");
986  // call base
987  BASE::Move(rGen);
988 }
989 
990 
991 // Move(gen) destructive copy
992 TEMP void THIS::Move(Generator& rGen) {
993  FD_DG("TaGenerator(" << this << ")::Move([v]" << &rGen << ")");
994  // call base
995  BASE::Move(rGen);
996 }
997 
998 // TaGenerator::~Generator
999 TEMP THIS::~TaGenerator(void) {
1000  FD_DG("TaGenerator(" << this << ")::~TaGenerator()");
1001 }
1002 
1003 // New
1004 TEMP THIS* THIS::New(void) const {
1005  // allocate
1006  THIS* res = new THIS;
1007  // fix base data
1008  res->EventSymbolTablep(BASE::mpEventSymbolTable);
1009  res->mStateNamesEnabled=BASE::mStateNamesEnabled;
1010  res->mReindexOnWrite=BASE::mReindexOnWrite;
1011  return res;
1012 }
1013 
1014 // Copy
1015 TEMP THIS* THIS::Copy(void) const {
1016  // allocate
1017  THIS* res = new THIS(*this);
1018  // done
1019  return res;
1020 }
1021 
1022 // NewAGen()
1023 TEMP THIS THIS::NewAGen(void) const {
1024  THIS res;
1025  // fix base data
1026  res.EventSymbolTablep(BASE::mpEventSymbolTable);
1027  //res.mStateNamesEnabled=BASE::mStateNamesEnabled;
1028  //res.ReindexOnWrite=BASE::mReindexOnWrite;
1029  res.StateNamesEnabled(BASE::mStateNamesEnabled);
1030  res.ReindexOnWrite(BASE::mReindexOnWrite);
1031  return res;
1032 }
1033 
1034 
1035 // CAST
1036 TEMP const Type* THIS::Cast(const Type* pOther) const {
1037  return dynamic_cast< const THIS* > (pOther);
1038 }
1039 
1040 
1041 // operator=
1043  FD_DG("TaGenerator(" << this << ")::operator = [v]" << &rOtherGen);
1044  return Assign(rOtherGen);
1045 }
1046 
1047 // Valid()
1048 TEMP bool THIS::Valid(void) const {
1049  FD_DG("TaGenerator(" << this << ")::Valid()");
1050  if(!BASE::Valid()) return false;
1051  // test types
1052  bool tmm=false;
1053  if(typeid(Alphabet().AttributeType())!=typeid(const EventAttr*)) tmm=true;
1054  if(typeid(States().AttributeType())!=typeid(const StateAttr*)) tmm=true;
1055  if(typeid(TransRel().AttributeType())!=typeid(const TransAttr*)) tmm=true;
1056  if(typeid(GlobalAttribute())!=typeid(const GlobalAttr&)) tmm=true;
1057  if(tmm) {
1058  return false;
1059  //std::stringstream errstr;
1060  //errstr << "attribute type mismatch in generator " << Name();
1061  //throw Exception("Generator::Valid", errstr.str(), 63);
1062  }
1063  return true;
1064 }
1065 
1066 // Clear()
1067 TEMP void THIS::Clear(void) {
1068  FD_DG("TaGenerator(" << this << ")::Clear()");
1069  BASE::Clear();
1070 }
1071 
1072 
1073 // InjectAlphabet(newalphabet)
1074 TEMP void THIS::InjectAlphabet(const EventSet& rNewAlphabet) {
1075  FD_DG("TaGenerator::InjectAlphabet() " << rNewAlphabet.ToString());
1076  BASE::InjectAlphabet(rNewAlphabet);
1077 }
1078 
1079 // InjectAlphabet(newalphabet)
1080 TEMP void THIS::InjectAlphabet(const TaEventSet<EventAttr>& rNewAlphabet) {
1081  FD_DG("TaGenerator::InjectAlphabet(TaEventSet<EventAttr>) " << rNewAlphabet.ToString());
1082 #ifdef FAUDES_CHECKED
1083  if(rNewAlphabet.SymbolTablep()!=mpEventSymbolTable) {
1084  std::stringstream errstr;
1085  errstr << "symboltable mismatch aka not implemented" << std::endl;
1086  throw Exception("TaGenerator::InjectAlphabet", errstr.str(), 88);
1087  }
1088 #endif
1089  *pAlphabet=rNewAlphabet;
1090  mpAlphabet->Name("Alphabet");
1091 }
1092 
1093 // InsEvent(index)
1094 TEMP bool THIS::InsEvent(Idx index) {
1095  FD_DG("TaGenerator(" << this << ")::InsEvent(" << index << ")");
1096  return pAlphabet->Insert(index);
1097 }
1098 
1099 // InsEvent(rName)
1100 TEMP Idx THIS::InsEvent(const std::string& rName) {
1101  FD_DG("TaGenerator(" << this << ")::InsEvent(\"" << rName << "\")");
1102  return pAlphabet->Insert(rName);
1103 }
1104 
1105 // InsEvent(index, attr)
1106 TEMP bool THIS::InsEvent(Idx index, const EventAttr& attr) {
1107  FD_DG("TaGenerator(" << this << ")::InsEvent(" << index << " " << attr.ToString() << ")");
1108  return pAlphabet->Insert(index, attr);
1109 }
1110 
1111 // InsEvent(rName)
1112 TEMP Idx THIS::InsEvent(const std::string& rName, const EventAttr& attr) {
1113  FD_DG("TaGenerator(" << this << ")::InsEvent(\"" << rName << attr.ToString() << "\")");
1114  return pAlphabet->Insert(rName, attr);
1115 }
1116 
1117 // InsState()
1118 TEMP Idx THIS::InsState(void) {
1119  FD_DG("TaGenerator(" << this << ")::InsState()");
1120  return pStates->Insert();
1121 }
1122 
1123 // InsState(attr)
1124 TEMP Idx THIS::InsState(const StateAttr& attr) {
1125  FD_DG("TaGenerator(" << this << ")::InsState(attr)");
1126  return pStates->Insert(attr);
1127 }
1128 
1129 // InsState(index)
1130 TEMP bool THIS::InsState(Idx index) {
1131  FD_DG("TaGenerator(" << this << ")::InsState(" << index << ")");
1132  return pStates->Insert(index);
1133 }
1134 
1135 // InsState(index, attr)
1136 TEMP bool THIS::InsState(Idx index, const StateAttr& rAttr) {
1137  FD_DG("TaGenerator(" << this << ")::InsState(" << index << ",rAttr)");
1138  return pStates->Insert(index,rAttr);
1139 }
1140 
1141 // InsState(rName)
1142 TEMP Idx THIS::InsState(const std::string& rName) {
1143  FD_DG("TaGenerator(" << this << ")::InsState(\"" << rName << "\")");
1144  Idx index=pStates->Insert();
1145  StateName(index,rName);
1146  return index;
1147 }
1148 
1149 // InsState(rName, attr)
1150 TEMP Idx THIS::InsState(const std::string& rName, const StateAttr& attr) {
1151  FD_DG("TaGenerator(" << this << ")::InsState(\"" << rName << "\", attr)");
1152  Idx index=pStates->Insert();
1153  StateName(index,rName);
1154  StateAttribute(index,attr);
1155  return index;
1156 }
1157 
1158 
1159 // InjectStates(rNewStates)
1160 TEMP void THIS::InjectStates(const StateSet& rNewStates) {
1161  FD_DG("TaGenerator(" << this << ")::InjectStates("
1162  << rNewStates.ToString() << ")");
1163  BASE::InjectStates(rNewStates);
1164 }
1165 
1166 // InjectStates(rNewStates)
1167 TEMP void THIS::InjectStates(const TaStateSet<StateAttr>& rNewStates) {
1168  FD_DG("TaGenerator(" << this << ")::InjectStates("
1169  << rNewStates.ToString() << ")");
1170  *pStates=rNewStates;
1171  pStates->Name("States");
1172  mpStateSymbolTable->RestrictDomain(*mpStates);
1173 }
1174 
1175 
1176 
1177 // InjectTransRel(rNewtransrel)
1178 TEMP void THIS::InjectTransRel(const TransSet& rNewTransRel) {
1179  FD_DG("TaGenerator::InjectTransRel(...)");
1180  *pTransRel=rNewTransRel;
1181 }
1182 
1183 // InjectTransRel(rNewtransrel)
1184 TEMP void THIS::InjectTransRel(const ATransSet& rNewTransRel) {
1185  FD_DG("TaGenerator::InjectTransRel(...)");
1186  *pTransRel=rNewTransRel;
1187 }
1188 
1189 
1190 // SetTransition(rX1, rEv, rX2)
1191 TEMP bool THIS::SetTransition(const std::string& rX1, const std::string& rEv, const std::string& rX2) {
1192  return BASE::SetTransition(rX1,rEv,rX2);
1193 }
1194 
1195 
1196 // SetTransition(x1, ev, x2)
1197 TEMP bool THIS::SetTransition(Idx x1, Idx ev, Idx x2) {
1198  return SetTransition(Transition(x1,ev,x2));
1199 }
1200 
1201 // SetTransition(rTransition)
1202 TEMP bool THIS::SetTransition(const Transition& rTransition) {
1203  FD_DG("TaGenerator(" << this << ")::SetTransition(" << rTransition.X1 << ","
1204  << rTransition.Ev << "," << rTransition.X2 << ")");
1205 #ifdef FAUDES_CHECKED
1206  if (! mpStates->Exists(rTransition.X1)) {
1207  std::stringstream errstr;
1208  errstr << "TaGenerator::SetTransition: state " << rTransition.X1
1209  << " not in stateset";
1210  throw Exception("TaGenerator::SetTransition(..)", errstr.str(), 95);
1211  }
1212  if (! mpAlphabet->Exists(rTransition.Ev)) {
1213  std::stringstream errstr;
1214  errstr << "TaGenerator::SetTransition: event " << rTransition.Ev
1215  << " not in alphabet ";
1216  throw Exception("TaGenerator::SetTransition(..)", errstr.str(), 95);
1217  }
1218  if (! mpStates->Exists(rTransition.X2)) {
1219  std::stringstream errstr;
1220  errstr << "TaGenerator::SetTransition: state " << rTransition.X2
1221  << " not in stateset";
1222  throw Exception("TaGenerator::SetTransition(..)", errstr.str(), 95);
1223  }
1224 #endif
1225  return pTransRel->Insert(rTransition);
1226 }
1227 
1228 // SetTransition(rTransition, rAttr)
1229 TEMP bool THIS::SetTransition(const Transition& rTransition, const TransAttr& rAttr) {
1230  FD_DG("TaGenerator(" << this << ")::SetTransition(" << rTransition.X1 << ","
1231  << rTransition.Ev << "," << rTransition.X2 << ", [attr:]" << rAttr.ToString() << ")");
1232 #ifdef FAUDES_CHECKED
1233  if (! mpStates->Exists(rTransition.X1)) {
1234  std::stringstream errstr;
1235  errstr << "TaGenerator::SetTransition: state " << rTransition.X1
1236  << " not in stateset";
1237  throw Exception("TaGenerator::SetTransition(..)", errstr.str(), 95);
1238  }
1239  if (! mpAlphabet->Exists(rTransition.Ev)) {
1240  std::stringstream errstr;
1241  errstr << "TaGenerator::SetTransition: event " << rTransition.Ev
1242  << " not in alphabet ";
1243  throw Exception("TaGenerator::SetTransition(..)", errstr.str(), 95);
1244  }
1245  if (! mpStates->Exists(rTransition.X2)) {
1246  std::stringstream errstr;
1247  errstr << "TaGenerator::SetTransition: state " << rTransition.X2
1248  << " not in stateset";
1249  throw Exception("TaGenerator::SetTransition(..)", errstr.str(), 95);
1250  }
1251 #endif
1252  return pTransRel->Insert(rTransition,rAttr);
1253 }
1254 
1255 // TransAttribute(trans, attr)
1256 TEMP void THIS::TransAttribute(const Transition& rTrans, const TransAttr& rAttr) {
1257  FD_DG("TaGenerator(" << this << ")::TransAttribute("
1258  << TStr(rTrans) << ",\"" << rAttr.ToString() << "\")");
1259  pTransRel->Attribute(rTrans, rAttr);
1260 }
1261 
1262 // TransAttribute(index, attr)
1263 TEMP void THIS::TransAttribute(const Transition& rTrans, const Type& rAttr) {
1264  FD_DG("TaGenerator(" << this << ")::TransAttribute("
1265  << TStr(rTrans) << ",\"" << rAttr.ToString() << "\")");
1266  const TransAttr* attrp = dynamic_cast<const TransAttr*>(&rAttr);
1267  if(!attrp) {
1268  std::stringstream errstr;
1269  errstr << "cannot cast event attribute " << rAttr.ToString() << " for generator " << Name();
1270  throw Exception("TaGenerator::TransAttribute", errstr.str(), 63);
1271  }
1272  pTransRel->Attribute(rTrans, *attrp);
1273 }
1274 
1275 // TransAttributep(trans)
1276 TEMP TransAttr* THIS::TransAttributep(const Transition& rTrans) {
1277  return pTransRel->Attributep(rTrans);
1278 }
1279 
1280 
1281 // TransAttribute(trans)
1282 TEMP const TransAttr& THIS::TransAttribute(const Transition& rTrans) const {
1283  return pTransRel->Attribute(rTrans);
1284 }
1285 
1286 // EventAttribute(index, attr)
1287 TEMP void THIS::EventAttribute(Idx index, const EventAttr& rAttr) {
1288  FD_DG("TaGenerator(" << this << ")::EventAttribute("
1289  << EStr(index) << ",\"" << rAttr.ToString() << "\")");
1290  pAlphabet->Attribute(index, rAttr);
1291 }
1292 
1293 // EventAttribute(index, attr)
1294 TEMP void THIS::EventAttribute(Idx index, const Type& rAttr) {
1295  FD_DG("TaGenerator(" << this << ")::EventAttribute("
1296  << EStr(index) << ",\"" << rAttr.ToString() << "\")");
1297  const EventAttr* attrp = dynamic_cast<const EventAttr*>(&rAttr);
1298  if(!attrp) {
1299  std::stringstream errstr;
1300  errstr << "cannot cast event attribute " << rAttr.ToString() << " for generator " << Name();
1301  throw Exception("TaGenerator::EventAttribute", errstr.str(), 63);
1302  }
1303  pAlphabet->Attribute(index, *attrp);
1304 }
1305 
1306 // EventAttribute(index)
1307 TEMP const EventAttr& THIS::EventAttribute(Idx index) const {
1308  return pAlphabet->Attribute(index);
1309 }
1310 
1311 // EventAttributep(index)
1312 TEMP EventAttr* THIS::EventAttributep(Idx index) {
1313  return pAlphabet->Attributep(index);
1314 }
1315 
1316 // EventAttribute(rName)
1317 TEMP const EventAttr& THIS::EventAttribute(const std::string& rName) const {
1318  return EventAttribute(EventIndex(rName));
1319 }
1320 
1321 // EventAttributep(rName)
1322 TEMP EventAttr* THIS::EventAttributep(const std::string& rName) {
1323  return EventAttributep(EventIndex(rName));
1324 }
1325 
1326 // StateAttribute(index, attr)
1327 TEMP void THIS::StateAttribute(Idx index, const StateAttr& rAttr) {
1328  FD_DG("TaGenerator(" << this << ")::StateAttribute("
1329  << index << ",\"" << rAttr.ToString() << "\")");
1330  pStates->Attribute(index, rAttr);
1331 }
1332 
1333 // StateAttribute(index, attr)
1334 TEMP void THIS::StateAttribute(Idx index, const Type& rAttr) {
1335  FD_DG("TaGenerator(" << this << ")::StateAttribute("
1336  << SStr(index) << ",\"" << rAttr.ToString() << "\")");
1337  const StateAttr* attrp = dynamic_cast<const StateAttr*>(&rAttr);
1338  if(!attrp) {
1339  std::stringstream errstr;
1340  errstr << "cannot cast event attribute " << rAttr.ToString() << " for generator " << Name();
1341  throw Exception("TaGenerator::StateAttribute", errstr.str(), 63);
1342  }
1343  pStates->Attribute(index, *attrp);
1344 }
1345 
1346 
1347 // StateAttribute(index)
1348 TEMP const StateAttr& THIS::StateAttribute(Idx index) const {
1349  return pStates->Attribute(index);
1350 }
1351 
1352 // StateAttributep(index)
1353 TEMP StateAttr* THIS::StateAttributep(Idx index) {
1354  return pStates->Attributep(index);
1355 }
1356 
1357 // Alphabet()
1358 TEMP const TaEventSet<EventAttr>& THIS::Alphabet(void) const {
1359  return *pAlphabet;
1360 }
1361 
1362 // States()
1363 TEMP const TaStateSet<StateAttr>& THIS::States(void) const {
1364  return *pStates;
1365 }
1366 
1367 // TransRel()
1368 TEMP const typename THIS::ATransSet& THIS::TransRel(void) const {
1369  return *pTransRel;
1370 }
1371 
1372 // TransRel(res)
1373 TEMP void THIS::TransRel(TransSetX1EvX2& res) const { mpTransRel->ReSort(res); }
1374 TEMP void THIS::TransRel(TransSetEvX1X2& res) const { mpTransRel->ReSort(res); }
1375 TEMP void THIS::TransRel(TransSetEvX2X1& res) const { mpTransRel->ReSort(res); }
1376 TEMP void THIS::TransRel(TransSetX2EvX1& res) const { mpTransRel->ReSort(res); }
1377 TEMP void THIS::TransRel(TransSetX2X1Ev& res) const { mpTransRel->ReSort(res); }
1378 TEMP void THIS::TransRel(TransSetX1X2Ev& res) const { mpTransRel->ReSort(res); }
1379 
1380 
1381 #undef THIS
1382 #undef TEMP
1383 #undef BASE
1384 
1385 
1386 
1387 } // namespace faudes
1388 
1389 #endif
1390 
#define TEMP
#define THIS
Compiletime options.
#define FD_DG(message)
Debug: optional report on generator operations.
Class Exception.
Class vGenerator.
Classes IndexSet, TaIndexSet.
Classes NameSet, TaNameSet.
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
Class SymbolTable.
Class Token.
Class TokenReader.
Class TokenWriter.
Classes Transition, TTransSet and TaTransSet.
Faudes exception class.
Set of indices.
Definition: cfl_indexset.h:78
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
Generator with specified attribute types.
TaNameSet< EventAttr > * pAlphabet
Alphabet, pointer with actual attribute type.
TaIndexSet< StateAttr > * pStates
State set, pointer with actual attribute type.
void TransRel(TransSetX2X1Ev &res) const
GlobalAttr * GlobalAttributep(void)
Get global attribute pointer.
void TransRel(TransSetEvX2X1 &res) const
TaTransSet< TransAttr > ATransSet
Convenience typdef for member transiton set.
void TransRel(TransSetX2EvX1 &res) const
const GlobalAttr & GlobalAttribute(void) const
Get global attribute ref.
void GlobalAttribute(const Type &rAttr)
Set global attribute.
virtual TaGenerator & Assign(const Type &rSrc)
Copy from other faudes Type (try to cast to agenerator or pass to base)
static const TaIndexSet< StateAttr > & StatesTaGen(void)
Static default state set prototype (incl.
virtual void NewCore(void)
Allocate my heap members (attribute dependent types)
ATransSet * pTransRel
Transition relation, pointer with actual attribute type.
GlobalAttr * pGlobalAttribute
Global attribute, pointer with actual attribute type.
void GlobalAttribute(const GlobalAttr &rAttr)
Set global attribute.
static const TaNameSet< EventAttr > & AlphabetTaGen(void)
Static default alphabet prototype (incl.
static const GlobalAttr & GlobalTaGen(void)
Static default global attribute prototype (configures global attribute type)
void TransRel(TransSetX1X2Ev &res) const
static const ATransSet & TransRelTaGen(void)
Static default transition relation prototype (incl.
void DoAssign(const TaGenerator &rGen)
Assignment.
Set of Transitions with attributes.
Definition: cfl_transset.h:991
Triple (X1,Ev,X2) to represent current state, event and next state.
Definition: cfl_transset.h:57
Idx X1
Current state.
Definition: cfl_transset.h:99
Idx X2
Next state.
Definition: cfl_transset.h:108
Base class of all libFAUDES objects that participate in the run-time interface.
Definition: cfl_types.h:239
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
Read configuration data from file with label specified.
Definition: cfl_types.cpp:261
std::string ToString(const std::string &rLabel="", const Type *pContext=0) const
Write configuration data to a string.
Definition: cfl_types.cpp:169
Base class of all FAUDES generators.
bool mReindexOnWrite
Reindex states on file-i/o.
StateSet mMarkedStates
Marked states.
SymbolTable mStateSymbolTable
State symbol table (local per Generator)
SymbolTable * mpEventSymbolTable
Pointer to Event symbol table.
bool mStateNamesEnabled
Automatic state names.
void ConfigureAttributeTypes(const AttributeVoid *pNewGlobalPrototype, const StateSet *pNewStatesPrototype, const EventSet *pNewAlphabetPrototype, const TransSet *pNewTransRelPrototype)
Configure attribute types.
static bool msStateNamesEnabledDefault
Default for automatic statenames.
void Name(const std::string &rName)
Set the generator's name.
std::map< Idx, Idx > mMinStateIndexMap
Map State indices to consecutive indices.
StateSet mInitStates
Initial states.
TaNameSet< AttributeCFlags > Alphabet
Convenience typedef for event sets with controllability attributes.
TTransSet< TransSort::X2EvX1 > TransSetX2EvX1
Type definition for x2, ev, x1 sorted TTransSet.
Definition: cfl_transset.h:966
TTransSet< TransSort::X1X2Ev > TransSetX1X2Ev
Type definition for x1, x2, ev sorted TTransSet.
Definition: cfl_transset.h:972
TTransSet< TransSort::X2X1Ev > TransSetX2X1Ev
Type definition for x2, x1, ev sorted TTransSet.
Definition: cfl_transset.h:969
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen