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

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen