cfl_transset.h
Go to the documentation of this file.
1 /** @file cfl_transset.h @brief Classes Transition, TTransSet and TaTransSet */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5 Copyright (C) 2006 Bernd Opitz
6 Copyright (C) 2007 Thomas Moor
7 
8 Exclusive copyright is granted to Klaus Schmidt
9 
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14 
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23 
24 
25 #ifndef FAUDES_TRANSSET_H
26 #define FAUDES_TRANSSET_H
27 
28 
29 #include <sstream>
30 #include <map>
31 #include <iostream>
32 #include <typeinfo>
33 
34 #include "cfl_definitions.h"
35 #include "cfl_baseset.h"
36 #include "cfl_attrmap.h"
37 #include "cfl_indexset.h"
38 #include "cfl_nameset.h"
39 #include "cfl_attributes.h"
40 #include "cfl_tokenreader.h"
41 
42 
43 namespace faudes {
44 
45 /** @addtogroup ContainerClasses */
46 /** @{*/
47 
48 /**
49  * Triple (X1,Ev,X2) to represent current state, event and next state.
50  * This class provides the triple in struct like fashion where the components
51  * are of type faudes::Idx. While default order is lexographic, the transition
52  * container TTransSet allows for alternative sorting. Since technically a
53  * Transition is just a triple of indices, it is only the context of a generator
54  * that actually makes it a transition (eg by providing mandatory symbolic event
55  * names).
56  */
58 
59  public:
60 
61  /** Construct invalid Transition */
62  Transition(void) : X1(0), Ev(0), X2(0) {};
63 
64  /**
65  * Construct from values.
66  * @param x1
67  * Index of current state
68  * @param ev
69  * Index of Event
70  * @param x2
71  * Index of next state
72  */
73  Transition(Idx x1, Idx ev,Idx x2) :
74  X1(x1), Ev(ev), X2(x2) {}
75 
76  /** Default order for sorting container of Transition (lexographic) */
77  inline bool operator < (const Transition& othertrans) const {
78  if (X1 < othertrans.X1) return true;
79  if (X1 > othertrans.X1) return false;
80  if (Ev < othertrans.Ev) return true;
81  if (Ev > othertrans.Ev) return false;
82  if (X2 < othertrans.X2) return true;
83  return false;
84  }
85 
86  /** Equality operator */
87  inline bool operator == (const Transition& othertrans) const {
88  return ((X1 == othertrans.X1) && (Ev == othertrans.Ev) && (X2 == othertrans.X2));
89  };
90 
91  /** Inequality operator */
92  inline bool operator != (const Transition& othertrans) const {
93  return ((X1 != othertrans.X1) || (Ev != othertrans.Ev) || (X2 != othertrans.X2));
94  };
95 
96  /** Test validity (all indices !=0) */
97  inline bool Valid(void) const {
98  return (X1!=0) && (Ev!=0) && (X2!=0);
99  };
100 
101  /** Current state */
103 
104  /** Event */
105  Idx Ev;
106 
107  /** Next state */
109 
110  /** Pretty print to string */
111  std::string Str(void) const {
112  return ToStringInteger(X1)+"--("+ToStringInteger(Ev) + ")->" + ToStringInteger(X2);}
113 };
114 
115 
116 
117 
118 /**
119  * Alternative ordering of Transitions. This class provides binary predicates
120  * for sorting transition containers by variant lexographic order.
121  */
122 
124 
125  public:
126 
127  /** Binary predicate for sorting transitions in order Ev, X1, X2 */
128  struct EvX1X2 {
129  inline bool operator () (const Transition& left, const Transition& right) const {
130  if (left.Ev < right.Ev) return true;
131  if (left.Ev > right.Ev) return false;
132  if (left.X1 < right.X1) return true;
133  if (left.X1 > right.X1) return false;
134  if (left.X2 < right.X2) return true;
135  return false;
136  }
137  };
138 
139  /** Binary predicate for sorting transitions in order Ev, X2, X1 */
140  struct EvX2X1 {
141  inline bool operator () (const Transition& left, const Transition& right) const {
142  if (left.Ev < right.Ev) return true;
143  if (left.Ev > right.Ev) return false;
144  if (left.X2 < right.X2) return true;
145  if (left.X2 > right.X2) return false;
146  if (left.X1 < right.X1) return true;
147  return false;
148  }
149  };
150 
151  /** Binary predicate for sorting transitions in order X2, Ev, X1 */
152  struct X2EvX1 {
153  inline bool operator () (const Transition& left, const Transition& right) const {
154  if (left.X2 < right.X2) return true;
155  if (left.X2 > right.X2) return false;
156  if (left.Ev < right.Ev) return true;
157  if (left.Ev > right.Ev) return false;
158  if (left.X1 < right.X1) return true;
159  return false;
160  }
161  };
162 
163  /** Binary predicate for sorting transitions in order X2, X1, Ev */
164  struct X2X1Ev {
165  inline bool operator () (const Transition& left, const Transition& right) const {
166  if (left.X2 < right.X2) return true;
167  if (left.X2 > right.X2) return false;
168  if (left.X1 < right.X1) return true;
169  if (left.X1 > right.X1) return false;
170  if (left.Ev < right.Ev) return true;
171  return false;
172  }
173  };
174 
175  /** Binary predicate for sorting transitions in order X1, X2, Ev */
176  struct X1X2Ev {
177  inline bool operator () (const Transition& left, const Transition& right) const {
178  if (left.X1 < right.X1) return true;
179  if (left.X1 > right.X1) return false;
180  if (left.X2 < right.X2) return true;
181  if (left.X2 > right.X2) return false;
182  if (left.Ev < right.Ev) return true;
183  return false;
184  }
185  };
186 
187  /** Binary predicate for sorting transitions in order X1, Ev, X2 */
188  struct X1EvX2 {
189  inline bool operator () (const Transition& left, const Transition& right) const {
190  if (left.X1 < right.X1) return true;
191  if (left.X1 > right.X1) return false;
192  if (left.Ev < right.Ev) return true;
193  if (left.Ev > right.Ev) return false;
194  if (left.X2 < right.X2) return true;
195  return false;
196  }
197  };
198 
199 };
200 
201 
202 
203 /**
204  * Set of Transitions.
205  *
206  * This container class provides similar functionality and interface as BaseSet, but
207  * for Transitions rather than indices. The additional feature is a template parameter
208  * that allows to specify alternative sorting. For algorithms that examine a transition
209  * relation by e.g. the successor state X2, it may be worthwhile to copy a given
210  * TTransRel<TransSort::X1EvX2> to a TTransRel<TransSort::X2EvX1>. Example,
211  * assuming some transition relation is given in default order
212  *
213  * \code
214  * TransSet transrel; // transrel default order X1-Ev-X2
215  *
216  * // ... some operation to set up transrel
217  *
218  * TTransSet<TransSort::X2EvX1> transByX2; // alternative order X2-Ev-X1
219  * transrel.ReSort(transByX2); // copy and re-order transrel
220  * Iterator tit =transByX2.BeginByX2(x2) // begin iterator, X2 specified
221  * Iterator tit_end=transByX2.EndByX2(x2) // end iterator, X2 specified
222  * for(; tit!=tit_end; ++tit) { // loop over all transitions with specified x2
223  *
224  * // ... code to examine tramsitions with specified x2
225  *
226  * }
227  *
228  * \endcode
229  *
230  * Note: it is the context of a Generator that
231  * actually allows to interpret a TTransSet as a set of transitions as opposed to
232  * a set of triples of indices. In particular, file IO of transitions is provided
233  * by the generator class (although TTransSet provides basic output functions for debugging)
234  */
235 
236 // tweak: this appears to be a g** 4.2 (OsX) issue --- fails dynamic cast if this symbol is not explicitly exposed
237 #ifdef __GNUC__
238 template <class Cmp=TransSort::X1EvX2>
239 class FAUDES_API TTransSet : public TBaseSet<Transition,Cmp> {
240 #else
241 template <class Cmp=TransSort::X1EvX2>
242 class TTransSet : public TBaseSet<Transition,Cmp> {
243 #endif
244 
246 
247 
248  public:
249 
250  /** @name Constructors & Destructor */
251  /** @{ doxygen group */
252 
253  /** Construct an empty TTransSet object */
254  TTransSet(void);
255 
256  /**
257  * Copy-constructor
258  */
260 
261  /**
262  * Re-Sort Copy-constructor
263  */
264  template<class OtherCmp>
266 
267  /** Virtual destructor */
268  virtual ~TTransSet() {};
269 
270 
271  /** @} doxygen group */
272 
273 
274  /** Iterator on transition */
276 
277 
278  /** @name Accessing individual transitions */
279  /** @{ doxygen group */
280 
281  /**
282  * Add a Transition.
283  *
284  * @param rTransition
285  * Reference to transition object
286  * @return
287  * True if the transition was new to the set
288  *
289  */
290  bool Insert(const Transition& rTransition);
291 
292  /**
293  * Add a Transition by indices
294  *
295  * @param x1
296  * Predecessor state
297  * @param ev
298  * Event
299  * @param x2
300  * Successor state
301  * @return
302  * True if the transition was new to the set
303  *
304  */
305  bool Insert(Idx x1, Idx ev, Idx x2);
306 
307  /**
308  * Add a Transition.
309  *
310  * @param pos
311  * Insertion hint passed to STL
312  * @param rTransition
313  * Reference to transition object
314  * @return
315  * Insertion position
316  *
317  */
318  Iterator Inject(const Iterator& pos, const Transition& rTransition);
319 
320  /**
321  * Add a Transition.
322  *
323  * @param rTransition
324  * Reference to transition object
325  * @return
326  * Insertion position
327  *
328  */
329  void Inject(const Transition& rTransition);
330 
331  /**
332  * Remove a Transition
333  *
334  * @return
335  * True if transition did exist
336  */
337  bool Erase(const Transition& t);
338 
339  /**
340  * Remove a Transition by x1, ev, x2
341  *
342  * @return
343  * True if transition did exist
344  */
345  bool Erase(Idx x1, Idx ev, Idx x2);
346 
347  /**
348  * Remove a Transition by iterator
349  *
350  * @return
351  * Iterator to next transition
352  */
353  Iterator Erase(const Iterator& it);
354 
355  /**
356  * Remove all transitions containing predecessor state x1.
357  *
358  * @param x1
359  * State index
360  * @exception Exception
361  * - sorting mismatch (id 68)
362  */
363  void EraseByX1(Idx x1);
364 
365  /**
366  * Remove all transitions containing predecessor state x1 and event ev.
367  *
368  * @param x1
369  * State index
370  * @param ev
371  * Event index
372  * @exception Exception
373  * - sorting mismatch (id 68)
374  */
375  void EraseByX1Ev(Idx x1, Idx ev);
376 
377  /**
378  * Remove all transitions containing successor state x2.
379  * This function iterates over all transitions to work with any sorting.
380  *
381  * @param x2
382  * State index
383  */
384  void EraseByX2(Idx x2);
385 
386  /**
387  * Remove all transitions containing event ev.
388  * This function iterates over all transitions to work with any sorting.
389  *
390  * @param ev
391  * Event index
392  */
393  void EraseByEv(Idx ev);
394 
395  /**
396  * Remove all transitions containing state x,
397  * This function iterates over all transitions to work with any sorting.
398  *
399  * @param x
400  * State index
401  */
403 
404  /**
405  * Remove all transitions containing a specified state.
406  * This function iterates over all transitions to work with any sorting.
407  *
408  * @param rStates
409  * Set of states to remore
410  */
411  void EraseByX1OrX2(const StateSet& rStates);
412 
413  /**
414  * Restrict to transitions with states as specified.
415  * Erases any transition with X1 or X2 not in the specified state set.
416  *
417  * @param rStateSet
418  * Set of states to keep.
419  */
420  void RestrictStates(const StateSet& rStateSet);
421 
422  /**
423  * Restrict to transitions with events as specified.
424  * Erases any transition with event not in the specified state set.
425  *
426  * @param rEventSet
427  * Set of events to keep.
428  */
429  void RestrictEvents(const EventSet& rEventSet);
430 
431  /**
432  * Find transition given by x1, ev, x2
433  *
434  *
435  * @param x1
436  * Predecessor state
437  * @param ev
438  * Event
439  * @param x2
440  * Successor state
441  *
442  * @return
443  * Iterator to transition or End() if not exists
444  */
445  Iterator Find(Idx x1, Idx ev, Idx x2) const;
446 
447  /**
448  * Find specified transition
449  *
450  *
451  * @param t
452  * Transition
453  *
454  * @return
455  * Iterator to transition or End() if not exists
456  */
457  Iterator Find(const Transition& t) const;
458 
459 
460  /**
461  * Test existence
462  *
463  * @param t
464  * Transition
465  *
466  * @return
467  * bool
468  */
469  bool Exists(const Transition& t) const;
470 
471  /**
472  * Test existence
473  *
474  * @param x1
475  * Predecessor state Idx
476  * @param ev
477  * Event Idx
478  * @param x2
479  * Successor state Idx
480  *
481  * @return
482  * bool
483  */
484  bool Exists(Idx x1, Idx ev, Idx x2) const;
485 
486  /**
487  * Test existence
488  *
489  * @param x1
490  * Predecessor state Idx
491  * @param ev
492  * Event Idx
493  *
494  * @return
495  * bool
496  */
497  bool ExistsByX1Ev(Idx x1, Idx ev) const;
498 
499  /**
500  * Test existence
501  *
502  * @param x1
503  * Predecessor state Idx
504  *
505  * @return
506  * bool
507  */
508  bool ExistsByX1(Idx x1) const;
509 
510  /**
511  * Tests if a transition with specified predecessor or successor state
512  * exists.
513  *
514  * @param x
515  * State Idx
516  *
517  * @return
518  * bool
519  */
520  bool ExistsByX1OrX2(Idx x) const;
521 
522 
523 
524  /** @} doxygen group */
525 
526  /** @name Transition iterators
527  *
528  * A variaty of iterators are provided to examine specified
529  * segments of the transition relation, e.g. all transitions starting
530  * from a given state. Note that implemetation of these iterators
531  * requires the transition set to be of sorted accordingly. Eg.
532  * scanning all transitions that are labled with a particular event
533  * requires a sorting TransSOrt::EvX1X2 orT ransSOrt::EvX2X1.
534  *
535  *
536  */
537 
538  /** @{ doxygen group: iterators */
539 
540  /**
541  * Iterator to begin of set
542  *
543  * @return
544  * TTransSet<Cmp>::Iterator
545  */
546  Iterator Begin(void) const;
547 
548  /**
549  * Iterator to end of set
550  *
551  * @return
552  * TTransSet<Cmp>::Iterator
553  */
554  Iterator End(void) const;
555 
556 
557  /**
558  * Iterator to first Transition specified by current state.
559  *
560  * @param x1
561  * Predecessor state index
562  *
563  * @return
564  * TTransSet<Cmp>::Iterator
565  *
566  * @exception Exception
567  * - Sorting mismatch (id 68)
568  */
569  Iterator Begin(Idx x1) const;
570 
571  /**
572  * Iterator to end or Transitions with specified current state.
573  *
574  * @param x1
575  * Predecessor state index
576  *
577  * @return
578  * TTransSet<Cmp>::Iterator
579  *
580  * @exception Exception
581  * - Sorting mismatch (id 68)
582  */
583  Iterator End(Idx x1) const;
584 
585  /**
586  * Iterator to first Transitions specified by current state and event.
587  *
588  * @param x1
589  * Predecessor state index
590  * @param ev
591  * Event index
592  *
593  * @return
594  * TTransSet<Cmp>::Iterator
595  *
596  * @exception Exception
597  * - Sorting mismatch (id 68)
598  */
599  Iterator Begin(Idx x1, Idx ev) const;
600 
601  /**
602  * Iterator to first Transition after spcified current state and event.
603  *
604  * @param x1
605  * Predecessor state index
606  * @param ev
607  * Event index
608  *
609  * @return
610  * TTransSet<Cmp>::Iterator
611  *
612  * @exception Exception
613  * - sorting mismatch (id 68)
614  */
615  Iterator End(Idx x1, Idx ev) const;
616 
617  /**
618  * Iterator to first Transition specified by event.
619  * This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1.
620  *
621  * @param ev
622  * Event index
623  *
624  * @return
625  * TTransSet<Cmp>::iterator
626  *
627  * @exception Exception
628  * - sorting mismatch (id 68)
629  */
630  Iterator BeginByEv(Idx ev) const;
631 
632  /**
633  * Iterator to first Transition after specified by event.
634  * This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1
635  *
636  * @param ev
637  * Predecessor state index
638  *
639  * @return
640  * TTransSet<Cmp>::Iterator
641  *
642  * @exception Exception
643  * - sorting mismatch (id 68)
644  */
645  Iterator EndByEv(Idx ev) const;
646 
647  /**
648  * Iterator to first Transition specified by event and current state.
649  * This function requires sorting TransSort::EvX1X2.
650  *
651  * @param ev
652  * Event index
653  * @param x1
654  * Predecessor state index
655  *
656  * @return
657  * TTransSet<Cmp>::iterator
658  *
659  * @exception Exception
660  * - sorting mismatch (id 68)
661  */
662  Iterator BeginByEvX1(Idx ev, Idx x1) const;
663 
664  /**
665  * Iterator to first Transition after specified ev and current state.
666  * This function requires sorting TransSort::EvX1X2.
667  *
668  * @param ev
669  * Event index
670  * @param x1
671  * Predecessor state index
672  *
673  * @return
674  * TTransSet<Cmp>::Iterator
675  *
676  * @exception Exception
677  * - sorting mismatch (id 68)
678  */
679  Iterator EndByEvX1(Idx ev, Idx x1) const;
680 
681  /**
682  * Iterator to first Transition specified by event and next state.
683  * This function requires sorting TransSort::EvX2X1.
684  *
685  * @param ev
686  * Event index
687  * @param x2
688  * Predecessor state index
689  *
690  * @return
691  * TTransSet<Cmp>::Iterator
692  *
693  * @exception Exception
694  * - sorting mismatch (id 68)
695  */
696  Iterator BeginByEvX2(Idx ev, Idx x2) const;
697 
698  /**
699  * Iterator to first Transition after specified event and next state.
700  * This function requires sorting TransSort::EvX2X1.
701  *
702  * @param ev
703  * Event index
704  * @param x2
705  * Predecessor state index
706  *
707  * @return
708  * TTransSet<Cmp>::Iterator
709  *
710  * @exception Exception
711  * - sorting mismatch (id 68)
712  */
713  Iterator EndByEvX2(Idx ev, Idx x2) const;
714 
715  /**
716  * Iterator to first Transition specified by successor state x2.
717  * This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev.
718  *
719  * @param x2
720  * Predecessor state index
721  *
722  * @return
723  * TTransSet<Cmp>::iterator
724  *
725  * @exception Exception
726  * - sorting mismatch (id 68)
727  */
728  Iterator BeginByX2(Idx x2) const;
729 
730  /**
731  * Iterator to first Transition after specified successor state x2.
732  * This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev
733  *
734  * @param x2
735  * Predecessor state index
736  *
737  * @return
738  * TTransSet<Cmp>::Iterator
739  *
740  * @exception Exception
741  * - sorting mismatch (id 68)
742  */
743  Iterator EndByX2(Idx x2) const;
744 
745  /**
746  * Iterator to first Transition specified by successor x2 and ev.
747  * This function requires sorting TransSort::X2EvX1.
748  *
749  * @param x2
750  * Predecessor state index
751  * @param ev
752  * Event index
753  *
754  * @return
755  * TTransSet<Cmp>::Iterator
756  *
757  * @exception Exception
758  * - sorting mismatch (id 68)
759  */
760  Iterator BeginByX2Ev(Idx x2, Idx ev) const;
761 
762  /**
763  * Iterator to first Transition after specified successor x2 and ev.
764  * This function requires sorting TransSort::X2EvX1.
765  *
766  * @param x2
767  * Predecessor state index
768  * @param ev
769  * Event index
770  *
771  * @return
772  * TTransSet<Cmp>::Iterator
773  *
774  * @exception Exception
775  * - sorting mismatch (id 68)
776  */
777  Iterator EndByX2Ev(Idx x2, Idx ev) const;
778 
779  /** @} doxygen group */
780 
781  /** @name Misc */
782  /** @{ doxygen group */
783 
784  /**
785  * Get copy of trantision relation sorted by other compare
786  * operator, e.g. TSort::X2EvX1
787  *
788  * @return
789  * Transition relation
790  */
791  template<class OtherCmp>
792  void ReSort(TTransSet<OtherCmp>& res) const;
793 
794  /**
795  * Get state set covered by transition set
796  *
797  * @return
798  * Set of state indices used by some transition
799  */
800  StateSet States(void) const;
801 
802  /**
803  * Get set of successor states for specified current state
804  *
805  * @param x1
806  * Current state
807  *
808  * @return
809  * Set of state indices
810  */
812 
813  /**
814  * Get set of successor states for specified current states
815  *
816  * @param rX1Set
817  * Current state
818  *
819  * @return
820  * Set of state indices
821  */
822  StateSet SuccessorStates(const StateSet& rX1Set) const;
823 
824  /**
825  * Get set of successor states for specified current state and event
826  *
827  * @param x1
828  * Current state
829  * @param ev
830  * Event
831  *
832  * @return
833  * Set of state indices
834  */
836 
837  /**
838  * Get set of successor states for specified current states and events
839  *
840  * @param rX1Set
841  * Current states
842  * @param rEvSet
843  * Events
844  *
845  * @return
846  * Set of state indices
847  */
848  StateSet SuccessorStates(const StateSet& rX1Set, const EventSet& rEvSet) const;
849 
850 
851  /**
852  * Get set of events that are active for a specified current state
853  * Since a transition set does not refer to a SymbolTable, this function
854  * returns a set of plain indices. In order to interpret the set as an EventSet,
855  * the relevant SymbolTable must be supplied as second argument. If obmitting the second
856  * argument, the defult SymbolTable is used.
857  *
858  * @param x1
859  * Current state
860  * @param pSymTab
861  * SymbolTable to refer to
862  *
863  * @return
864  * Set of events.
865  */
866  EventSet ActiveEvents(Idx x1, SymbolTable* pSymTab=NULL) const;
867 
868  /**
869  * Return pretty printable string representation.
870  * Primary meant for debugging messages.
871  *
872  * @param rTrans
873  * Transition to print
874  *
875  * @return
876  * String
877  */
878  std::string Str(const Transition& rTrans) const;
879 
880 
881  /** @} doxygen group */
882 
883  protected:
884 
885 
886  /**
887  * Assign my members.
888  *
889  * @param rSource
890  * Source to copy from
891  * @return
892  * Ref to this set
893  */
894  void DoAssign(const TTransSet& rSource);
895 
896  /**
897  * Write to TokenWriter, see Type::Write for public wrappers.
898  *
899  * @param rTw
900  * Reference to TokenWriter
901  * @param rLabel
902  * Label of section to write, defaults to name of set
903  * @param pContext
904  * Write context eg symboltables
905  *
906  * @exception Exception
907  * - IO errors (id 2)
908  */
909 
910  virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
911 
912 
913 };
914 
915 /** Type definition for default sorted TTransSet */
917 
918 /** Type definition for default sorted TTransSet */
920 
921 /** Type definition for ev, x1, x2 sorted TTransSet */
923 
924 /** Type definition for ev, x2, x1 sorted TTransSet */
926 
927 /** Type definition for x2, ev, x1 sorted TTransSet */
929 
930 /** Type definition for x2, x1, ev sorted TTransSet */
932 
933 /** Type definition for x1, x2, ev sorted TTransSet */
935 
936 
937 /**
938  * Set of Transitions with attributes.
939  *
940  * This container class is derived from TTransSet to provide attributes as an
941  * additional feature. The template parameter specifies the attribute class,
942  * which in turn must provide some basic funtionality. In contrast to the TTransSet, the TaTransSet
943  * is restricted to standard ordering.
944  *
945  * Note that it is the context of a Generator that
946  * actually allows to interpret a TaTransSet as a set of transitions as opposed to
947  * a set of triples of indices with attributes. In particular, file IO of transitions is provided
948  * by the generator class (although TaTransSet provides output functions for debugging)
949  */
950 
951 
952 template <class Attr>
953 class FAUDES_API TaTransSet : public TransSet, public TAttrMap<Transition,Attr,TransSort::X1EvX2> {
954 
956 
957 public:
958 
959 
960  /** @name Constructors & Destructor */
961  /** @{ doxygen group */
962 
963  /** Construct an empty TaTransSet object */
964  TaTransSet(void);
965 
966  /**
967  * Copy-constructor (incl attributes)
968  */
969  TaTransSet(const TaTransSet& rOtherSet);
970 
971  /**
972  * Copy-Constructor (set attributes to default)
973  */
974  TaTransSet(const TTransSet<TransSort::X1EvX2>& rOtherSet);
975 
976  /** Virtual destructor */
977  virtual ~TaTransSet() {}
978 
979  /** Relaxed assignment method.
980  *
981  * Runtime typecheck for TransSet, maintains attributes provided they can be casted.
982  *
983  * @param rSrc
984  * Source from which to assign
985  * @return
986  * Ref to this set
987  */
988  virtual TaTransSet& Assign(const TBaseSet<Transition,TransSort::X1EvX2>& rSrc);
989 
990  /** Relaxed assignment operator.
991  *
992  * @param rSrc
993  * Source from which to assign
994  * @return
995  * Ref to this set
996  */
997  virtual TaTransSet& operator=(const TransSet& rSrc) {return Assign(rSrc);}
998 
999  /** @} doxygen group */
1000 
1001 
1002 
1003  /** @name Accessing individual transitions */
1004  /** @{ doxygen group */
1005 
1006  /** Iterator on transition */
1008 
1009  /**
1010  * Add a Transition by indices
1011  *
1012  * @param x1
1013  * Predecessor state
1014  * @param ev
1015  * Event
1016  * @param x2
1017  * Successor state
1018  *
1019  * @return
1020  * True if the transition was new to the set
1021  */
1022  bool Insert(Idx x1, Idx ev, Idx x2);
1023 
1024  /**
1025  * Add a Transition directly. If the transition already
1026  * exists, the attribute is maintained. Otherwise, the transition
1027  * is inserted with default attribute.
1028  *
1029  * @param rTransition
1030  * Reference to transition object
1031  *
1032  * @return
1033  * True if the transition was new to the set
1034  */
1035  bool Insert(const Transition& rTransition);
1036 
1037  /**
1038  * Add a Transition with attribute.
1039  *
1040  * @param rTransition
1041  * Reference to transition object
1042  * @param rAttr
1043  * Reference to attribute
1044  *
1045  * @return
1046  * True if the transition was new to the set
1047  */
1048  bool Insert(const Transition& rTransition, const Attr& rAttr);
1049 
1050  /**
1051  * Inserts elements of rOtherSet.
1052  *
1053  * Attributes of this set are maintained, newly inserted elements attain the
1054  * attribute from rOtherSet if it can be casted appropriately.
1055  *
1056  *
1057  * @param rOtherSet
1058  * Other IndexSet
1059  */
1060  virtual void InsertSet(const TransSet& rOtherSet);
1061 
1062  /**
1063  * Inserts elements of rOtherSet.
1064  *
1065  * This variant uses a runtime cast to access attributes.
1066  *
1067  * @param rOtherSet
1068  * Other IndexSet
1069  * @exception Exception
1070  * - cast failed (id 67)
1071  */
1072  virtual void InsertSet(const TBaseSet<Transition,TransSort::X1EvX2>& rOtherSet);
1073 
1074  /**
1075  * Remove a Transition
1076  *
1077  * @return
1078  * True if transition did exist
1079  */
1080  bool Erase(const Transition& t);
1081 
1082  /**
1083  * Remove a Transition
1084  *
1085  * @return
1086  * True if transition did exist
1087  */
1088  bool Erase(Idx x1, Idx ev, Idx x2);
1089 
1090  /**
1091  * Remove a Transition by iterator
1092  *
1093  * @return
1094  * Iterator to next transition
1095  */
1096  Iterator Erase(const Iterator& it);
1097 
1098  /**
1099  * Inserts elements of rOtherSet.
1100  *
1101  * Attributes of this set are maintained.
1102  *
1103  *
1104  * @param rOtherSet
1105  * Other IndexSet
1106  */
1107  virtual void EraseSet(const TransSet& rOtherSet);
1108 
1109  /**
1110  * Inserts elements of rOtherSet.
1111  *
1112  * This variant uses a runtime cast to access attributes.
1113  *
1114  * @param rOtherSet
1115  * Other IndexSet
1116  * @exception Exception
1117  * - cast failed (id 67)
1118  */
1119  virtual void EraseSet(const TBaseSet<Transition,TransSort::X1EvX2>& rOtherSet);
1120 
1121 
1122  /**
1123  * Restrict to specified subset.
1124  *
1125  * Erases any elements no in the specified set. This function
1126  * ignores the attributes of the other set and maintains the attributes
1127  * of the remaining elements in this set.
1128  *
1129  * @param rOtherSet
1130  * Elements to erase
1131  */
1132  void RestrictSet(const TransSet& rOtherSet);
1133 
1134 
1135  /**
1136  * Restrict to specified subset.
1137  *
1138  * This variant uses a runtime cast to access attributes.
1139  *
1140  * @param rOtherSet
1141  * Elements to erase
1142  */
1143  void RestrictSet(const TBaseSet<Transition,TransSort::X1EvX2>& rOtherSet);
1144 
1145 
1146 
1147 
1148  /** resolve ambiguities from attribute interface ("using" wont do the job) */
1151  const Attr& Attribute(const Transition& rElem) const { return TAttrMap<Transition,Attr,TransSort::X1EvX2>::Attribute(rElem); };
1152  void Attribute(const Transition& rElem, const Attr& rAttr) { return TAttrMap<Transition,Attr,TransSort::X1EvX2>::Attribute(rElem,rAttr); };
1153  void Attribute(const Transition& rElem, const Type& rAttr) { return TAttrMap<Transition,Attr,TransSort::X1EvX2>::Attribute(rElem,rAttr); };
1154  void AttributeTry(const Transition& rElem, const Type& rAttr) { return TAttrMap<Transition,Attr,TransSort::X1EvX2>::AttributeTry(rElem,rAttr); };
1155 
1156 
1157  /** @} doxygen group */
1158 
1159 
1160  protected:
1161 
1162  /**
1163  * Assign my members. Maintain attributes.
1164  *
1165  * @param rSource
1166  * Source to copy from
1167  * @return
1168  * Ref to this set
1169  */
1170  void DoAssign(const TaTransSet& rSource);
1171 
1172 };
1173 
1174 /** @} doxygen group*/
1175 
1176 
1177 /*
1178 *************************************************************************************************
1179 *************************************************************************************************
1180 * Implementation of transset without attributes
1181 *************************************************************************************************
1182 *************************************************************************************************
1183 */
1184 
1185 
1186 /* convenience access to relevant scopes */
1187 #define THIS TTransSet<Cmp>
1188 #define TEMP template<class Cmp>
1189 #define BASE TBaseSet<Transition,Cmp>
1190 
1191 // std faudes type
1193 
1194 // TTransSet(void)
1196 {
1197  FD_DC("TTransSet(" << this << ")::TTransSet()");
1198 }
1199 
1200 // TTransSet(othertransrel)
1201  TEMP THIS::TTransSet(const TBaseSet<Transition,Cmp>& rOtherSet) :
1202  BASE()
1203 {
1204  FD_DC("TTransSet(" << this << ")::TTransSet(rOtherSet "<< &rOtherSet <<")");
1205  Assign(rOtherSet);
1206 }
1207 
1208 // TTransSet(othertransrel othersort)
1209 TEMP template<class OtherCmp>
1210 THIS::TTransSet(const TTransSet<OtherCmp>& rOtherSet) :
1211  BASE()
1212 {
1213  FD_DC("TTransSet(" << this << ")::TTransSet(rOtherSet/ReSort "<< &rOtherSet <<")");
1214  rOtherSet.ReSort(*this);
1215 }
1216 
1217 // assignment (maintain attributes)
1218 TEMP void THIS::DoAssign(const TTransSet& rSourceSet) {
1219  FD_DC("TTransSet(" << this << ")::DoAssign(..)");
1220  // call base (incl attributes if the have identival type)
1221  BASE::DoAssign(rSourceSet);
1222 }
1223 
1224 // iterator Begin() const
1225 TEMP typename THIS::Iterator THIS::Begin(void) const {
1226  return BASE::Begin();
1227 }
1228 
1229 // iterator End() const
1230 TEMP typename THIS::Iterator THIS::End(void) const {
1231  return BASE::End();
1232 }
1233 
1234 
1235 // Convenience macro for order typecheck
1236 #define SORT_EXCEPTION { std::stringstream errstr; \
1237  errstr << "Transition set order mismatch " << std::endl; \
1238  throw Exception("TransSet::Iterator()", errstr.str(), 68); }
1239 
1240 
1241 // iterator Begin(x1) const
1242 TEMP typename THIS::Iterator THIS::Begin(Idx x1) const {
1243 #ifdef FAUDES_CHECKED
1244  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1245  if(typeid(Cmp)!=typeid(TransSort::X1X2Ev))
1247 #endif
1248  Transition tlx(x1,0,0);
1249  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1250 }
1251 
1252 // iterator End(x1) const
1253 TEMP typename THIS::Iterator THIS::End(Idx x1) const {
1254 #ifdef FAUDES_CHECKED
1255  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1256  if(typeid(Cmp)!=typeid(TransSort::X1X2Ev))
1258 #endif
1259  Transition tlx(x1+1,0,0);
1260  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1261 }
1262 
1263 // iterator Begin(x1,ev) const
1264 TEMP typename THIS::Iterator THIS::Begin(Idx x1, Idx ev) const {
1265 #ifdef FAUDES_CHECKED
1266  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1268 #endif
1269  Transition tlx(x1,ev,0);
1270  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1271 }
1272 
1273 // iterator End(x1,ev) const
1274 TEMP typename THIS::Iterator THIS::End(Idx x1, Idx ev) const {
1275 #ifdef FAUDES_CHECKED
1276  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1278 #endif
1279  Transition tlx(x1,ev+1, 0);
1280  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1281 }
1282 
1283 // iterator BeginByEv(ev) const
1284 TEMP typename THIS::Iterator THIS::BeginByEv(Idx ev) const {
1285 #ifdef FAUDES_CHECKED
1286  if(typeid(Cmp)!=typeid(TransSort::EvX1X2))
1287  if(typeid(Cmp)!=typeid(TransSort::EvX2X1))
1289 #endif
1290  Transition tlx(0,ev,0);
1291  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1292 }
1293 
1294 // iterator EndByEv(ev) const
1295 TEMP typename THIS::Iterator THIS::EndByEv(Idx ev) const {
1296 #ifdef FAUDES_CHECKED
1297  if(typeid(Cmp)!=typeid(TransSort::EvX1X2))
1298  if(typeid(Cmp)!=typeid(TransSort::EvX2X1))
1300 #endif
1301  Transition tlx(0,ev+1,0);
1302  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1303 }
1304 
1305 // iterator BeginByEvX1(ev,x1) const
1306 TEMP typename THIS::Iterator THIS::BeginByEvX1(Idx ev, Idx x1) const {
1307 #ifdef FAUDES_CHECKED
1308  if(typeid(Cmp)!=typeid(TransSort::EvX1X2))
1310 #endif
1311  Transition tlx(x1,ev,0);
1312  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1313 }
1314 
1315 // iterator EndByEvX1(ev,x1) const
1316 TEMP typename THIS::Iterator THIS::EndByEvX1(Idx ev, Idx x1) const {
1317 #ifdef FAUDES_CHECKED
1318  if(typeid(Cmp)!=typeid(TransSort::EvX1X2))
1320 #endif
1321  Transition tlx(x1+1,ev,0);
1322  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1323 }
1324 
1325 // iterator BeginByEvX2(ev,x2) const
1326 TEMP typename THIS::Iterator THIS::BeginByEvX2(Idx ev, Idx x2) const {
1327 #ifdef FAUDES_CHECKED
1328  if(typeid(Cmp)!=typeid(TransSort::EvX2X1))
1330 #endif
1331  Transition tlx(0,ev,x2);
1332  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1333 }
1334 
1335 // iterator EndByEvX2(ev,x2) const
1336 TEMP typename THIS::Iterator THIS::EndByEvX2(Idx ev, Idx x2) const {
1337 #ifdef FAUDES_CHECKED
1338  if(typeid(Cmp)!=typeid(TransSort::EvX2X1))
1340 #endif
1341  Transition tlx(0,ev,x2+1);
1342  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1343 }
1344 
1345 // iterator BeginByX2(x2) const
1346 TEMP typename THIS::Iterator THIS::BeginByX2(Idx x2) const {
1347 #ifdef FAUDES_CHECKED
1348  if(typeid(Cmp)!=typeid(TransSort::X2EvX1))
1349  if(typeid(Cmp)!=typeid(TransSort::X2X1Ev))
1351 #endif
1352  Transition tlx(0,0,x2);
1353  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1354 }
1355 
1356 // iterator EndByX2(x2) const
1357 TEMP typename THIS::Iterator THIS::EndByX2(Idx x2) const {
1358 #ifdef FAUDES_CHECKED
1359  if(typeid(Cmp)!=typeid(TransSort::X2EvX1))
1360  if(typeid(Cmp)!=typeid(TransSort::X2X1Ev))
1362 #endif
1363  Transition tlx(0,0,x2+1);
1364  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1365 }
1366 
1367 // iterator BeginByX2Ev(x2,ev) const
1368 TEMP typename THIS::Iterator THIS::BeginByX2Ev(Idx x2, Idx ev) const {
1369 #ifdef FAUDES_CHECKED
1370  if(typeid(Cmp)!=typeid(TransSort::X2EvX1))
1372 #endif
1373  Transition tlx(0,ev,x2);
1374  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1375 }
1376 
1377 // iterator EndByX2Ev(x2,ev) const
1378 TEMP typename THIS::Iterator THIS::EndByX2Ev(Idx x2, Idx ev) const {
1379 #ifdef FAUDES_CHECKED
1380  if(typeid(Cmp)!=typeid(TransSort::X2EvX1))
1382 #endif
1383  Transition tlx(0,ev+1,x2);
1384  return THIS::ThisIterator(BASE::pSet->lower_bound(tlx));
1385 }
1386 
1387 
1388 
1389 // DoWrite(rw,label)
1390 TEMP void THIS::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const
1391 {
1392  (void) pContext;
1393  std::string label=rLabel;
1394  if(label=="") label=BASE::Name();
1395  rTw.WriteBegin(label);
1396  int oldcolumns = rTw.Columns();
1397  rTw.Columns(3);
1398 
1399  Iterator tit;
1400  for (tit = Begin(); tit != End(); ++tit) {
1401  rTw << tit->X1; rTw << tit->Ev; rTw << tit->X2;
1402  }
1403 
1404  rTw.WriteEnd(label);
1405  rTw.Columns(oldcolumns);
1406 }
1407 
1408 
1409 // Insert(transition)
1410 TEMP bool THIS::Insert(const Transition& t) {
1411  return BASE::Insert(t);
1412 }
1413 
1414 // Insert(x1,ev,x2)
1415 TEMP bool THIS::Insert(Idx x1, Idx ev, Idx x2) {
1416  FD_DC("TTransSet(" << this << ")::Insert(" << x1 << "-" << ev << "-" << x2 << ")");
1417  return BASE::Insert(Transition(x1, ev, x2));
1418 }
1419 
1420 // Inject(transition)
1421 TEMP typename THIS::Iterator THIS::Inject(const Iterator& pos, const Transition& t) {
1422  return BASE::Inject(pos,t);
1423 }
1424 
1425 // Inject(transition)
1426 TEMP void THIS::Inject(const Transition& t) {
1427  BASE::Inject(t);
1428 }
1429 
1430 
1431 // Erase(transition)
1432 TEMP bool THIS::Erase(const Transition& t) {
1433  FD_DC("TTransSet(" << this << ")::Erase(" << t.Str() << " [t])");
1434  return BASE::Erase(t);
1435 }
1436 
1437 // Erase(x1,ev,x2)
1438 TEMP bool THIS::Erase(Idx x1, Idx ev, Idx x2) {
1439  FD_DC("TTransSet(" << this << ")::Erase(" << x1 << "-" << ev << "-" << x2 << ")");
1440  return BASE::Erase(Transition(x1, ev, x2));
1441 }
1442 
1443 // Erase(it)
1444 TEMP typename THIS::Iterator THIS::Erase(const Iterator& it) {
1445  FD_DC("TTransSet(" << this << ")::Erase(" << this->Str(*it) << " [it])");
1446  return BASE::Erase(it);
1447 }
1448 
1449 // EraseByX1(x)
1450 TEMP void THIS::EraseByX1(Idx x1) {
1451  FD_DC("TTransSet(" << this << ")::EraseByX1(" << x1 << ")");
1452 #ifdef FAUDES_CHECKED
1453  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1454  if(typeid(Cmp)!=typeid(TransSort::X1X2Ev))
1456 #endif
1457  this->Detach();
1458  typename BASE::iterator lower, upper, it;
1459  Transition tl(x1,0,0);
1460  Transition tu(x1+1,0,0);
1461  lower = BASE::pSet->lower_bound(tl);
1462  upper = BASE::pSet->upper_bound(tu);
1463  if(this->AttributesSize()!=0)
1464  for(it=lower; it!=upper; ++it)
1465  BASE::ClrAttribute(*it);
1466  BASE::pSet->erase(lower, upper);
1467 }
1468 
1469 // EraseByX1Ev(x,e)
1470 TEMP void THIS::EraseByX1Ev(Idx x1, Idx ev) {
1471  FD_DC("TTransSet(" << this << ")::EraseByX1Ev(" << x1 << "," << ev << ")");
1472 #ifdef FAUDES_CHECKED
1473  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1475 #endif
1476  this->Detach();
1477  typename BASE::iterator lower, upper, it;
1478  Transition tl(x1,ev,0);
1479  Transition tu(x1,ev+1,0);
1480  lower = BASE::pSet->lower_bound(tl);
1481  upper = BASE::pSet->upper_bound(tu);
1482  if(this->AttributesSize()!=0)
1483  for(it=lower; it!=upper; ++it)
1484  BASE::ClrAttribute(*it);
1485  BASE::pSet->erase(lower, upper);
1486 }
1487 
1488 // EraseByX2(x)
1489 TEMP void THIS::EraseByX2(Idx x2) {
1490  FD_DC("TTransSet(" << this << ")::EraseByX2(" << x2 << ")");
1491  this->Detach();
1492  bool doattr = (this->AttributesSize()!=0);
1493  typename BASE::iterator it;
1494  for(it = BASE::pSet->begin(); it != BASE::pSet->end();) {
1495  if(it->X2 == x2) {
1496  if(doattr) BASE::ClrAttribute(*it);
1497  BASE::pSet->erase(it++);
1498  continue;
1499  }
1500  it++;
1501  }
1502 }
1503 
1504 // EraseByEv(ev)
1505 TEMP void THIS::EraseByEv(Idx ev) {
1506  FD_DC("TTransSet(" << this << ")::EraseByEv(" << ev << ")");
1507  this->Detach();
1508  bool doattr = (this->AttributesSize()!=0);
1509  typename BASE::iterator it;
1510  for(it = BASE::pSet->begin(); it != BASE::pSet->end();) {
1511  if (it->Ev == ev) {
1512  if(doattr) BASE::ClrAttribute(*it);
1513  BASE::pSet->erase(it++);
1514  continue;
1515  }
1516  it++;
1517  }
1518 }
1519 
1520 
1521 // EraseByX1OrX2(x)
1522 TEMP void THIS::EraseByX1OrX2(Idx x) {
1523  FD_DC("TTransSet(" << this << ")::EraseByX1OrX2(" << x << ")");
1524  this->Detach();
1525  bool doattr = (this->AttributesSize()!=0);
1526  typename BASE::iterator it;
1527  for(it = BASE::pSet->begin(); it != BASE::pSet->end();) {
1528  if ((it->X1 == x) || (it->X2 == x)) {
1529  if(doattr) BASE::ClrAttribute(*it);
1530  BASE::pSet->erase(it++);
1531  continue;
1532  }
1533  it++;
1534  }
1535  FD_DC("TTransSet(" << this << ")::EraseByX1OrX2(" << x << "): done");
1536 }
1537 
1538 
1539 // EraseByX1OrX2(xset)
1540 TEMP void THIS::EraseByX1OrX2(const StateSet& rStates) {
1541  FD_DC("TTransSet(" << this << ")::EraseByX1OrX2(#" << rStates.Size() <<")");
1542  this->Detach();
1543  bool doattr = (this->AttributesSize()!=0);
1544  typename BASE::iterator it=BASE::pSet->begin();
1545  while(it != BASE::pSet->end()) {
1546  if(!rStates.Exists(it->X1) && !rStates.Exists(it->X2)) { ++it; continue;}
1547  if(doattr) BASE::ClrAttribute(*it);
1548  BASE::pSet->erase(it++);
1549  }
1550  FD_DC("TTransSet(" << this << ")::EraseByX1OrX2(): done");
1551 }
1552 
1553 
1554 // RestrictStates(xset)
1555 TEMP void THIS::RestrictStates(const StateSet& rStates) {
1556  FD_DC("TTransSet(" << this << ")::RestrictByX1AndX2(#" << rStates.Size() <<")");
1557  this->Detach();
1558  bool doattr = (this->AttributesSize()!=0);
1559  typename BASE::iterator it;
1560  it = BASE::pSet->begin();
1561  while(it != BASE::pSet->end()) {
1562  if(rStates.Exists(it->X1) && rStates.Exists(it->X2)) { ++it; continue;}
1563  if(doattr) BASE::ClrAttribute(*it);
1564  BASE::pSet->erase(it++);
1565  }
1566  FD_DC("TTransSet(" << this << ")::EraseByX1OrX2(): done");
1567 }
1568 
1569 
1570 // RestrictEvents(eset)
1571 TEMP void THIS::RestrictEvents(const EventSet& rEvents) {
1572  FD_DC("TTransSet(" << this << ")::RestrictEvents(#" << rEvents.Size() <<")");
1573  this->Detach();
1574  bool doattr = (this->AttributesSize()!=0);
1575  typename BASE::iterator it;
1576  it = BASE::pSet->begin();
1577  while(it != BASE::pSet->end()) {
1578  if(rEvents.Exists(it->Ev)) { ++it; continue;}
1579  if(doattr) BASE::ClrAttribute(*it);
1580  BASE::pSet->erase(it++);
1581  }
1582  FD_DC("TTransSet(" << this << ")::RestrictEvents(): done");
1583 }
1584 
1585 
1586 // iterator Find(x1,ev,x2)
1587 TEMP typename THIS::Iterator THIS::Find(Idx x1, Idx ev, Idx x2) const {
1588  return BASE::Find(Transition(x1,ev,x2));
1589 }
1590 
1591 
1592 // iterator Find(t)
1593 TEMP typename THIS::Iterator THIS::Find(const Transition& t) const{
1594  return BASE::Find(t);
1595 }
1596 
1597 // Exists(t)
1598 TEMP bool THIS::Exists(const Transition& t) const {
1599  return BASE::Exists(t);
1600 }
1601 
1602 // Exists(x1, ev, x2)
1603 TEMP bool THIS::Exists(Idx x1, Idx ev, Idx x2) const {
1604  return BASE::Exists(Transition(x1,ev,x2));
1605 }
1606 
1607 // Exists(x)
1608 TEMP bool THIS::ExistsByX1OrX2(Idx x) const {
1609  typename BASE::iterator it;
1610  for(it = BASE::pSet->begin(); it != BASE::pSet->end(); ++it) {
1611  if ((it->X1 == x) || (it->X2 == x)) {
1612  return true;
1613  }
1614  }
1615  return false;
1616 }
1617 
1618 // ExistsByX1Ev(x,e)
1619 TEMP bool THIS::ExistsByX1Ev(Idx x1, Idx ev) const {
1620  FD_DC("TTransSet(" << this << ")::ExistsByX1Ev(" << x1 << "," << ev << ")");
1621 #ifdef FAUDES_CHECKED
1622  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1624 #endif
1625  this->Detach();
1626  typename BASE::iterator lower, upper, it;
1627  Transition tl(x1,ev,0);
1628  Transition tu(x1,ev+1,0);
1629  lower = BASE::pSet->lower_bound(tl);
1630  upper = BASE::pSet->upper_bound(tu);
1631  return lower != upper;
1632 }
1633 
1634 // ExistsByX1(x)
1635 TEMP bool THIS::ExistsByX1(Idx x1) const {
1636  FD_DC("TTransSet(" << this << ")::ExistsByX1(" << x1 << ")");
1637 #ifdef FAUDES_CHECKED
1638  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1639  if(typeid(Cmp)!=typeid(TransSort::X1X2Ev))
1641 #endif
1642  this->Detach();
1643  typename BASE::iterator lower, upper, it;
1644  Transition tl(x1,0,0);
1645  Transition tu(x1+1,0,0);
1646  lower = BASE::pSet->lower_bound(tl);
1647  upper = BASE::pSet->upper_bound(tu);
1648  return lower != upper;
1649 }
1650 
1651 
1652 // ReSort(res)
1653 TEMP template<class OtherCmp>
1654 void THIS::ReSort(TTransSet<OtherCmp>& res) const {
1655  Iterator it;
1656  res.Clear();
1657  for (it = Begin(); it != End(); ++it) {
1658  res.Insert(*it);
1659  }
1660 }
1661 
1662 // States()
1663 TEMP StateSet THIS::States(void) const {
1664  StateSet states;
1665  Iterator it;
1666  for (it=Begin(); it!=End(); ++it) {
1667  states.Insert(it->X1);
1668  states.Insert(it->X2);
1669  }
1670  return states;
1671 }
1672 
1673 // SuccessorStates(x1)
1674 TEMP StateSet THIS::SuccessorStates(Idx x1) const {
1675 #ifdef FAUDES_CHECKED
1676  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1677  if(typeid(Cmp)!=typeid(TransSort::X1X2Ev))
1679 #endif
1680  StateSet states;
1681  Iterator it = Begin(x1);
1682  Iterator it_end = End(x1);
1683  while (it != it_end) {
1684  states.Insert(it->X2);
1685  ++it;
1686  }
1687  return states;
1688 }
1689 
1690 // SuccessorStates(x1set)
1691 TEMP StateSet THIS::SuccessorStates(const StateSet& rX1Set) const {
1692 #ifdef FAUDES_CHECKED
1693  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1694  if(typeid(Cmp)!=typeid(TransSort::X1X2Ev))
1696 #endif
1697  StateSet states;
1698  StateSet::Iterator sit= rX1Set.Begin();
1699  StateSet::Iterator sit_end= rX1Set.End();
1700  for(;sit!=sit_end; ++sit) {
1701  Iterator tit = Begin(*sit);
1702  Iterator tit_end = End(*sit);
1703  while(tit!=tit_end) {
1704  states.Insert(tit->X2);
1705  ++tit;
1706  }
1707  }
1708  return states;
1709 }
1710 
1711 // SuccessorStates(x1, ev)
1712 TEMP StateSet THIS::SuccessorStates(Idx x1, Idx ev) const {
1713 #ifdef FAUDES_CHECKED
1714  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1716 #endif
1717  StateSet states;
1718  Iterator it = Begin(x1, ev);
1719  Iterator it_end = End(x1, ev);
1720  while (it != it_end) {
1721  states.Insert(it->X2);
1722  ++it;
1723  }
1724  return states;
1725 }
1726 
1727 // SuccessorStates(x1set, evset)
1728 TEMP StateSet THIS::SuccessorStates(const StateSet& rX1Set, const EventSet& rEvSet) const {
1729 #ifdef FAUDES_CHECKED
1730  if(typeid(Cmp)!=typeid(TransSort::X1EvX2))
1732 #endif
1733  StateSet states;
1734  if(rEvSet.Empty()) return states;
1735  StateSet::Iterator sit= rX1Set.Begin();
1736  StateSet::Iterator sit_end= rX1Set.End();
1737  for(;sit!=sit_end; ++sit) {
1738  EventSet::Iterator eit= rEvSet.Begin();
1739  EventSet::Iterator eit_end= rEvSet.End();
1740  Iterator tit = Begin(*sit,*eit);
1741  Iterator tit_end = End(*sit);
1742  while(tit!=tit_end) {
1743  // match
1744  if(tit->Ev == *eit) {
1745  states.Insert(tit->X2);
1746  ++tit;
1747  continue;
1748  }
1749  // tit behind
1750  if(tit->Ev < *eit) {
1751  ++tit;
1752  continue;
1753  }
1754  // tit upfront
1755  ++eit;
1756  if(eit==eit_end) break;
1757  }
1758  }
1759  return states;
1760 }
1761 
1762 // ActiveEvents(x1,pSymTab)
1763 TEMP EventSet THIS::ActiveEvents(Idx x1, SymbolTable* pSymTab) const {
1764  Iterator it = Begin(x1);
1765  Iterator it_end = End(x1);
1766  EventSet result;
1767  if(pSymTab!=NULL) result.SymbolTablep(pSymTab);
1768  for (; it != it_end; ++it) {
1769  result.Insert(it->Ev);
1770  }
1771  return result;
1772 }
1773 
1774 // Prettz printable sring
1775 TEMP std::string THIS::Str(const Transition& rTrans) const {
1776  return rTrans.Str();
1777 }
1778 
1779 
1780 
1781 #undef THIS
1782 #undef TEMP
1783 #undef BASE
1784 
1785 /*
1786 *************************************************************************************************
1787 *************************************************************************************************
1788 * Implementation of transset with attributes
1789 *************************************************************************************************
1790 *************************************************************************************************
1791 */
1792 
1793 
1794 /* convenience access to relevant scopes */
1795 #define THIS TaTransSet<Attr>
1796 #define TEMP template <class Attr>
1797 #define BASE TTransSet<TransSort::X1EvX2>
1798 #define ABASE TAttrMap<Transition,Attr,TransSort::X1EvX2>
1799 
1800 // std faudes type
1802 
1803 // TaTransSet(void)
1805  BASE(),
1806  ABASE(this)
1807 {
1808  FD_DC("TaTransSet(" << this << ")::TaTransSet()");
1809 }
1810 
1811 // TaTransSet(othertransrel)
1812 TEMP THIS::TaTransSet(const TaTransSet& rOtherSet) :
1813  BASE(),
1814  ABASE(this)
1815 {
1816  FD_DC("TaTransSet(" << this << ")::TaTransSet(rOtherSet "<< &rOtherSet <<")");
1817  DoAssign(rOtherSet);
1818 }
1819 
1820 
1821 // TaTransSet(othertransrel)
1822 TEMP THIS::TaTransSet(const BASE& rOtherSet) :
1823  BASE(),
1824  ABASE(this)
1825 {
1826  FD_DC("TaTransSet(" << this << ")::TaTransSet(rOtherSet "<< &rOtherSet <<")");
1827  Assign(rOtherSet);
1828 }
1829 
1830 
1831 // copy to known same attributes
1832 TEMP void THIS::DoAssign(const THIS& rSourceSet) {
1833  // call base incl attributes
1834  BASE::DoAssign(rSourceSet);
1835 }
1836 
1837 // Relaxed Assign()
1838 TEMP THIS& THIS::Assign(const TBaseSet<Transition,TransSort::X1EvX2>& rSourceSet) {
1839  FD_DC("TaTransSet(" << this << ")::Assign([v] " << &rSourceSet<<")");
1840 #ifdef FAUDES_CHECKED
1841  FD_DC("TaTransSet(" << this << ")::Assign(): src at " << &rSourceSet);
1842  FD_DC("TaTransSet(" << this << ")::Assign(): src type " << typeid(rSourceSet).name());
1843  FD_DC("TaTransSet(" << this << ")::Assign(): dst type " << typeid(*this).name());
1844  const TransSet* tset = dynamic_cast<const TransSet*>(&rSourceSet);
1845  if(!tset) {
1846  std::stringstream errstr;
1847  errstr << "cannot cast " << typeid(rSourceSet).name() << " to TransSet" << std::endl;
1848  throw Exception("TaTransSet::Assign", errstr.str(), 67);
1849  }
1850 #endif
1851  // call attribute smart base
1852  ABASE::AssignWithAttributes(rSourceSet);
1853  // done
1854  return *this;
1855 }
1856 
1857 
1858 // Insert(transition)
1859 TEMP bool THIS::Insert(const Transition& t) {
1860  FD_DC("TaTransSet(" << this << ")::Insert(" << t.Str() << ")");
1861  return ABASE::Insert(t);
1862 }
1863 
1864 // Insert(x1,ev,x2)
1865 TEMP bool THIS::Insert(Idx x1, Idx ev, Idx x2) {
1866  FD_DC("TaTransSet(" << this << ")::Insert(" << x1 << "-" << ev << "-" << x2 << ")");
1867  Transition t(x1, ev, x2);
1868  return ABASE::Insert(t);
1869 }
1870 
1871 // Insert(transition,attr)
1872 TEMP bool THIS::Insert(const Transition& t, const Attr& attr) {
1873  return ABASE::Insert(t,attr);
1874 }
1875 
1876 
1877 // InsertSet(set)
1878 TEMP void THIS::InsertSet(const TransSet& rOtherSet) {
1879  FD_DC("TaTransSet(" << this << ")::InsertSet( [a] " << &rOtherSet << ")");
1880  ABASE::InsertSet(rOtherSet);
1881 }
1882 
1883 // InsertSet(set)
1884 TEMP void THIS::InsertSet(const TBaseSet<Transition,TransSort::X1EvX2>& rOtherSet) {
1885 #ifdef FAUDES_CHECKED
1886  FD_DC("TaTransSet(" << this << ")::InsertSet(" << rOtherSet.ToString() << ")");
1887  const TransSet* tset = dynamic_cast<const TransSet*>(&rOtherSet);
1888  if(!tset) {
1889  std::stringstream errstr;
1890  errstr << "cannot cast " << typeid(rOtherSet).name() << " to TransSet" << std::endl;
1891  throw Exception("TaTransSet::InsertSet", errstr.str(), 67);
1892  }
1893 #endif
1894  ABASE::InsertSet(rOtherSet);
1895 }
1896 
1897 
1898 // Erase(transition)
1899 TEMP bool THIS::Erase(const Transition& t) {
1900  return ABASE::Erase(t);
1901 }
1902 
1903 // Erase(x1,ev,x2)
1904 TEMP bool THIS::Erase(Idx x1, Idx ev, Idx x2) {
1905  FD_DC("TaTransSet(" << this << ")::Erase(" << x1 << "-" << ev << "-" << x2 << ")");
1906  Transition t(x1, ev, x2);
1907  return ABASE::Erase(t);
1908 }
1909 
1910 // Erase(it)
1911 TEMP typename THIS::Iterator THIS::Erase(const Iterator& it) {
1912 #ifdef FAUDES_CHECKED
1913  if (it == End()) {
1914  std::stringstream errstr;
1915  errstr << "iterator out of range " << std::endl;
1916  throw Exception("TTransSet::Erase", errstr.str(), 69);
1917  }
1918 #endif
1919  return ABASE::Erase(it);
1920 }
1921 
1922 // EraseSet(set)
1923 TEMP void THIS::EraseSet(const TransSet& rOtherSet) {
1924  FD_DC("TaTransSet(" << this << ")::RestrictSet( [a] " << &rOtherSet << ")");
1925  ABASE::EraseSet(rOtherSet);
1926 }
1927 
1928 // EraseSet(set)
1929 TEMP void THIS::EraseSet(const TBaseSet<Transition,TransSort::X1EvX2>& rOtherSet) {
1930 #ifdef FAUDES_CHECKED
1931  FD_DC("TaTransSet(" << this << ")::EraseSet(" << rOtherSet.ToString() << ")");
1932  const TransSet* tset = dynamic_cast<const TransSet*>(&rOtherSet);
1933  if(!tset) {
1934  std::stringstream errstr;
1935  errstr << "cannot cast " << typeid(rOtherSet).name() << " to TransSet" << std::endl;
1936  throw Exception("TaTransSet::EraseSet", errstr.str(), 67);
1937  }
1938 #endif
1939  ABASE::EraseSet(rOtherSet);
1940 }
1941 
1942 // RestrictSet(set)
1943 TEMP void THIS::RestrictSet(const TransSet& rOtherSet) {
1944  FD_DC("TaTransSet(" << this << ")::RestrictSet( [a] " << &rOtherSet << ")");
1945  ABASE::RestrictSet(rOtherSet);
1946 }
1947 
1948 
1949 // RestrictSet(set)
1950 TEMP void THIS::RestrictSet(const TBaseSet<Transition,TransSort::X1EvX2>& rOtherSet) {
1951 #ifdef FAUDES_CHECKED
1952  FD_DC("TaTransSet(" << this << ")::RestrictSet(" << rOtherSet.ToString() << ")");
1953  const TransSet* tset = dynamic_cast<const TransSet*>(&rOtherSet);
1954  if(!tset) {
1955  std::stringstream errstr;
1956  errstr << "cannot cast " << typeid(rOtherSet).name() << " to TransSet" << std::endl;
1957  throw Exception("TaTransSet::RestrictSet", errstr.str(), 67);
1958  }
1959 #endif
1960  ABASE::RestrictSet(rOtherSet);
1961 }
1962 
1963 
1964 
1965 #undef THIS
1966 #undef TEMP
1967 #undef BASE
1968 #undef ABASE
1969 
1970 #undef SORT_EXECPTION
1971 
1972 } // namespace faudes
1973 
1974 
1975 
1976 
1977 #endif
1978 
Classes AttributeVoid and AttributeFlags
Class TAttrMap.
Class TBaseSet.
Compiletime options.
#define FD_DC(message)
Debug: optional report on container operations.
Classes IndexSet, TaIndexSet.
Classes NameSet, TaNameSet.
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
Class TokenReader.
#define TEMP
#define BASE
#define SORT_EXCEPTION
#define ABASE
#define THIS
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
faudes type declaration macro
Definition: cfl_types.h:867
#define FAUDES_TYPE_TIMPLEMENTATION(ftype, ctype, cbase, ctemp)
faudes type implementation macros, overall
Definition: cfl_types.h:972
Faudes exception class.
Set of indices.
Definition: cfl_indexset.h:78
Idx Insert(void)
Insert new index to set.
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
bool Exists(const Idx &rIndex) const
Test existence of index.
SymbolTable * SymbolTablep(void) const
Get Pointer mpSymbolTable.
bool Insert(const Idx &rIndex)
Add an element by index.
A SymbolTable associates sybolic names with indices.
Attribute interface for TBaseSet.
Definition: cfl_attrmap.h:52
const Attr & Attribute(const T &rElem) const
Get attribute by element.
Definition: cfl_attrmap.h:464
Attr * Attributep(const T &rElem)
Get attribute reference by element.
Definition: cfl_attrmap.h:446
void AttributeTry(const T &rElem, const Type &attr)
Set attribute.
Definition: cfl_attrmap.h:499
const Attr * AttributeType(void) const
Attribute typeinfo.
Definition: cfl_attrmap.h:438
Iterator class for high-level api to TBaseSet.
Definition: cfl_baseset.h:387
STL style set template.
Definition: cfl_baseset.h:93
Set of Transitions.
Definition: cfl_transset.h:242
Iterator EndByEvX2(Idx ev, Idx x2) const
Iterator to first Transition after specified event and next state.
Iterator Begin(void) const
Iterator to begin of set.
Iterator End(void) const
Iterator to end of set.
bool ExistsByX1OrX2(Idx x) const
Tests if a transition with specified predecessor or successor state exists.
bool Insert(Idx x1, Idx ev, Idx x2)
Add a Transition by indices.
Iterator Find(Idx x1, Idx ev, Idx x2) const
Find transition given by x1, ev, x2.
void EraseByEv(Idx ev)
Remove all transitions containing event ev.
bool Erase(Idx x1, Idx ev, Idx x2)
Remove a Transition by x1, ev, x2.
Iterator Find(const Transition &t) const
Find specified transition.
Iterator BeginByX2Ev(Idx x2, Idx ev) const
Iterator to first Transition specified by successor x2 and ev.
Iterator Begin(Idx x1) const
Iterator to first Transition specified by current state.
void EraseByX1(Idx x1)
Remove all transitions containing predecessor state x1.
TTransSet(void)
Construct an empty TTransSet object.
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
Write to TokenWriter, see Type::Write for public wrappers.
EventSet ActiveEvents(Idx x1, SymbolTable *pSymTab=NULL) const
Get set of events that are active for a specified current state Since a transition set does not refer...
Iterator Begin(Idx x1, Idx ev) const
Iterator to first Transitions specified by current state and event.
StateSet SuccessorStates(const StateSet &rX1Set) const
Get set of successor states for specified current states.
TTransSet(const TBaseSet< Transition, Cmp > &rOtherSet)
Copy-constructor.
bool Exists(const Transition &t) const
Test existence.
void EraseByX2(Idx x2)
Remove all transitions containing successor state x2.
Iterator BeginByEvX1(Idx ev, Idx x1) const
Iterator to first Transition specified by event and current state.
Iterator End(Idx x1, Idx ev) const
Iterator to first Transition after spcified current state and event.
StateSet SuccessorStates(Idx x1, Idx ev) const
Get set of successor states for specified current state and event.
void RestrictStates(const StateSet &rStateSet)
Restrict to transitions with states as specified.
Iterator EndByEv(Idx ev) const
Iterator to first Transition after specified by event.
Iterator EndByEvX1(Idx ev, Idx x1) const
Iterator to first Transition after specified ev and current state.
Iterator EndByX2Ev(Idx x2, Idx ev) const
Iterator to first Transition after specified successor x2 and ev.
StateSet States(void) const
Get state set covered by transition set.
Iterator BeginByX2(Idx x2) const
Iterator to first Transition specified by successor state x2.
TTransSet(const TTransSet< OtherCmp > &res)
Re-Sort Copy-constructor.
void EraseByX1Ev(Idx x1, Idx ev)
Remove all transitions containing predecessor state x1 and event ev.
Iterator BeginByEv(Idx ev) const
Iterator to first Transition specified by event.
bool Insert(const Transition &rTransition)
Add a Transition.
Iterator EndByX2(Idx x2) const
Iterator to first Transition after specified successor state x2.
bool ExistsByX1Ev(Idx x1, Idx ev) const
Test existence.
Iterator Inject(const Iterator &pos, const Transition &rTransition)
Add a Transition.
bool Exists(Idx x1, Idx ev, Idx x2) const
Test existence.
Iterator Erase(const Iterator &it)
Remove a Transition by iterator.
void DoAssign(const TTransSet &rSource)
Assign my members.
virtual ~TTransSet()
Virtual destructor.
Definition: cfl_transset.h:268
void Inject(const Transition &rTransition)
Add a Transition.
bool Erase(const Transition &t)
Remove a Transition.
StateSet SuccessorStates(Idx x1) const
Get set of successor states for specified current state.
void EraseByX1OrX2(const StateSet &rStates)
Remove all transitions containing a specified state.
void RestrictEvents(const EventSet &rEventSet)
Restrict to transitions with events as specified.
void EraseByX1OrX2(Idx x)
Remove all transitions containing state x, This function iterates over all transitions to work with a...
TBaseSet< Transition, Cmp >::Iterator Iterator
Iterator on transition.
Definition: cfl_transset.h:268
Iterator End(Idx x1) const
Iterator to end or Transitions with specified current state.
StateSet SuccessorStates(const StateSet &rX1Set, const EventSet &rEvSet) const
Get set of successor states for specified current states and events.
std::string Str(const Transition &rTrans) const
Return pretty printable string representation.
void ReSort(TTransSet< OtherCmp > &res) const
Get copy of trantision relation sorted by other compare operator, e.g.
bool ExistsByX1(Idx x1) const
Test existence.
Iterator BeginByEvX2(Idx ev, Idx x2) const
Iterator to first Transition specified by event and next state.
Set of Transitions with attributes.
Definition: cfl_transset.h:953
virtual TaTransSet & Assign(const TBaseSet< Transition, TransSort::X1EvX2 > &rSrc)
Relaxed assignment method.
virtual ~TaTransSet()
Virtual destructor.
Definition: cfl_transset.h:977
virtual TaTransSet & operator=(const TransSet &rSrc)
Relaxed assignment operator.
Definition: cfl_transset.h:997
Attr * Attributep(const Transition &rElem)
TTransSet< TransSort::X1EvX2 >::Iterator Iterator
Iterator on transition.
void DoAssign(const TaTransSet &rSource)
Assign my members.
void AttributeTry(const Transition &rElem, const Type &rAttr)
Attribute access.
void Attribute(const Transition &rElem, const Attr &rAttr)
const Attr * AttributeType(void) const
resolve ambiguities from attribute interface ("using" wont do the job)
void Attribute(const Transition &rElem, const Type &rAttr)
const Attr & Attribute(const Transition &rElem) const
A TokenWriter writes sequential tokens to a file, a string or stdout.
void WriteEnd(const std::string &rLabel)
Write end label.
int Columns(void) const
Get number of columns in a line.
void WriteBegin(const std::string &rLabel)
Write begin label.
Alternative ordering of Transitions.
Definition: cfl_transset.h:123
Triple (X1,Ev,X2) to represent current state, event and next state.
Definition: cfl_transset.h:57
Transition(Idx x1, Idx ev, Idx x2)
Construct from values.
Definition: cfl_transset.h:73
Idx X1
Current state.
Definition: cfl_transset.h:99
bool Valid(void) const
Test validity (all indices !=0)
Definition: cfl_transset.h:97
std::string Str(void) const
Pretty print to string.
Definition: cfl_transset.h:111
Transition(void)
Construct invalid Transition.
Definition: cfl_transset.h:62
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
std::string ToString(const std::string &rLabel="", const Type *pContext=0) const
Write configuration data to a string.
Definition: cfl_types.cpp:169
virtual Type & Assign(const Type &rSrc)
Assign configuration data from other object.
Definition: cfl_types.cpp:77
TTransSet< TransSort::EvX2X1 > TransSetEvX2X1
Type definition for ev, x2, x1 sorted TTransSet.
Definition: cfl_transset.h:925
TTransSet< TransSort::X1EvX2 > TransSetX1EvX2
Type definition for default sorted TTransSet.
Definition: cfl_transset.h:919
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
virtual void Clear(void)
Clear all set.
Definition: cfl_baseset.h:1902
TTransSet< TransSort::X1EvX2 > TransSet
Type definition for default sorted TTransSet.
Definition: cfl_transset.h:916
TTransSet< TransSort::X2EvX1 > TransSetX2EvX1
Type definition for x2, ev, x1 sorted TTransSet.
Definition: cfl_transset.h:928
Iterator End(void) const
Iterator to the end of set.
Definition: cfl_baseset.h:1896
TTransSet< TransSort::X1X2Ev > TransSetX1X2Ev
Type definition for x1, x2, ev sorted TTransSet.
Definition: cfl_transset.h:934
Iterator Begin(void) const
Iterator to the begin of set.
Definition: cfl_baseset.h:1891
TTransSet< TransSort::EvX1X2 > TransSetEvX1X2
Type definition for ev, x1, x2 sorted TTransSet.
Definition: cfl_transset.h:922
TTransSet< TransSort::X2X1Ev > TransSetX2X1Ev
Type definition for x2, x1, ev sorted TTransSet.
Definition: cfl_transset.h:931
Idx Size(void) const
Get Size of TBaseSet.
Definition: cfl_baseset.h:1819
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
std::string ToStringInteger(Int number)
integer to string
Definition: cfl_helper.cpp:43
Binary predicate for sorting transitions in order Ev, X1, X2.
Definition: cfl_transset.h:128
Binary predicate for sorting transitions in order Ev, X2, X1.
Definition: cfl_transset.h:140
Binary predicate for sorting transitions in order X1, Ev, X2.
Definition: cfl_transset.h:188
Binary predicate for sorting transitions in order X1, X2, Ev.
Definition: cfl_transset.h:176
Binary predicate for sorting transitions in order X2, Ev, X1.
Definition: cfl_transset.h:152
Binary predicate for sorting transitions in order X2, X1, Ev.
Definition: cfl_transset.h:164

libFAUDES 2.31h --- 2024.01.29 --- c++ api documentaion by doxygen