tp_tgenerator.h
Go to the documentation of this file.
1 /** @file tp_tgenerator.h Timed generator class TtGenerator */
2 
3 /*
4  Timeplugin for FAU Discrete Event Systems Library (libfaudes)
5 
6  Copyright (C) 2007 Thomas Moor
7  Exclusive copyright is granted to Klaus Schmidt
8 
9 */
10 
11 
12 #ifndef FAUDES_TP_TGENERATOR_H
13 #define FAUDES_TP_TGENERATOR_H
14 
15 #include "corefaudes.h"
16 #include "tp_attributes.h"
17 
18 namespace faudes {
19 
20 
21 
22 /**
23  * Generator with timing extensions.
24  *
25  * \section SecTimedAlur Alur's Timed Automata
26  *
27  * The TtGenerator implements a timed automaton as
28  * introduced by Alur et al. Thus, a TtGenerator is equipped with a number of clock
29  * variables to express conditions on timing, so called time constraints. Each state has a
30  * TimeConstraint called the invariant, which must be satisfied while the generator
31  * resides in the respective state. Similarly, each transition has a timeconstraint called the
32  * guard, which must be satisfied at the moment in which the transition is executed. Transitions
33  * may also reset clock variables.
34  *
35  *
36  * \section SecTimedAlusImplement Implementation
37  *
38  * The TimedGenerator is derived from the System and requires
39  * adequate attribute parameters that implement the timing constraints. Suitable
40  * attribute classes are provided by AttributeTimedState, AttributeTimedTrans and AttributeTimedGlobal
41  * which may be used either directly or as base classes for further derivatives.
42  * For the event attribute, the TimedGenerator assumes the AttributeCFlags interface. A convenience
43  * definition faudes::TimedGenerator is used for a minimal version with the above mentioned attribute parameters.
44  *
45  *
46  * \section TimedGeneratorFileFormat File IO
47  *
48  * The TtGenerator calsses use the TaGenerator file IO, i.e. the file format is the
49  * same up to timing related requirements from the attribute parameters. The below
50  * example is from the basic version TimedGenerator and represents a simplemachine with a
51  * busy cycle of at least 5 and at most 10 time units.
52  * @code
53  * <Generator name="tc simple machine">
54  *
55  * <Alphabet>
56  * "alpha" +C+ "beta" "mue" "lambda" +C+
57  * </Alphabet>
58  *
59  * <States>
60  * "idle"
61  * "busy" <Invariant> "cBusy" "LT" 10 </Invariant>
62  * "down"
63  * </States>
64  *
65  * <TransRel>
66  *
67  * "idle" "alpha" "busy"
68  * <Timing>
69  * <Resets>
70  * "cBusy"
71  * </Resets>
72  * </Timing>
73  *
74  * "busy" "beta" "idle"
75  * <Timing>
76  * <Guard>
77  * "cBusy" "GT" 5
78  * </Guard>
79  * </Timing>
80  *
81  * "busy" "mue" "down"
82  *
83  * "down" "lambda" "idle"
84  *
85  * </TransRel>
86  *
87  * <InitStates> "idle" </InitStates>
88  * <MarkedStates> "idle" </MarkedStates>
89  *
90  * <Clocks> "cBusy" </Clocks>
91  *
92  * </Generator>
93  * @endcode
94  *
95  *
96  * @ingroup TimedPlugin
97  */
98 
99 template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
100 class FAUDES_API TtGenerator : public TcGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr> {
101  public:
102  /**
103  * Constructor
104  */
105  TtGenerator(void);
106 
107  /**
108  * Copy constructor
109  *
110  * @param rOtherGen
111  */
112  TtGenerator(const TtGenerator& rOtherGen);
113 
114  /**
115  * Copy constructor (no attributes)
116  *
117  * @param rOtherGen
118  */
119  TtGenerator(const vGenerator& rOtherGen);
120 
121  /**
122  * Assignment operator (uses Assign)
123  * Note: you must reimplement this operator in derived
124  * classes in order to handle internal pointers correctly
125  *
126  * @param rOtherGen
127  * Other generator
128  */
129  virtual TtGenerator& operator= (const TtGenerator& rOtherGen) {this->Assign(rOtherGen); return *this;};
130 
131  /**
132  * Construct from file
133  *
134  * @param rFileName
135  * Name of file
136  *
137  * @exception Exception
138  * - file format errors (id 1, 50, 51, 52)
139  */
140  TtGenerator(const std::string& rFileName);
141 
142  /**
143  * Construct on heap.
144  * Constructs a TtGenerator on heap with the same attribute types and the same event- and clock-symboltable.
145  *
146  * @return
147  * new Generator
148  */
149  TtGenerator* New(void) const;
150 
151  /**
152  * Construct copy on heap.
153  * Constructs a TtGenerator on heap with the same attribute types and the same event- and clock-symboltable.
154  *
155  * @return
156  * new Generator
157  */
158  TtGenerator* Copy(void) const;
159 
160  /**
161  * Type test.
162  * Uses C++ dynamic cast to test whether the specified object
163  * casts to a TimedGenerator.
164  *
165  * @return
166  * TtGenerator reference if dynamic cast succeeds, else NULL
167  */
168  virtual const Type* Cast(const Type* pOther) const {
169  return dynamic_cast< const TtGenerator* > (pOther); };
170 
171 
172  /**
173  * Construct on stack.
174  * Constructs a TtGenerator on stack with the same attribute types and the same event- and clock-symboltable.
175  *
176  * @return
177  * new Generator
178  */
179  TtGenerator NewTGen(void) const;
180 
181 
182  /**
183  * Get Pointer to mpClockSymbolTable.
184  *
185  * @return Pointer mpClockSymbolTable
186  */
187  SymbolTable* ClockSymbolTablep(void) const;
188 
189  /**
190  * Set ClockSymbolTable.
191  *
192  * @param pClockSymTab
193  * Pointer SymbolTable
194  */
195  void ClockSymbolTablep(SymbolTable* pClockSymTab);
196 
197 
198  /**
199  * Number of clocks in mClocks
200  *
201  * @return Number of clocks in mClocks
202  */
203  Idx ClocksSize(void) const;
204 
205  /**
206  * Get clockset as const reference
207  *
208  * @return mClocks
209  */
210  const ClockSet& Clocks(void) const;
211 
212 
213  /**
214  * Get clockset as pointer
215  *
216  * @return mClocks
217  */
218  ClockSet* Clocksp(void);
219 
220  /**
221  * Overwrites mClocks with newclocks without consistency check
222  *
223  * @param newclocks
224  * New clocks that are written to mClocks
225  */
226  void InjectClocks(const ClockSet& newclocks);
227 
228  /**
229  * Looks up clock name for given index
230  *
231  * @param index
232  * Clock index
233  *
234  * @return Clock name
235  */
236  std::string ClockName(Idx index) const;
237 
238  /**
239  * Looks up clock index for given name
240  *
241  * @param rName
242  * Clock name
243  *
244  * @return Clock index or 0 for nonexistent
245  */
246  Idx ClockIndex(const std::string& rName) const;
247 
248  /**
249  * Add an existing clock to mClcoks by index
250  *
251  * @param index
252  * Clock index
253  * @return
254  * True if clock was new to clockset
255  */
256  bool InsClock(Idx index);
257 
258  /**
259  * Add named clock to generator. An entry in the mpClockSymbolTable will
260  * be made if clock is new.
261  *
262  * @param rName
263  * Name of the clock to add
264  *
265  * @return
266  * New unique index
267  */
268  Idx InsClock(const std::string& rName);
269 
270  /**
271  * Add new named clocks to generator.
272  *
273  * @param rClockSet
274  * ClockSet
275  */
276  void InsClocks(const ClockSet& rClockSet);
277 
278  /**
279  * Delete clock from generator by index. This also removes
280  * any constraints and resets that refer to that clock.
281  *
282  * @param index
283  * Index of clock
284  * @return
285  * True if clock did exist
286  *
287  */
288  bool DelClock(Idx index);
289 
290  /**
291  * Delete clock from generator by name. mpClockSymbolTable stays untouched.
292  * Also removes constraints and resets that refer to this clock
293  *
294  * @param rName
295  * Name of clock
296  * @return
297  * True if clock did exist
298  */
299  bool DelClock(const std::string& rName);
300 
301  /**
302  * Delete a set of clocks from generator.
303  *
304  * @param rClocks
305  * ClockSet containing clocks to remove
306  */
307  void DelClocks(const ClockSet& rClocks);
308 
309  /**
310  * Test existence of clock in mClocks
311  *
312  * @param index
313  * Clock index
314  *
315  * @return
316  * true / false
317  */
318  bool ExistsClock(Idx index) const;
319 
320  /**
321  * Test existence of clock in mClock
322  *
323  * @param rName
324  * Clock name
325  *
326  * @return
327  * True if clock exists
328  */
329  bool ExistsClock(const std::string& rName) const;
330 
331  /**
332  * Returns a niterator to clock index in mClock
333  *
334  * @param index
335  * Index to find
336  *
337  * @return
338  * ClockSet::Iterator to clock index
339  */
340  ClockSet::Iterator FindClock(Idx index) const;
341 
342  /**
343  * Returns an iterator to clock index in mClock
344  *
345  * @param rName
346  * Clock name of index to find
347  *
348  * @return
349  * ClockSet::Iterator to clock index
350  */
351  ClockSet::Iterator FindClock(const std::string& rName) const;
352 
353  /**
354  * Returns all clocks used by all TimeConstraints and Resets.
355  * Should be a subset of Clocks()
356  *
357  * @return
358  * ClockSet containing all clocks
359  */
360  ClockSet ActiveClocks(void) const;
361 
362  /**
363  * Returns all clocks not used by any TimeConstraints or Reset.
364  *
365  * @return
366  * ClockSet containing all unused clocks
367  */
368  ClockSet InactiveClocks(void) const;
369 
370  /**
371  * Update Clocks to include all active clocks
372  *
373  */
374  void InsActiveClocks(void);
375 
376  /**
377  * Update Clocks not to include any inactive clocks
378  *
379  */
380  void DelInactiveClocks(void);
381 
382  /**
383  * Iterator to Begin() of mClocks
384  *
385  * @return iterator to begin of mClocks
386  */
387  ClockSet::Iterator ClocksBegin(void) const;
388 
389  /**
390  * Iterator to End() of mClocks
391  *
392  * @return iterator to end of mClocks
393  */
394  ClockSet::Iterator ClocksEnd(void) const;
395 
396  /**
397  * Throw exception if timeconstraint refers to clocks not
398  * in clockset or symboltable mismatch
399  *
400  * @exception Exception
401  * - invalid cock (id 200)
402  */
403  void ConsistentTimeConstraint(const TimeConstraint& rTimeConstr) const;
404 
405  /**
406  * Throw exception if clocksset contains clocks not
407  * in generators clockset or symboltable mismatch
408  *
409  * @exception Exception
410  * - invalid cock (id 200)
411  */
412  void ConsistentClocks(const ClockSet& rClocks) const;
413 
414 
415  /**
416  * Get invariant of state by index
417  *
418  * @param idx
419  * State index
420  * @return
421  * Const ref to invariant
422  */
423  const TimeConstraint& Invariant(Idx idx) const;
424 
425  /**
426  * Get invariant of state by index
427  *
428  * @param idx
429  * State index
430  * @return
431  * Pointer to invariant
432  */
433  TimeConstraint* Invariantp(Idx idx);
434 
435  /**
436  * Get invariant of state by name
437  *
438  * @param name
439  * State name
440  * @return
441  * Const ref to invariant
442  */
443  const TimeConstraint& Invariant(const std::string& name) const;
444 
445 
446  /**
447  * Get invariant of state by name
448  *
449  * @param name
450  * State index
451  * @return
452  * Pointer to invariant
453  */
454  TimeConstraint* Invariantp(const std::string& name);
455 
456  /**
457  * Set invariant of state by index
458  *
459  * @param index
460  * State index
461  * @param rConstraints
462  * New constraints
463  */
464  void Invariant(Idx index, const TimeConstraint& rConstraints);
465 
466 
467  /**
468  * Set invariant of state by name
469  *
470  * @param name
471  * State name
472  * @param rConstraints
473  * New constraints
474  */
475  void Invariant(const std::string& name, const TimeConstraint& rConstraints);
476 
477 
478  /**
479  * Ins invariant of state by name
480  *
481  * @param name
482  * State name
483  * @param rConstraints
484  * New constraints
485  */
486  void InsInvariant(const std::string& name, const TimeConstraint& rConstraints);
487 
488 
489  /**
490  * Ins invariant of state by name
491  *
492  * @param index
493  * State index
494  * @param rConstraints
495  * New constraints
496  */
497  void InsInvariant(Idx index, const TimeConstraint& rConstraints);
498 
499 
500  /**
501  * Clear invariant of state by index
502  *
503  * @param idx
504  * State index
505  */
506  void ClrInvariant(Idx idx);
507 
508  /**
509  * Clear invariant of state by name
510  *
511  * @param name
512  * State name
513  */
514  void ClrInvariant(const std::string& name);
515 
516  /**
517  * Clear all invariants
518  *
519  */
520  void ClearInvariants(void);
521 
522  /**
523  * Add a transition to generator by indices. States and event
524  * must already exist!
525  *
526  * Define FAUDES_CHECKED for consistency checks.
527  *
528  * @param x1
529  * Predecessor state index
530  * @param ev
531  * Event index
532  * @param x2
533  * Successor state index
534  *
535  * @return
536  * True, if the transition was new the generator
537  *
538  * @exception Exception
539  * - state or event not in generator (id 95)
540  */
541  bool SetTransition(Idx x1, Idx ev, Idx x2);
542 
543  /**
544  * Add a transition to generator by names. Statename and eventname
545  * must already exist!
546  *
547  * @param rX1
548  * Predecessor state name
549  * @param rEv
550  * Event name
551  * @param rX2
552  * Successor state name
553  *
554  * @return
555  * True, if the transition was new the generator
556  *
557  * @exception Exception
558  * - state or event not in generator (id 95)
559  * - state name not known (id 90)
560  * - event name not known (id 66)
561  */
562  bool SetTransition(const std::string& rX1, const std::string& rEv,
563  const std::string& rX2);
564 
565  /**
566  * Add a transition with attribute to generator. States and event
567  * must already exist!
568  *
569  * Define FAUDES_CHECKED for consistency checks.
570  *
571  * @param rTransition
572  * transition
573  * @param rAttr
574  * attribute
575  *
576  * @return
577  * True, if the transition was new the generator
578  *
579  */
580  bool SetTransition(const Transition& rTransition, const TransAttr& rAttr);
581 
582  /**
583  * Inserts new TimedTransition constructed from parameters.
584  * Performs consistency checks for x1, x2, ev and all clocks in rguard and rResetClocks.
585  *
586  * @param rTrans
587  * new transition
588  * @param rGuard
589  * Guard of new TimedTransition.
590  * @param rResets
591  * Reset clocks of new TimedTransition.
592  * @return
593  * True, if the transition was new the generator
594  */
595  bool SetTransition(const Transition& rTrans,
596  const TimeConstraint& rGuard = TimeConstraint(), const ClockSet& rResets = ClockSet());
597 
598  /**
599  * Inserts new TimedTransition constructed from parameters.
600  * Performs consistency checks for x1, x2, ev and all clocks in rguard and rResetClocks.
601  *
602  * @param x1
603  * Start state of new TimedTransition.
604  * @param ev
605  * Event of new TimedTransition.
606  * @param x2
607  * Goal state of new TimedTransition.
608  * @param rguard
609  * Guard of new TimedTransition.
610  * @param rResetClocks
611  * Reset clocks of new TimedTransition.
612  */
613  bool SetTransition(Idx x1, Idx ev, Idx x2,
614  const TimeConstraint& rguard, const ClockSet& rResetClocks = ClockSet());
615 
616  /**
617  * Inserts new TimedTransition constructed from parameters.
618  * Performs consistency checks for x1, x2, ev and all clocks in rguard and rResetClocks.
619  *
620  * @param rX1
621  * Start state of new TimedTransition.
622  * @param rEv
623  * Event of new TimedTransition.
624  * @param rX2
625  * Goal state of new TimedTransition.
626  * @param rGuard
627  * Guard of new TimedTransition.
628  * @param rResets
629  * Reset clocks of new TimedTransition.
630  *
631  * @return
632  * True, if the transition was new the generator
633  */
634  bool SetTransition(const std::string& rX1, const std::string& rEv, const std::string& rX2,
635  const TimeConstraint& rGuard = TimeConstraint(), const ClockSet& rResets = ClockSet());
636 
637 
638  /**
639  * Sets Guard of a transition
640  *
641  * @param rTrans
642  * transition to manupilate
643  * @param rGuard
644  * new Guard of transition.
645  */
646  void Guard(const Transition& rTrans, const TimeConstraint& rGuard);
647 
648  /**
649  * adds constraints to Guard of a transition
650  *
651  * @param rTrans
652  * transition to manupilate
653  * @param rConstraints
654  * new constraints for Guard
655  */
656  void InsGuard(const Transition& rTrans, const TimeConstraint& rConstraints);
657 
658  /**
659  * Gets Guard refernce of a transition
660  *
661  * @param rTrans
662  * transition to inspect
663  *
664  * @return
665  * Guard of transition.
666  */
667  const TimeConstraint& Guard(const Transition& rTrans) const;
668 
669  /**
670  * Gets Guard pointer of ransition
671  *
672  * @param rTrans
673  * transition to inspect
674  *
675  * @return
676  * Guard of transition.
677  */
678  TimeConstraint* Guardp(const Transition& rTrans);
679 
680 
681  /**
682  * Clears Guard of a transition
683  *
684  * @param rTrans
685  * transition to manupilate
686  */
687  void ClrGuard(const Transition& rTrans);
688 
689  /**
690  * Sets Resets of a transition
691  *
692  * @param rTrans
693  * transition to manupilate
694  * @param rResets
695  * new Resets of transition.
696  */
697  void Resets(const Transition& rTrans, const ClockSet& rResets);
698 
699  /**
700  * adds Resets of a transition
701  *
702  * @param rTrans
703  * transition to manupilate
704  * @param rMoreResets
705  * new Resets of transition.
706  */
707  void InsResets(const Transition& rTrans, const ClockSet& rMoreResets);
708 
709  /**
710  * Gets Resets refernce of a transition
711  *
712  * @param rTrans
713  * transition to inspect
714  *
715  * @return
716  * Resets of transition.
717  */
718  const ClockSet& Resets(const Transition& rTrans) const;
719 
720  /**
721  * Gets Resets pointer of ransition
722  *
723  * @param rTrans
724  * transition to inspect
725  *
726  * @return
727  * Resets of transition.
728  */
729  ClockSet* Resetsp(const Transition& rTrans);
730 
731  /**
732  * Clears Resets of a transition
733  *
734  * @param rTrans
735  * transition to manupilate
736  */
737  void ClrResets(const Transition& rTrans);
738 
739  /**
740  * Return pretty printable clock name for index.
741  * Primary meant for debugging messages
742  *
743  * @param index
744  * Event index
745  *
746  * @return
747  * std::string
748  */
749  std::string CStr(Idx index) const;
750 
751  /**
752  * Check if generator is valid
753  *
754  * @return
755  * Success
756  */
757  virtual bool Valid(void) const;
758 
759 
760  /**
761  * Updates internal attributes. As a demo, we set
762  * state flag 0x20000000 for blocking states.
763  * Reimplement to your needs.
764  *
765  * @return true if value changed
766  */
767  virtual bool UpdateAttributes(void);
768 
769 
770 
771 }; // end class TtGeneraator
772 
773 
774 /** Convenience typedef for std TimedGenerator */
775 typedef TtGenerator<AttributeTimedGlobal, AttributeTimedState, AttributeCFlags,AttributeTimedTrans>
777 
778 /** Compatibility: pre 2.20b used tGenerator as C++ class name*/
779 #ifdef FAUDES_COMPATIBILITY
782 #endif
783 
784 
785 
786 // convenient scope macors
787 #define THIS TtGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
788 #define BASE TcGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
789 #define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
790 
791 
792 // TtGenerator(void)
793 TEMP THIS::TtGenerator(void) : BASE() {
794  // set basic members (cosmetic)
795  BASE::pGlobalAttribute->mClocks.Name("Clocks");
796  BASE::pGlobalAttribute->mpClockSymbolTable=ClockSet::GlobalClockSymbolTablep();
797  FD_DG("TimedGenerator(" << this << ")::TimedGenerator() with csymtab "
798  << (BASE::pGlobalAttribute->mpClockSymbolTable ));
799 }
800 
801 // TtGenerator(rOtherGen)
802 TEMP THIS::TtGenerator(const TtGenerator& rOtherGen) : BASE(rOtherGen) {
803  FD_DG("TimedGenerator(" << this << ")::TimedGenerator(rOtherGen) with csymtab"
804  << (BASE::pGlobalAttribute->mpClockSymbolTable) );
805 }
806 
807 // TtGenerator(rOtherGen)
808 TEMP THIS::TtGenerator(const vGenerator& rOtherGen) : BASE(rOtherGen) {
809  // set basic members (cosmetic)
810  BASE::pGlobalAttribute->mClocks.Name("Clocks");
811  BASE::pGlobalAttribute->mpClockSymbolTable=ClockSet::GlobalClockSymbolTablep();
812  FD_DG("TimedGenerator(" << this << ")::TimedGenerator(rOtherGen) with csymtab"
813  << (BASE::pGlobalAttribute->mpClockSymbolTable) );
814 }
815 
816 // TtGenerator(rFilename)
817 TEMP THIS::TtGenerator(const std::string& rFileName) : BASE(rFileName) {
818  FD_DG("TimedGenerator(" << this << ")::TimedGenerator(" << rFileName << ") with csymtab"
819  << (BASE::pGlobalAttribute->mpClockSymbolTable) );
820 }
821 
822 
823 // ClockSymbolTablep()
824 TEMP SymbolTable* THIS::ClockSymbolTablep(void) const {
825  return BASE::pGlobalAttribute->mpClockSymbolTable;
826 }
827 
828 // ClockSymbolTablep(pSymTab)
829 TEMP void THIS::ClockSymbolTablep(SymbolTable* pSymTab) {
830  BASE::Clear(); // TODO: relax this
831  BASE::pGlobalAttribute->mpClockSymbolTable=pSymTab;
832 }
833 
834 
835 // New
836 TEMP THIS* THIS::New(void) const {
837  // allocate
838  THIS* res = new THIS;
839  // fix base data
840  res->EventSymbolTablep(BASE::mpEventSymbolTable);
841  res->mStateNamesEnabled=BASE::mStateNamesEnabled;
842  res->mReindexOnWrite=BASE::mReindexOnWrite;
843  // fix my data
844  res->ClockSymbolTablep(ClockSymbolTablep());
845  return res;
846 }
847 
848 // Copy
849 TEMP THIS* THIS::Copy(void) const {
850  // allocate
851  THIS* res = new THIS(*this);
852  // done
853  return res;
854 }
855 
856 // NewTGen
857 TEMP THIS THIS::NewTGen(void) const {
858  // call base (fixes by assignment constructor)
859  THIS res= BASE::NewCGen();
860  // fix my data
861  res.ClockSymbolTablep(ClockSymbolTablep());
862  return res;
863 }
864 
865 // ClockSize() const
866 TEMP Idx THIS::ClocksSize(void) const {
867  return BASE::pGlobalAttribute->mClocks.Size();
868 }
869 
870 // Clocks()
871 TEMP const ClockSet& THIS::Clocks(void) const {
872  return BASE::pGlobalAttribute->mClocks;
873 }
874 
875 // Clocksp()
876 TEMP ClockSet* THIS::Clocksp(void) {
877  return &BASE::pGlobalAttribute->mClocks;
878 }
879 
880 // InjectClocks(set)
881 TEMP void THIS::InjectClocks(const ClockSet& clockset) {
882  BASE::pGlobalAttribute->mClocks=clockset;
883  BASE::pGlobalAttribute->mClocks.Name("Clocks");
884 }
885 
886 // InsClock(index)
887 TEMP bool THIS::InsClock(Idx clockindex) {
888  return BASE::pGlobalAttribute->mClocks.Insert(clockindex);
889 }
890 
891 // InsClock(name)
892 TEMP Idx THIS::InsClock(const std::string& clockname) {
893  return BASE::pGlobalAttribute->mClocks.Insert(clockname);
894 }
895 
896 // InsClocks(set)
897 TEMP void THIS::InsClocks(const ClockSet& clockset) {
898  BASE::pGlobalAttribute->mClocks.InsertSet(clockset);
899 }
900 
901 
902 // DelClock(index)
903 TEMP bool THIS::DelClock(Idx clockindex) {
904  FD_DG("TimedGenerator(" << this << ")::DelClock(" << clockindex << ")");
905  TransSet::Iterator tit;
906  for(tit=BASE::TransRelBegin(); tit!=BASE::TransRelEnd(); tit++) {
907  if(!BASE::pTransRel->Attribute(*tit).IsDefault()) {
908  BASE::pTransRel->Attributep(*tit)->mGuard.EraseByClock(clockindex);
909  BASE::pTransRel->Attributep(*tit)->mResets.Erase(clockindex);
910  }
911  }
912  StateSet::Iterator it;
913  for(it=BASE::StatesBegin(); it!=BASE::StatesEnd(); it++) {
914  if(!BASE::pStates->Attribute(*it).IsDefault()) {
915  BASE::pStates->Attributep(*it)->mInvariant.EraseByClock(clockindex);
916  }
917  }
918  return BASE::pGlobalAttribute->mClocks.Erase(clockindex);
919 }
920 
921 // DelClock(name)
922 TEMP bool THIS::DelClock(const std::string& clockname) {
923  Idx index=BASE::pGlobalAttribute->mClocks.Index(clockname);
924  return DelClock(index);
925 }
926 
927 // DelClocks(set)
928 TEMP void THIS::DelClocks(const ClockSet& clockset) {
929  ClockSet::Iterator it, tmpit;
930  for(it=clockset.Begin(); it!=clockset.End(); ) {
931  tmpit=it;
932  it++;
933  DelClock(*tmpit);
934  }
935 }
936 
937 // ExistsClock(index)
938 TEMP bool THIS::ExistsClock(Idx clockindex) const {
939  return BASE::pGlobalAttribute->mClocks.Exists(clockindex);
940 }
941 
942 // ExistsClock(name)
943 TEMP bool THIS::ExistsClock(
944  const std::string& clockname) const {
945  return BASE::pGlobalAttribute->mClocks.Exists(clockname);
946 }
947 
948 // FindClock(index)
949 TEMP ClockSet::Iterator THIS::FindClock(Idx clockindex) const {
950  return BASE::pGlobalAttribute->mClocks.Find(clockindex);
951 }
952 
953 // FindClock(name)
954 TEMP ClockSet::Iterator THIS::FindClock(const std::string& clockname) const {
955  return BASE::pGlobalAttribute->mClocks.Find(clockname);
956 }
957 
958 // ClockName(index)
959 TEMP std::string THIS::ClockName(Idx clockindex) const {
960  return BASE::pGlobalAttribute->mClocks.SymbolicName(clockindex);
961 }
962 
963 // ClockIndex(name)
964 TEMP Idx THIS::ClockIndex(const std::string& clockname) const {
965  return BASE::pGlobalAttribute->mClocks.Index(clockname);
966 }
967 
968 // ActiveClocks() const
969 TEMP ClockSet THIS::ActiveClocks(void) const {
970  FD_DG("TimedGenerator(" << this << ")::ActiveClocks() const");
971  ClockSet res;
972  TransSet::Iterator tit;
973  for(tit=BASE::TransRelBegin(); tit!=BASE::TransRelEnd(); tit++) {
974  res.InsertSet(Guard(*tit).ActiveClocks());
975  res.InsertSet(Resets(*tit));
976  }
977  StateSet::Iterator it;
978  for(it=BASE::StatesBegin(); it!=BASE::StatesEnd(); it++) {
979  res.InsertSet(Invariant(*it).ActiveClocks());
980  }
981  res.Name("AcitiveClocks");
982  return res;
983 }
984 
985 // InactiveClocks() const
986 TEMP ClockSet THIS::InactiveClocks(void) const {
987  FD_DG("TtaGenerator(" << this << ")::InactiveClocks() const");
988  ClockSet res = BASE::pGlobalAttribute->mClocks;
989  res.EraseSet(ActiveClocks());
990  res.Name("InactiveClocks");
991  return res;
992 }
993 
994 // InsActiveClocks()
995 TEMP void THIS::InsActiveClocks(void) {
996  FD_DG("TimedGenerator(" << this << ")::InsActiveClocks()");
997  ClockSet aclocks=ActiveClocks();
998  InsClocks(aclocks);
999 }
1000 
1001 // DelInactiveClocks()
1002 TEMP void THIS::DelInactiveClocks(void) {
1003  FD_DG("TimedGenerator(" << this << ")::InsActiveClocks()");
1004  ClockSet iaclocks=InactiveClocks();
1005  BASE::pGlobalAttribute->mClocks.EraseSet(iaclocks);
1006 }
1007 
1008 // iterator ClocksBegin() const
1009 TEMP ClockSet::Iterator THIS::ClocksBegin(void) const {
1010  return BASE::pGlobalAttribute->mClocks.Begin();
1011 }
1012 
1013 // iterator ClocksEnd() const
1014 TEMP ClockSet::Iterator THIS::ClocksEnd(void) const {
1015  return BASE::pGlobalAttribute->mClocks.End();
1016 }
1017 
1018 // ConsistentTimeConstraint(constraint)
1019 TEMP void THIS::ConsistentTimeConstraint(const TimeConstraint& rTimeConstr) const {
1020  FD_DG("TimedGenerator(" << this << ")::ConsistentTimeConstraint(constr)");
1021  if( rTimeConstr.ClockSymbolTablep() != ClockSymbolTablep()) {
1022  std::stringstream errstr;
1023  errstr << "clocksymboltable mismatch" << std::endl;
1024  throw Exception("TimedGenerator::ConsistentTimeConstraint)", errstr.str(), 200);
1025  }
1026  if(!( rTimeConstr.ActiveClocks() <= Clocks() )) {
1027  std::stringstream errstr;
1028  errstr << "time constraint refers to clocks not in clockset: " <<
1029  rTimeConstr.ActiveClocks().ToString() << " versus " << Clocks().ToString() << std::endl;
1030  throw Exception("TimedGenerator::ConsistentTimeConstraint)", errstr.str(), 200);
1031  }
1032  FD_DG("TimedGenerator(" << this << ")::ConsistentTimeConstraint(constr): ok");
1033 }
1034 
1035 // ConsistentClocks(clocks)
1036 TEMP void THIS::ConsistentClocks(const ClockSet& rClocks) const {
1037  if(!( rClocks <= Clocks() )) {
1038  std::stringstream errstr;
1039  errstr << "clocksset contains clocks not in clockset" << std::endl;
1040  throw Exception("TimedGenerator::ConsistentClocks)", errstr.str(), 200);
1041  }
1042  if( rClocks.SymbolTablep() != ClockSymbolTablep()) {
1043  std::stringstream errstr;
1044  errstr << "clocksymboltable mismatch" << std::endl;
1045  throw Exception("TimedGenerator::ConsistentClocks)", errstr.str(), 200);
1046  }
1047 }
1048 
1049 
1050 // Invariant(index)
1051 TEMP const TimeConstraint& THIS::Invariant(Idx stateindex) const {
1052  if(!BASE::ExistsState(stateindex)) {
1053  std::stringstream errstr;
1054  errstr << "state index " << stateindex << " not found in StateSet" << std::endl;
1055  throw Exception("TimedGenerator::Invariant", errstr.str(), 200);
1056  }
1057  return BASE::pStates->Attribute(stateindex).mInvariant;
1058 }
1059 
1060 // Invariantp(index)
1061 TEMP TimeConstraint* THIS::Invariantp(Idx stateindex) {
1062  if(!BASE::ExistsState(stateindex)) {
1063  std::stringstream errstr;
1064  errstr << "state index " << stateindex << " not found in StateSet" << std::endl;
1065  throw Exception("TimedGenerator::Invariant", errstr.str(), 200);
1066  }
1067  return &BASE::pStates->Attributep(stateindex)->mInvariant;
1068 }
1069 
1070 // Invariant(name)
1071 TEMP const TimeConstraint& THIS::Invariant(const std::string& statename) const {
1072  Idx idx=BASE::StateIndex(statename);
1073  return Invariant(idx);
1074 }
1075 
1076 // Invariantp(name)
1077 TEMP TimeConstraint* THIS::Invariantp(const std::string& statename) {
1078  Idx idx=BASE::StateIndex(statename);
1079  return Invariantp(idx);
1080 }
1081 
1082 // Invariant(index,invariant)
1083 TEMP void THIS::Invariant(Idx stateindex, const TimeConstraint& rInv) {
1084  FD_DG("TimedGenerator(" << this << ")::Invariant("<<stateindex<<",inv)");
1085 #ifdef FAUDES_CHECKED
1086  ConsistentTimeConstraint(rInv);
1087  if(!BASE::ExistsState(stateindex)) {
1088  std::stringstream errstr;
1089  errstr << "state index " << stateindex << " not found in StateSet" << std::endl;
1090  throw Exception("TimedGenerator::Invariant", errstr.str(), 200);
1091  }
1092 #endif
1093  BASE::pStates->Attributep(stateindex)->mInvariant=rInv;
1094  BASE::pStates->Attributep(stateindex)->mInvariant.Name("Invariant");
1095 }
1096 
1097 // Invariant(name,invariant)
1098 TEMP void THIS::Invariant(const std::string& statename, const TimeConstraint& rInv) {
1099  FD_DG("TimedGenerator(" << this << ")::Invariant("<<statename<<",inv)");
1100  Idx idx=BASE::StateIndex(statename);
1101  Invariant(idx,rInv);
1102 }
1103 
1104 // InsInvariant(index,invariant)
1105 TEMP void THIS::InsInvariant(Idx stateindex, const TimeConstraint& rInv) {
1106  FD_DG("TimedGenerator(" << this << ")::InsInvariant("<<stateindex<<",inv)");
1107 #ifdef FAUDES_CHECKED
1108  ConsistentTimeConstraint(rInv);
1109  if(!BASE::ExistsState(stateindex)) {
1110  std::stringstream errstr;
1111  errstr << "state index " << stateindex << " not found in StateSet" << std::endl;
1112  throw Exception("TimedGenerator::InsInvariant", errstr.str(), 200);
1113  }
1114 #endif
1115  if(!rInv.Empty()) {
1116  BASE::pStates->Attributep(stateindex)->mInvariant.Insert(rInv);
1117  }
1118 }
1119 
1120 // InsInvariant(name,invariant)
1121 TEMP void THIS::InsInvariant(const std::string& statename, const TimeConstraint& rInv) {
1122  FD_DG("TimedGenerator(" << this << ")::InsInvariant("<<statename<<",inv)");
1123  Idx idx=BASE::StateIndex(statename);
1124  InsInvariant(idx,rInv);
1125 }
1126 
1127 // ClrInvariant(index)
1128 TEMP void THIS::ClrInvariant(Idx stateindex) {
1129  if(!BASE::pStates->Attribute(stateindex).IsDefault())
1130  BASE::pStates->Attributep(stateindex)->mInvariant.Clear();
1131 }
1132 
1133 // ClrInvariant(name)
1134 TEMP void THIS::ClrInvariant(const std::string& statename) {
1135  Idx idx=BASE::StateIndex(statename);
1136  ClrInvariant(idx);
1137 }
1138 
1139 // ClearInvariants()
1140 TEMP void THIS::ClearInvariants(void) {
1141  // FIXME: should iterate, there could be other attributes
1142  BASE::pStates->ClearAttributes();
1143 }
1144 
1145 
1146 // SetTransition(rX1, rEv, rX2)
1147 TEMP bool THIS::SetTransition(const std::string& rX1, const std::string& rEv, const std::string& rX2) {
1148  return BASE::SetTransition(rX1,rEv,rX2);
1149 }
1150 
1151 
1152 // SetTransition(x1, ev, x2)
1153 TEMP bool THIS::SetTransition(Idx x1, Idx ev, Idx x2) {
1154  return BASE::SetTransition(Transition(x1,ev,x2));
1155 }
1156 
1157 // SetTransition(rTransition, rAttr)
1158 TEMP bool THIS::SetTransition(const Transition& rTransition, const TransAttr& rAttr) {
1159  return BASE::SetTransition(rTransition,rAttr);
1160 }
1161 
1162 // SetTransition(trans,....)
1163 TEMP bool THIS::SetTransition(const Transition& rTrans,
1164  const TimeConstraint& rGuard, const ClockSet& rResets) {
1165  FD_DG("TimedGenerator(" << this << ")::SetTransition(" << (BASE::TStr(rTrans)) <<", " <<
1166  rGuard.ToString() << ", " << rResets.ToString() << ") const");
1167  if(rResets.Empty() && rGuard.Empty()) {
1168  return BASE::SetTransition(rTrans);
1169  }
1170  TransAttr attr;
1171  attr.mGuard=rGuard;
1172  attr.mResets=rResets;
1173  attr.mGuard.Name("Guard");
1174  attr.mResets.Name("Resets");
1175 #ifdef FAUDES_CHECKED
1176  ConsistentTimeConstraint(rGuard);
1177  ConsistentClocks(rResets);
1178 #endif
1179  return BASE::SetTransition(rTrans,attr);
1180 }
1181 
1182 // SetTransition(x1,ev,x2, ...)
1183 TEMP bool THIS::SetTransition(Idx x1, Idx ev, Idx x2,
1184  const TimeConstraint& rGuard, const ClockSet& rResets) {
1185  return SetTransition(Transition(x1,ev,x2),rGuard,rResets);
1186 }
1187 
1188 // SetTransition(X1,Ev,X2, ...)
1189 TEMP bool THIS::SetTransition(
1190  const std::string& rX1, const std::string& rEv, const std::string& rX2,
1191  const TimeConstraint& rGuard, const ClockSet& rResets) {
1192  FD_DG("TimedGenerator(" << this << ")::SetTransition(" << rX1 << " " << rEv <<" " << rX2 <<
1193  rGuard.ToString() << ", " << rResets.ToString() << ") const");
1194  Idx x1=this->StateIndex(rX1);
1195  Idx ev=this->EventIndex(rEv);
1196  Idx x2=this->StateIndex(rX2);
1197  bool res=BASE::SetTransition(x1,ev,x2);
1198  if(rResets.Empty() && rGuard.Empty()) {
1199  return res;
1200  }
1201  TransAttr attr;
1202  attr.mResets=rResets;
1203  attr.mGuard=rGuard;
1204  attr.mGuard.Name("Guard");
1205  attr.mResets.Name("Resets");
1206 #ifdef FAUDES_CHECKED
1207  ConsistentTimeConstraint(rGuard);
1208  ConsistentClocks(rResets);
1209 #endif
1210  BASE::TransAttribute(Transition(x1,ev,x2),attr);
1211  return res;
1212 }
1213 
1214 // Guard(trans)
1215 TEMP const TimeConstraint& THIS::Guard(const Transition& rTrans) const {
1216 #ifdef FAUDES_CHECKED
1217  if(!BASE::ExistsTransition(rTrans)) {
1218  std::stringstream errstr;
1219  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1220  throw Exception("TimedGenerator::Guard(trans)", errstr.str(), 200);
1221  }
1222 #endif
1223  return BASE::pTransRel->Attribute(rTrans).mGuard;
1224 }
1225 
1226 
1227 // Guardp(trans)
1228 TEMP TimeConstraint* THIS::Guardp(const Transition& rTrans) {
1229 #ifdef FAUDES_CHECKED
1230  if(!BASE::ExistsTransition(rTrans)) {
1231  std::stringstream errstr;
1232  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1233  throw Exception("TimedGenerator::Guardp(trans)", errstr.str(), 200);
1234  }
1235 #endif
1236  return &BASE::pTransRel->Attributep(rTrans)->mGuard;
1237 }
1238 
1239 
1240 // Guard(trans,guard)
1241 TEMP void THIS::Guard(const Transition& rTrans, const TimeConstraint& rGuard) {
1242 #ifdef FAUDES_CHECKED
1243  ConsistentTimeConstraint(rGuard);
1244  if(!BASE::ExistsTransition(rTrans)) {
1245  std::stringstream errstr;
1246  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1247  throw Exception("TimedGenerator::Guard(trans,guard)", errstr.str(), 200);
1248  }
1249 #endif
1250  BASE::pTransRel->Attributep(rTrans)->mGuard=rGuard;
1251  BASE::pTransRel->Attributep(rTrans)->mGuard.Name("Guard");
1252 }
1253 
1254 // InsGuard(trans,guard)
1255 TEMP void THIS::InsGuard(const Transition& rTrans, const TimeConstraint& rGuard) {
1256 #ifdef FAUDES_CHECKED
1257  ConsistentTimeConstraint(rGuard);
1258  if(!BASE::ExistsTransition(rTrans)) {
1259  std::stringstream errstr;
1260  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1261  throw Exception("TimedGenerator::InsGuard(trans,guard)", errstr.str(), 200);
1262  }
1263 #endif
1264  if(!rGuard.Empty()) {
1265  BASE::pTransRel->Attributep(rTrans)->mGuard.Insert(rGuard);
1266  }
1267 }
1268 
1269 // ClrGuard(trans)
1270 TEMP void THIS::ClrGuard(const Transition& rTrans) {
1271 #ifdef FAUDES_CHECKED
1272  if(!BASE::ExistsTransition(rTrans)) {
1273  std::stringstream errstr;
1274  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1275  throw Exception("TimedGenerator::ClrGuard(trans)", errstr.str(), 200);
1276  }
1277 #endif
1278  if(!BASE::pTransRel->Attribute(rTrans).IsDefault())
1279  BASE::pTransRel->Attributep(rTrans)->mGuard.Clear();
1280 }
1281 
1282 
1283 // Resets(trans)
1284 TEMP const ClockSet& THIS::Resets(const Transition& rTrans) const {
1285 #ifdef FAUDES_CHECKED
1286  if(!BASE::ExistsTransition(rTrans)) {
1287  std::stringstream errstr;
1288  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1289  throw Exception("TimedGenerator::Resets(trans)", errstr.str(), 200);
1290  }
1291 #endif
1292  return BASE::pTransRel->Attribute(rTrans).mResets;
1293 }
1294 
1295 
1296 // Resetsp(trans)
1297 TEMP ClockSet* THIS::Resetsp(const Transition& rTrans) {
1298 #ifdef FAUDES_CHECKED
1299  if(!BASE::ExistsTransition(rTrans)) {
1300  std::stringstream errstr;
1301  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1302  throw Exception("TimedGenerator::Resetsp(trans)", errstr.str(), 200);
1303  }
1304 #endif
1305  return &BASE::pTransRel->Attributep(rTrans)->mResets;
1306 }
1307 
1308 
1309 // Resets(trans,guard)
1310 TEMP void THIS::Resets(const Transition& rTrans, const ClockSet& rResets) {
1311 #ifdef FAUDES_CHECKED
1312  ConsistentClocks(rResets);
1313  if(!BASE::ExistsTransition(rTrans)) {
1314  std::stringstream errstr;
1315  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1316  throw Exception("TimedGenerator::Resets(trans,guard)", errstr.str(), 200);
1317  }
1318 #endif
1319  BASE::pTransRel->Attributep(rTrans)->mResets=rResets;
1320  BASE::pTransRel->Attributep(rTrans)->mResets.Name("Resets");
1321 }
1322 
1323 // InsResets(trans,guard)
1324 TEMP void THIS::InsResets(const Transition& rTrans, const ClockSet& rResets) {
1325 #ifdef FAUDES_CHECKED
1326  ConsistentClocks(rResets);
1327  if(!BASE::ExistsTransition(rTrans)) {
1328  std::stringstream errstr;
1329  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1330  throw Exception("TimedGenerator::InsResets(trans,guard)", errstr.str(), 200);
1331  }
1332 #endif
1333  if(!rResets.Empty()) {
1334  BASE::pTransRel->Attributep(rTrans)->mResets.InsertSet(rResets);
1335  }
1336 }
1337 
1338 
1339 // ClrResets(trans)
1340 TEMP void THIS::ClrResets(const Transition& rTrans) {
1341 #ifdef FAUDES_CHECKED
1342  if(!BASE::ExistsTransition(rTrans)) {
1343  std::stringstream errstr;
1344  errstr << "transition " << BASE::TStr(rTrans) << " not found " << std::endl;
1345  throw Exception("TimedGenerator::ClrResets(trans)", errstr.str(), 200);
1346  }
1347 #endif
1348  if(!BASE::pTransRel->Attribute(rTrans).IsDefault())
1349  BASE::pTransRel->Attributep(rTrans)->mGuard.Clear();
1350 }
1351 
1352 
1353 // Valid()
1354 TEMP bool THIS::Valid(void) const {
1355  FD_DV("TimedGenerator(" << this << ")::Valid()");
1356  //call base
1357  if(!BASE::Valid()) return false;
1358  // check my names
1359  TransSet::Iterator tit;
1360  StateSet::Iterator sit;
1361  for(sit = BASE::StatesBegin(); sit!= BASE::StatesEnd(); ++sit) {
1362  if(Invariant(*sit).Name()!="Invariant") return false;
1363  }
1364  for(tit = BASE::TransRelBegin(); tit!= BASE::TransRelEnd(); ++tit) {
1365  if(Guard(*tit).Name()!="Guard") return false;
1366  if(Resets(*tit).Name()!="Resets") return false;
1367  }
1368  if(Clocks().Name()!="Clocks") return false;
1369  // check my clockset
1370  ClockSet aclocks=ActiveClocks();
1371  if(!(aclocks <= Clocks())) return false;
1372  // check all clocksymboltables
1373  for(sit = BASE::StatesBegin(); sit!= BASE::StatesEnd(); ++sit) {
1374  if(Invariant(*sit).ClockSymbolTablep()!=ClockSymbolTablep()) return false;
1375  }
1376  for(tit = BASE::TransRelBegin(); tit!= BASE::TransRelEnd(); ++tit) {
1377  if(Guard(*tit).ClockSymbolTablep()!=ClockSymbolTablep()) return false;
1378  if(Resets(*tit).SymbolTablep()!=ClockSymbolTablep()) return false;
1379  }
1380  if(Clocks().SymbolTablep()!=ClockSymbolTablep()) return false;
1381 
1382  return true;
1383 }
1384 
1385 
1386 // UpdateAttributes()
1387 TEMP bool THIS::UpdateAttributes(void) {
1388  FD_DG("TimedGenerator(" << this << ")::UpdateAttributes()");
1389 
1390  // debugging example: flag blocking states
1391  // btw: need efficient methods to set/clr flags by sets
1392  StateSet blockstates=BASE::BlockingStates();
1393  StateSet::Iterator sit;
1394  for(sit=BASE::StatesBegin(); sit!= BASE::StatesEnd(); sit++) {
1395  StateAttr attr=BASE::StateAttribute(*sit);
1396  if(blockstates.Exists(*sit)) {
1397  attr.Set(0x20000000);
1398  } else {
1399  attr.Clr(0x20000000);
1400  }
1401  BASE::StateAttribute(*sit,attr);
1402  };
1403 
1404  return true;
1405 }
1406 
1407 
1408 
1409 // CStr(index)
1410 TEMP std::string THIS::CStr(Idx index) const {
1411  return BASE::pGlobalAttribute->mClocks.Str(index);
1412 }
1413 
1414 
1415 
1416 #undef BASE
1417 #undef THIS
1418 #undef TEMP
1419 
1420 
1421 
1422 } // namespace faudes
1423 
1424 
1425 #endif
1426 
#define FD_DG(message)
Debug: optional report on generator operations.
#define FD_DV(message)
Debug: optional low-level report on iterations and token IO.
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
Container class to model a set of clocks.
static SymbolTable * GlobalClockSymbolTablep(void)
Get pointer to static clock SymbolTable (init on first use pattern)
Faudes exception class.
Set of indices.
Definition: cfl_indexset.h:78
virtual void InsertSet(const NameSet &rOtherSet)
Inserts all elements of rOtherSet.
SymbolTable * SymbolTablep(void) const
Get Pointer mpSymbolTable.
void EraseSet(const NameSet &rOtherSet)
Erase elements specified by rOtherSet.
A SymbolTable associates sybolic names with indices.
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
Iterator on transition.
Definition: cfl_transset.h:269
Generator with controllability attributes.
A TimeConstraint is a set of elementary clock constraints.
std::string ToString(void) const
Write to a std::string.
bool Empty(void) const
Checks if TimeConstraint containts no ElemConstraints.
std::string Name(void) const
Return name of Constraint.
ClockSet ActiveClocks(void) const
Returns a Clockset containing all clocks used by the TimeConstraint.
SymbolTable * ClockSymbolTablep(void) const
Get Pointer to mpClockSymbolTable.
Triple (X1,Ev,X2) to represent current state, event and next state.
Definition: cfl_transset.h:57
Generator with timing extensions.
virtual const Type * Cast(const Type *pOther) const
Type test.
Base class of all libFAUDES objects that participate in the run-time interface.
Definition: cfl_types.h:239
virtual void Name(const std::string &rName)
Set the objects's name.
Definition: cfl_types.cpp:117
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.
Includes all libFAUDES headers, no plugins.
bool Empty(void) const
Test whether if the TBaseSet is Empty.
Definition: cfl_baseset.h:1824
bool Exists(const T &rElem) const
Test existence of element.
Definition: cfl_baseset.h:2115
Iterator End(void) const
Iterator to the end of set.
Definition: cfl_baseset.h:1896
virtual AttributeVoid * Attributep(const T &rElem)
Attribute access.
Definition: cfl_baseset.h:2279
Iterator Begin(void) const
Iterator to the begin of set.
Definition: cfl_baseset.h:1891
const std::string & Name(void) const
Return name of TBaseSet.
Definition: cfl_baseset.h:1755
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
TtGenerator< AttributeTimedGlobal, AttributeTimedState, AttributeCFlags, AttributeTimedTrans > TimedGenerator
Convenience typedef for std TimedGenerator.
TtGenerator< AttributeTimedGlobal, AttributeTimedState, AttributeCFlags, AttributeTimedTrans > tGenerator
Compatibility: pre 2.20b used tGenerator as C++ class name.
Attributes for timed automata.
#define TEMP
#define BASE
#define THIS

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