cfl_cgenerator.h
Go to the documentation of this file.
1/** @file cfl_cgenerator.h Classes TcGenerator, System and AttributeCFlags */
2
3/* FAU Discrete Event Systems Library (libfaudes)
4
5Copyright (C) 2006 Bernd Opitz
6Copyright (C) 2007 Thomas Moor
7Exclusive copyright is granted to Klaus Schmidt
8
9This library is free software; you can redistribute it and/or
10modify it under the terms of the GNU Lesser General Public
11License as published by the Free Software Foundation; either
12version 2.1 of the License, or (at your option) any later version.
13
14This library is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public
20License along with this library; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23
24#ifndef FAUDES_CGENERATOR_H
25#define FAUDES_CGENERATOR_H
26
27#include "cfl_definitions.h"
28#include "cfl_agenerator.h"
29#include "cfl_parallel.h"
30#include "cfl_project.h"
31
32
33namespace faudes {
34
35
36
37
38/**
39 * Convenience typedef for event sets with controllability attributes.
40 *
41 * @ingroup ContainerClasses
42 */
44
45/** Convenience typedef */
47
48/** Compatibility: pre 2.20b used cEventSet as C++ class name*/
49#ifdef FAUDES_COMPATIBILITY
52#endif
53
54
55/**
56 * Generator with controllability attributes.
57 *
58 * @subsection CGeneratorOverview Overview
59 *
60 * The TcGenerator is a variant of the TaGenerator to add an interface for events with
61 * controllabilty attributes, ie an event may be controllable, observable or forcible.
62 *
63 * Technically, the construct is based on the specialized attribute class faudes::AttributeCFlags
64 * that provides attributes with semantics for controllability properties. The TcGenerator
65 * expects an event attribute template parameter with the minimum interface defined in AttribueCFlags.
66 * Thus, you can add further semantics by deriving a class AttributeCFlagsAndMore from
67 * AttribueeCFlags and use this as event attribute parameter for TcGenerator. To model
68 * a plain finite state machine plus controllability properties, use TcGenerator with
69 * AttributeCFlags for the event attribute parameter and AttributeVoid for the other
70 * parameters. For convenience, this has been typedef-ed as System.
71 *
72 * @ingroup GeneratorClasses
73 */
74
75template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
76 class FAUDES_TAPI TcGenerator : public TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr> {
77 public:
78
79
80 /**
81 * Creates an emtpy System object
82 */
83 TcGenerator(void);
84
85 /**
86 * System from a std Generator. Copy constructor
87 *
88 * @param rOtherGen
89 */
90 TcGenerator(const vGenerator& rOtherGen);
91
92 /**
93 * System from a System. Copy constructor
94 *
95 * @param rOtherGen
96 */
97 TcGenerator(const TcGenerator& rOtherGen);
98
99 /**
100 * construct a System from file
101 *
102 * @param rFileName
103 * Filename
104 *
105 * @exception Exception
106 * If opening/reading fails an Exception object is thrown (id 1, 50, 51)
107 */
108 TcGenerator(const std::string& rFileName);
109
110 /**
111 * Construct on heap
112 *
113 * @return
114 * new Generator
115 */
116 TcGenerator* New(void) const;
117
118 /**
119 * Construct copy on heap
120 *
121 * @return
122 * new Generator
123 */
124 TcGenerator* NewCpy(void) const;
125
126 /**
127 * Type test.
128 * Uses C++ dynamic cast to test whether the specified object
129 * casts to a System.
130 *
131 * @param pOther
132 * poinetr to object to test
133 *
134 * @return
135 * TcGenerator reference if dynamic cast succeeds, else NULL
136 */
137 virtual const Type* Cast(const Type* pOther) const {
138 return dynamic_cast< const TcGenerator* > (pOther); };
139
140
141 /**
142 * Copyment operator (uses Copy)
143 *
144 * Note: you must reimplement this operator in derived
145 * classes in order to handle internal pointers correctly
146 *
147 * @param rOtherGen
148 * Other generator
149 */
150 TcGenerator& operator= (const TcGenerator& rOtherGen);
151
152 /**
153 * Copyment operator (uses Move)
154 *
155 * Note: you must reimplement this operator in derived
156 * classes in order to handle internal pointers correctly
157 *
158 * @param rOtherGen
159 * Other generator
160 */
161 TcGenerator& operator= (TcGenerator&& rOtherGen);
162
163 /**
164 * Copyment method
165 *
166 * Note: you must reimplement this method in derived
167 * classes in order to handle internal pointers correctly
168 *
169 * @param rSource
170 * Other generator
171 */
172 virtual TcGenerator& Copy(const Type& rSource);
173
174 /**
175 * Move method
176 *
177 * Note: you must reimplement this method in derived
178 * classes in order to handle internal pointers correctly
179 *
180 * @param rSource
181 * Other generator
182 */
183 virtual TcGenerator& Move(Type& rSource);
184
185 /**
186 * Add an existing controllable event to generator.
187 * An entry in the global eventtable will be made.
188 *
189 * @param index
190 * Event index
191 */
192 void InsControllableEvent(Idx index);
193
194 /**
195 * Add new named controllable event to generator.
196 * An entry in the global eventtable will be made if event is new.
197 *
198 * @param rName
199 * Name of the event to add
200 *
201 * @return
202 * New global unique index
203 */
204 Idx InsControllableEvent(const std::string& rName);
205
206 /**
207 * Add an existing uncontrollable event to generator.
208 * An entry in the global eventtable will be made.
209 *
210 * @param index
211 * Event index
212 */
213 void InsUncontrollableEvent(Idx index);
214
215 /**
216 * Add new named uncontrollable event to generator.
217 * An entry in the global eventtable will be made if event is new.
218 *
219 * @param rName
220 * Name of the event to add
221 *
222 * @return
223 * New global unique index
224 */
225 Idx InsUncontrollableEvent(const std::string& rName);
226
227 /**
228 * Mark event controllable (by index)
229 *
230 * @param index
231 * Event index
232 */
233 void SetControllable(Idx index);
234
235 /**
236 * Mark event controllable (by name)
237 *
238 * @param rName
239 * Event name
240 */
241 void SetControllable(const std::string& rName);
242
243 /**
244 * Mark set of events controllable (by index)
245 *
246 * @param rEvents
247 * EventSet
248 */
249 void SetControllable(const EventSet& rEvents);
250
251 /**
252 * Mark event uncontrollable (by index)
253 *
254 * @param index
255 * Event index
256 */
257 void ClrControllable(Idx index);
258
259 /**
260 * Mark event uncontrollable (by name)
261 *
262 * @param rName
263 * Event name
264 */
265 void ClrControllable(const std::string& rName);
266
267 /**
268 * Mark set of events uncontrollable (by index)
269 *
270 * @param rEvents
271 * EventSet
272 */
273 void ClrControllable(const EventSet& rEvents);
274
275 /**
276 * Is event controllable (by index)
277 *
278 * @param index
279 * Event index
280 *
281 * @return
282 * True / false
283 */
284 bool Controllable(Idx index) const;
285
286 /**
287 * Is event controllable (by name)
288 *
289 * @param rName
290 * Event name
291 *
292 * @return
293 * True / false
294 */
295 bool Controllable(const std::string& rName) const;
296
297 /**
298 * Get EventSet with controllable events
299 *
300 * @return
301 * EventSet of controllable events
302 */
303 EventSet ControllableEvents(void) const;
304
305 /**
306 * Get EventSet with uncontrollable events
307 *
308 * @return
309 * EventSet of uncontrollable events
310 */
311 EventSet UncontrollableEvents(void) const;
312
313 /**
314 * Add an existing observable event to generator.
315 * An entry in the global eventtable will be made.
316 *
317 * @param index
318 * Event index
319 */
320 void InsObservableEvent(Idx index);
321
322 /**
323 * Add new named observable event to generator.
324 * An entry in the global eventtable will be made if event is new.
325 *
326 * @param rName
327 * Name of the event to add
328 *
329 * @return
330 * New global unique index
331 */
332 Idx InsObservableEvent(const std::string& rName);
333
334 /**
335 * Add an existing unobservable event to generator.
336 * An entry in the global eventtable will be made.
337 *
338 * @param index
339 * Event index
340 */
341 void InsUnobservableEvent(Idx index);
342
343 /**
344 * Add new named unobservable event to generator.
345 * An entry in the global eventtable will be made if event is new.
346 *
347 * @param rName
348 * Name of the event to add
349 *
350 * @return
351 * New global unique index
352 */
353 Idx InsUnobservableEvent(const std::string& rName);
354
355 /**
356 * Mark event observable (by index)
357 *
358 * @param index
359 * Event index
360 */
361 void SetObservable(Idx index);
362
363 /**
364 * Mark event observable (by name)
365 *
366 * @param rName
367 * Event name
368 */
369 void SetObservable(const std::string& rName);
370
371 /**
372 * Mark set of events observable
373 *
374 * @param rEvents
375 * EventSet
376 */
377 void SetObservable(const EventSet& rEvents);
378
379 /**
380 * Mark event unobservable (by index)
381 *
382 * @param index
383 * Event index
384 */
385 void ClrObservable(Idx index);
386
387 /**
388 * Mark event unobservable (by name)
389 *
390 * @param rName
391 * Event name
392 */
393 void ClrObservable(const std::string& rName);
394
395 /**
396 * Mark set of events unobservable
397 *
398 * @param rEvents
399 * EventSet
400 */
401 void ClrObservable(const EventSet& rEvents);
402
403 /**
404 * Is event observable (by index)
405 *
406 * @param index
407 * Event index
408 *
409 * @return
410 * True / false
411 */
412 bool Observable(Idx index) const;
413
414 /**
415 * Is event observable (by name)
416 *
417 * @param rName
418 * Event name
419 *
420 * @return
421 * True / false
422 */
423 bool Observable(const std::string& rName) const;
424
425 /**
426 * Get EventSet with observable events
427 *
428 * @return
429 * EventSet of controllable events
430 */
431 EventSet ObservableEvents(void) const;
432
433 /**
434 * Get EventSet with unobservable events
435 *
436 * @return
437 * EventSet of uncontrollable events
438 */
439 EventSet UnobservableEvents(void) const;
440
441 /**
442 * Add an existing forcible event to generator.
443 * An entry in the global eventtable will be made.
444 *
445 * @param index
446 * Event index
447 */
448 void InsForcibleEvent(Idx index);
449
450 /**
451 * Add new named forcible event to generator.
452 * An entry in the global eventtable will be made if event is new.
453 *
454 * @param rName
455 * Name of the event to add
456 *
457 * @return
458 * New global unique index
459 */
460 Idx InsForcibleEvent(const std::string& rName);
461
462 /**
463 * Add an existing unforcible event to generator.
464 * An entry in the global eventtable will be made.
465 *
466 * @param index
467 * Event index
468 */
469 void InsUnforcibleEvent(Idx index);
470
471 /**
472 * Add new named unforcible event to generator.
473 * An entry in the global eventtable will be made if event is new.
474 *
475 * @param rName
476 * Name of the event to add
477 *
478 * @return
479 * New global unique index
480 */
481 Idx InsUnforcibleEvent(const std::string& rName);
482
483 /**
484 * Mark event forcible (by index)
485 *
486 * @param index
487 * Event index
488 */
489 void SetForcible(Idx index);
490
491 /**
492 * Mark event forcible (by name)
493 *
494 * @param rName
495 * Event name
496 */
497 void SetForcible(const std::string& rName);
498
499 /**
500 * Mark set of events forcible
501 *
502 * @param rEvents
503 * EventSet
504 */
505 void SetForcible(const EventSet& rEvents);
506
507 /**
508 * Mark event unforcible (by index)
509 *
510 * @param index
511 * Event index
512 */
513 void ClrForcible(Idx index);
514
515 /**
516 * Mark event unforcible (by name)
517 *
518 * @param rName
519 * Event name
520 */
521 void ClrForcible(const std::string& rName);
522
523 /**
524 * Mark set of events unforcible
525 *
526 * @param rEvents
527 * EventSet
528 */
529 void ClrForcible(const EventSet& rEvents);
530
531 /**
532 * Is event forcible (by index)
533 *
534 * @param index
535 * Event index
536 *
537 * @return
538 * True / false
539 */
540 bool Forcible(Idx index) const;
541
542 /**
543 * Is event forcible (by name)
544 *
545 * @param rName
546 * Event name
547 *
548 * @return
549 * True / false
550 */
551 bool Forcible(const std::string& rName) const;
552
553 /**
554 * Get EventSet with forcible events
555 *
556 * @return
557 * EventSet of controllable events
558 */
559 EventSet ForcibleEvents(void) const;
560
561 /**
562 * Get EventSet with unforcible events
563 *
564 * @return
565 * EventSet of uncontrollable events
566 */
567 EventSet UnforcibleEvents(void) const;
568
569 /**
570 * Add an existing abstraction event to generator.
571 * An entry in the global eventtable will be made.
572 *
573 * @param index
574 * Event index
575 */
576 void InsHighlevelEvent(Idx index);
577
578 /**
579 * Add new named abstraction event to generator.
580 * An entry in the global eventtable will be made if event is new.
581 *
582 * @param rName
583 * Name of the event to add
584 *
585 * @return
586 * New global unique index
587 */
588 Idx InsHighlevelEvent(const std::string& rName);
589
590 /**
591 * Add an existing low-level event to generator.
592 * An entry in the global eventtable will be made.
593 *
594 * @param index
595 * Event index
596 */
597 void InsLowlevelEvent(Idx index);
598
599 /**
600 * Add new named low-level event to generator.
601 * An entry in the global eventtable will be made if event is new.
602 *
603 * @param rName
604 * Name of the event to add
605 *
606 * @return
607 * New global unique index
608 */
609 Idx InsLowlevelEvent(const std::string& rName);
610
611 /**
612 * Mark event as highlevel event (by index)
613 *
614 * @param index
615 * Event index
616 */
617 void SetHighlevel(Idx index);
618
619 /**
620 * Mark event as highlevel event (by name)
621 *
622 * @param rName
623 * Event name
624 */
625 void SetHighlevel(const std::string& rName);
626
627 /**
628 * Mark set of events as high-level events
629 *
630 * @param rEvents
631 * EventSet
632 */
633 void SetHighlevel(const EventSet& rEvents);
634
635 /**
636 * Mark event as low-level event (by index)
637 *
638 * @param index
639 * Event index
640 */
641 void SetLowlevel(Idx index);
642
643 /**
644 * Mark event as low-level event (by name)
645 *
646 * @param rName
647 * Event name
648 */
649 void SetLowlevel(const std::string& rName);
650
651 /**
652 * Mark set of events as low-level events.
653 *
654 * @param rEvents
655 * EventSet
656 */
657 void SetLowlevel(const EventSet& rEvents);
658
659 /**
660 * Test for high-level event (by index)
661 *
662 * @param index
663 * Event index
664 *
665 * @return
666 * True / false
667 */
668 bool Highlevel(Idx index) const;
669
670 /**
671 * Test for high-level event (by name)
672 *
673 * @param rName
674 * Event name
675 *
676 * @return
677 * True / false
678 */
679 bool Highlevel(const std::string& rName) const;
680
681 /**
682 * Test for low-level event (by index)
683 *
684 * @param index
685 * Event index
686 *
687 * @return
688 * True / false
689 */
690 bool Lowlevel(Idx index) const;
691
692 /**
693 * Test for low-level event (by name)
694 *
695 * @param rName
696 * Event name
697 *
698 * @return
699 * True / false
700 */
701 bool Lowlevel(const std::string& rName) const;
702
703 /**
704 * Get EventSet of all high-level events
705 *
706 * @return
707 * EventSet of high-level events
708 */
709 EventSet HighlevelEvents(void) const;
710
711 /**
712 * Get EventSet of all low-level events
713 *
714 * @return
715 * EventSet of low-level events
716 */
717 EventSet LowlevelEvents(void) const;
718
719
720 private:
721
722 protected:
723
724}; // end class TcGenerator
725
726
727/**
728 * Convenience typedef for std System.
729 *
730 * @ingroup GeneratorClasses
731 */
733
734/**
735 * Convenience typedef for vectors of systems
736 * \ingroup GeneratorClasses
737 */
739
740/** Compatibility: pre 2.20b used cGenerator as C++ class name*/
741#ifdef FAUDES_COMPATIBILITY
744#endif
745
746
747
748/*
749***************************************************************************
750***************************************************************************
751***************************************************************************
752
753Implementation cgenerator
754
755***************************************************************************
756***************************************************************************
757***************************************************************************
758*/
759
760/* convenience access to relevant scopes */
761#define THIS TcGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
762#define BASE TaGenerator<GlobalAttr, StateAttr, EventAttr, TransAttr>
763#define TEMP template <class GlobalAttr, class StateAttr, class EventAttr, class TransAttr>
764
765
766// TcGenerator(void)
767TEMP THIS::TcGenerator(void) : BASE() {
768 FD_DG("TcGenerator(" << this << ")::TcGenerator()");
769}
770
771// TcGenerator(rOtherGen)
772TEMP THIS::TcGenerator(const TcGenerator& rOtherGen) : BASE(rOtherGen) {
773 FD_DG("TcGenerator(" << this << ")::TcGenerator(rOtherGen)");
774}
775
776// TcGenerator(rOtherGen)
777TEMP THIS::TcGenerator(const vGenerator& rOtherGen) : BASE(rOtherGen) {
778 FD_DG("TcGenerator(" << this << ")::TcGenerator(rOtherGen)");
779}
780
781// TcGenerator(rFilename)
782TEMP THIS::TcGenerator(const std::string& rFileName) : BASE(rFileName) {
783 FD_DG("TcGenerator(" << this << ")::TcGenerator(rFilename) : done");
784}
785
786// operator=
787TEMP THIS& THIS::operator= (const TcGenerator& rOtherGen) {
788 FD_DG("TcGenerator(" << this << ")::operator = [v]" << &rOtherGen);
789 return Copy(rOtherGen);
790}
791
792// operator=
793TEMP THIS& THIS::operator= (TcGenerator&& rOtherGen) {
794 FD_DG("TcGenerator(" << this << ")::operator = [v]" << &rOtherGen);
795 return Move(rOtherGen);
796}
797
798// copy from other faudes type
799TEMP THIS& THIS::Copy(const Type& rSrc) {
800 FD_DG("TcGenerator(" << this << ")::Copy([type] " << &rSrc << ")");
801 // bail out on match
802 if(&rSrc==static_cast<const Type*>(this)) return *this;
803
804 // cast tests (clang 8.0.0 issues, 2017)
805 /*
806 const THIS* cgen=dynamic_cast<const THIS*>(&rSrc);
807 FD_WARN("TcGenerator(" << this << ")::Copy(..): cgen " << cgen);
808 const BASE* agen=dynamic_cast<const BASE*>(&rSrc);
809 FD_WARN("TcGenerator(" << this << ")::Copy(..): agen " << agen);
810 const vGenerator* vgen=dynamic_cast<const vGenerator*>(&rSrc);
811 FD_WARN("TcGenerator(" << this << ")::Copy(..): vgen " << vgen);
812 const BASE* agen2=dynamic_cast<const BASE*>(cgen);
813 FD_WARN("TcGenerator(" << this << ")::Copy(..): agen2 " << agen);
814 */
815
816 // pass on to base
817 FD_DG("TcGenerator(" << this << ")::Copy([type] " << &rSrc << "): call base");
818 BASE::Copy(rSrc);
819 return *this;
820}
821
822// copy from other faudes type
823TEMP THIS& THIS::Move(Type& rSrc) {
824 FD_DG("TcGenerator(" << this << ")::Copy([type] " << &rSrc << ")");
825 // bail out on match
826 if(&rSrc==static_cast<Type*>(this)) return *this;
827 // pass on to base
828 FD_DG("TcGenerator(" << this << ")::Copy([type] " << &rSrc << "): call base");
829 BASE::Move(rSrc);
830 return *this;
831}
832
833// New
834TEMP THIS* THIS::New(void) const {
835 // allocate
836 THIS* res = new THIS;
837 // fix base data
838 res->EventSymbolTablep(BASE::mpEventSymbolTable);
839 res->mStateNamesEnabled=BASE::mStateNamesEnabled;
840 res->mReindexOnWrite=BASE::mReindexOnWrite;
841 return res;
842}
843
844// Copy
845TEMP THIS* THIS::NewCpy(void) const {
846 // allocate
847 THIS* res = new THIS(*this);
848 // done
849 return res;
850}
851
852
853
854 // Controllable(index)
855 TEMP bool THIS::Controllable(Idx index) const {
856 EventAttr attr=BASE::EventAttribute(index);
857 return attr.Controllable();
858 }
859
860 // Controllable(rName)
861 TEMP bool THIS::Controllable(const std::string& rName) const {
862 EventAttr attr=BASE::EventAttribute(rName);
863 return attr.Controllable();
864 }
865
866 // InsControllableEvent(index)
867 TEMP void THIS::InsControllableEvent(Idx index) {
868 FD_DG("TcGenerator(" << this << ")::InsControllableEvent(" << index << ")");
869 EventAttr attr;
870 attr.SetControllable();
871 BASE::InsEvent(index,attr);
872 }
873
874 // InsControllableEvent(rName)
875 TEMP Idx THIS::InsControllableEvent(const std::string& rName) {
876 FD_DG("TcGenerator(" << this << ")::InsControllableEvent(" << rName << ")");
877 EventAttr attr;
878 attr.SetControllable();
879 return BASE::InsEvent(rName,attr);
880 }
881
882 // InsUncontrollableEvent(index)
883 TEMP void THIS::InsUncontrollableEvent(Idx index) {
884 FD_DG("TcGenerator(" << this << ")::InsUncontrollableEvent(" << index << ")");
885 EventAttr attr;
886 attr.ClrControllable();
887 BASE::InsEvent(index,attr);
888 }
889
890 // InsUncontrollableEvent(rName)
891 TEMP Idx THIS::InsUncontrollableEvent(const std::string& rName) {
892 FD_DG("TcGenerator(" << this << ")::InsUncontrollableEvent(" << rName << ")");
893 EventAttr attr;
894 attr.ClrControllable();
895 return BASE::InsEvent(rName,attr);
896 }
897
898 // SetControllable(index)
899 TEMP void THIS::SetControllable(Idx index) {
900 FD_DG("TcGenerator(" << this << ")::SetControllable(" << index << ")");
901 EventAttr attr=BASE::EventAttribute(index);
902 attr.SetControllable();
903 BASE::pAlphabet->Attribute(index,attr);
904 }
905
906 // SetControllable(rName)
907 TEMP void THIS::SetControllable(const std::string& rName) {
908 FD_DG("TcGenerator(" << this << ")::SetControllable(" << rName << ")");
909 Idx index = BASE::EventIndex(rName);
910 SetControllable(index);
911 }
912
913 //SetControllable(rEvents)
914 TEMP void THIS::SetControllable(const EventSet& rEvents) {
915 FD_DG("TcGenerator(" << this << ")::SetControllable(rEvents)");
916 EventSet::Iterator it;
917 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
918 SetControllable(*it);
919 }
920 }
921
922 // ClrControllable(index)
923 TEMP void THIS::ClrControllable(Idx index) {
924 FD_DG("TcGenerator(" << this << ")::ClrControllable(" << index << ")");
925 EventAttr attr=BASE::EventAttribute(index);
926 attr.ClrControllable();
927 BASE::pAlphabet->Attribute(index,attr);
928 }
929
930 // ClrControllable(rName)
931 TEMP void THIS::ClrControllable(const std::string& rName) {
932 FD_DG("TcGenerator(" << this << ")::ClrControllable(" << rName << ")");
933 Idx index = BASE::EventIndex(rName);
934 ClrControllable(index);
935 }
936
937 //ClrControllable(rEvents)
938 TEMP void THIS::ClrControllable(const EventSet& rEvents) {
939 FD_DG("TcGenerator(" << this << ")::ClrControllable(rEvents)");
940 EventSet::Iterator it;
941 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
942 ClrControllable(*it);
943 }
944 }
945
946 //ControllableEvents()
947 TEMP EventSet THIS::ControllableEvents(void) const {
948 FD_DG("TcGenerator(" << this << ")::ControllableEvents()");
949 EventSet res;
950 EventSet::Iterator it;
951 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
952 if(Controllable(*it)) res.Insert(*it);
953 }
954 return res;
955 }
956
957 //UncontrollableEvents()
958 TEMP
959 EventSet THIS::UncontrollableEvents(void) const {
960 FD_DG("TcGenerator(" << this << ")::UncontrollableEvents()");
961 EventSet res;
962 EventSet::Iterator it;
963 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
964 if(!Controllable(*it)) res.Insert(*it);
965 }
966 return res;
967 }
968
969 // Observable(index)
970 TEMP bool THIS::Observable(Idx index) const {
971 EventAttr attr=BASE::EventAttribute(index);
972 return attr.Observable();
973 }
974
975 // Observable(rName)
976 TEMP bool THIS::Observable(const std::string& rName) const {
977 EventAttr attr=BASE::EventAttribute(rName);
978 return attr.Observable();
979 }
980
981 // InsObservableEvent(index)
982 TEMP void THIS::InsObservableEvent(Idx index) {
983 FD_DG("TcGenerator(" << this << ")::InsObservableEvent(" << index << ")");
984 EventAttr attr;
985 attr.SetObservable();
986 BASE::InsEvent(index,attr);
987 }
988
989 // InsObservableEvent(rName)
990 TEMP Idx THIS::InsObservableEvent(const std::string& rName) {
991 FD_DG("TcGenerator(" << this << ")::InsObservableEvent(" << rName << ")");
992 EventAttr attr;
993 attr.SetObservable();
994 return BASE::InsEvent(rName,attr);
995 }
996
997 // InsUnobservableEvent(index)
998 TEMP void THIS::InsUnobservableEvent(Idx index) {
999 FD_DG("TcGenerator(" << this << ")::InsUnobservableEvent(" << index << ")");
1000 EventAttr attr;
1001 attr.ClrObservable();
1002 BASE::InsEvent(index,attr);
1003 }
1004
1005 // InsUnobservableEvent(rName)
1006 TEMP Idx THIS::InsUnobservableEvent(const std::string& rName) {
1007 FD_DG("TcGenerator(" << this << ")::InsUnobservableEvent(" << rName << ")");
1008 EventAttr attr;
1009 attr.ClrObservable();
1010 return BASE::InsEvent(rName,attr);
1011 }
1012
1013 // SetObservable(index)
1014 TEMP void THIS::SetObservable(Idx index) {
1015 FD_DG("TcGenerator(" << this << ")::SetObservable(" << index << ")");
1016 EventAttr attr=BASE::EventAttribute(index);
1017 attr.SetObservable();
1018 BASE::pAlphabet->Attribute(index,attr);
1019 }
1020
1021 // SetObservable(rName)
1022 TEMP void THIS::SetObservable(const std::string& rName) {
1023 FD_DG("TcGenerator(" << this << ")::SetObservable(" << rName << ")");
1024 Idx index = BASE::EventIndex(rName);
1025 SetObservable(index);
1026 }
1027
1028 //SetObservable(rEvents)
1029 TEMP void THIS::SetObservable(const EventSet& rEvents) {
1030 FD_DG("TcGenerator(" << this << ")::SetObservable(rEvents)");
1031 EventSet::Iterator it;
1032 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1033 SetObservable(*it);
1034 }
1035 }
1036
1037 // ClrObservable(index)
1038 TEMP void THIS::ClrObservable(Idx index) {
1039 FD_DG("TcGenerator(" << this << ")::ClrObservable(" << index << ")");
1040 EventAttr attr=BASE::EventAttribute(index);
1041 attr.ClrObservable();
1042 BASE::pAlphabet->Attribute(index,attr);
1043 }
1044
1045 // ClrObservable(rName)
1046 TEMP void THIS::ClrObservable(const std::string& rName) {
1047 FD_DG("TcGenerator(" << this << ")::ClrObservable(" << rName << ")");
1048 Idx index = BASE::EventIndex(rName);
1049 ClrObservable(index);
1050 }
1051
1052 //ClrObservable(rEvents)
1053 TEMP void THIS::ClrObservable(const EventSet& rEvents) {
1054 FD_DG("TcGenerator(" << this << ")::ClrObservable(rEvents)");
1055 EventSet::Iterator it;
1056 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1057 ClrObservable(*it);
1058 }
1059 }
1060
1061 //ObservableEvents()
1062 TEMP EventSet THIS::ObservableEvents(void) const {
1063 FD_DG("TcGenerator(" << this << ")::ObservableEvents()");
1064 EventSet res;
1065 EventSet::Iterator it;
1066 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1067 if(Observable(*it)) res.Insert(*it);
1068 }
1069 return res;
1070 }
1071
1072 //UnobservableEvents()
1073 TEMP
1074 EventSet THIS::UnobservableEvents(void) const {
1075 FD_DG("TcGenerator(" << this << ")::UnobservableEvents()");
1076 EventSet res;
1077 EventSet::Iterator it;
1078 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1079 if(!Observable(*it)) res.Insert(*it);
1080 }
1081 return res;
1082 }
1083
1084
1085 //Forcible(index)
1086 TEMP bool THIS::Forcible(Idx index) const {
1087 EventAttr attr=BASE::EventAttribute(index);
1088 return attr.Forcible();
1089 }
1090
1091 // Forcible(rName)
1092 TEMP bool THIS::Forcible(const std::string& rName) const {
1093 EventAttr attr=BASE::EventAttribute(rName);
1094 return attr.Forcible();
1095 }
1096
1097 // InsForcibleEvent(index)
1098 TEMP void THIS::InsForcibleEvent(Idx index) {
1099 FD_DG("TcGenerator(" << this << ")::InsForcibleEvent(" << index << ")");
1100 EventAttr attr;
1101 attr.SetForcible();
1102 BASE::InsEvent(index,attr);
1103 }
1104
1105 // InsForcibleEvent(rName)
1106 TEMP Idx THIS::InsForcibleEvent(const std::string& rName) {
1107 FD_DG("TcGenerator(" << this << ")::InsForcibleEvent(" << rName << ")");
1108 EventAttr attr;
1109 attr.SetForcible();
1110 return BASE::InsEvent(rName,attr);
1111 }
1112
1113 // InsUnforcibleEvent(index)
1114 TEMP void THIS::InsUnforcibleEvent(Idx index) {
1115 FD_DG("TcGenerator(" << this << ")::InsUnforcibleEvent(" << index << ")");
1116 EventAttr attr;
1117 attr.ClrForcible();
1118 BASE::InsEvent(index,attr);
1119 }
1120
1121 // InsUnforcibleEvent(rName)
1122 TEMP Idx THIS::InsUnforcibleEvent(const std::string& rName) {
1123 FD_DG("TcGenerator(" << this << ")::InsUnforcibleEvent(" << rName << ")");
1124 EventAttr attr;
1125 attr.ClrForcible();
1126 return BASE::InsEvent(rName,attr);
1127 }
1128
1129 // SetForcible(index)
1130 TEMP void THIS::SetForcible(Idx index) {
1131 FD_DG("TcGenerator(" << this << ")::SetForcible(" << index << ")");
1132 EventAttr attr=BASE::EventAttribute(index);
1133 attr.SetForcible();
1134 BASE::pAlphabet->Attribute(index,attr);
1135 }
1136
1137 // SetForcible(rName)
1138 TEMP void THIS::SetForcible(const std::string& rName) {
1139 FD_DG("TcGenerator(" << this << ")::SetForcible(" << rName << ")");
1140 Idx index = BASE::EventIndex(rName);
1141 SetForcible(index);
1142 }
1143
1144 //SetForcible(rEvents)
1145 TEMP void THIS::SetForcible(const EventSet& rEvents) {
1146 FD_DG("TcGenerator(" << this << ")::SetForcible(rEvents)");
1147 EventSet::Iterator it;
1148 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1149 SetForcible(*it);
1150 }
1151 }
1152
1153 // ClrForcible(index)
1154 TEMP void THIS::ClrForcible(Idx index) {
1155 FD_DG("TcGenerator(" << this << ")::ClrForcible(" << index << ")");
1156 EventAttr attr=BASE::EventAttribute(index);
1157 attr.ClrForcible();
1158 BASE::pAlphabet->Attribute(index,attr);
1159 }
1160
1161 // ClrForcible(rName)
1162 TEMP void THIS::ClrForcible(const std::string& rName) {
1163 FD_DG("TcGenerator(" << this << ")::ClrForcible(" << rName << ")");
1164 Idx index = BASE::EventIndex(rName);
1165 ClrForcible(index);
1166 }
1167
1168 //ClrForcible(rEvents)
1169 TEMP void THIS::ClrForcible(const EventSet& rEvents) {
1170 FD_DG("TcGenerator(" << this << ")::ClrForcible(rEvents)");
1171 EventSet::Iterator it;
1172 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1173 ClrForcible(*it);
1174 }
1175 }
1176
1177 //ForcibleEvents()
1178 TEMP EventSet THIS::ForcibleEvents(void) const {
1179 FD_DG("TcGenerator(" << this << ")::ForcibleEvents()");
1180 EventSet res;
1181 EventSet::Iterator it;
1182 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1183 if(Forcible(*it)) res.Insert(*it);
1184 }
1185 return res;
1186 }
1187
1188 //UnforcibleEvents()
1189 TEMP
1190 EventSet THIS::UnforcibleEvents(void) const {
1191 FD_DG("TcGenerator(" << this << ")::UnforcibleEvents()");
1192 EventSet res;
1193 EventSet::Iterator it;
1194 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1195 if(!Forcible(*it)) res.Insert(*it);
1196 }
1197 return res;
1198 }
1199
1200
1201 //Highlevel(index)
1202 TEMP bool THIS::Highlevel(Idx index) const {
1203 EventAttr attr=BASE::EventAttribute(index);
1204 return attr.Highlevel();
1205 }
1206
1207 // Highlevel(rName)
1208 TEMP bool THIS::Highlevel(const std::string& rName) const {
1209 EventAttr attr=BASE::EventAttribute(rName);
1210 return attr.Highlevel();
1211 }
1212
1213 //Lowlevel(index)
1214 TEMP bool THIS::Lowlevel(Idx index) const {
1215 EventAttr attr=BASE::EventAttribute(index);
1216 return attr.Lowlevel();
1217 }
1218
1219 // Lowlevel(rName)
1220 TEMP bool THIS::Lowlevel(const std::string& rName) const {
1221 EventAttr attr=BASE::EventAttribute(rName);
1222 return attr.Lowlevel();
1223 }
1224
1225 // InsHighlevelEvent(index)
1226 TEMP void THIS::InsHighlevelEvent(Idx index) {
1227 FD_DG("TcGenerator(" << this << ")::InsHighlevelEvent(" << index << ")");
1228 EventAttr attr;
1229 attr.SetHighlevel();
1230 BASE::InsEvent(index,attr);
1231 }
1232
1233 // InsHighlevelEvent(rName)
1234 TEMP Idx THIS::InsHighlevelEvent(const std::string& rName) {
1235 FD_DG("TcGenerator(" << this << ")::InsHighlevelEvent(" << rName << ")");
1236 EventAttr attr;
1237 attr.SetHighlevel();
1238 return BASE::InsEvent(rName,attr);
1239 }
1240
1241 // InsLowlevelEvent(index)
1242 TEMP void THIS::InsLowlevelEvent(Idx index) {
1243 FD_DG("TcGenerator(" << this << ")::InsLowlevelEvent(" << index << ")");
1244 EventAttr attr;
1245 attr.SetLowlevel();
1246 BASE::InsEvent(index,attr);
1247 }
1248
1249 // InsLowlevelEvent(rName)
1250 TEMP Idx THIS::InsLowlevelEvent(const std::string& rName) {
1251 FD_DG("TcGenerator(" << this << ")::InsLowlevelEvent(" << rName << ")");
1252 EventAttr attr;
1253 attr.SetLowlevel();
1254 return BASE::InsEvent(rName,attr);
1255 }
1256
1257 // SetHighlevel(index)
1258 TEMP void THIS::SetHighlevel(Idx index) {
1259 FD_DG("TcGenerator(" << this << ")::SetHighlevel(" << index << ")");
1260 EventAttr attr=BASE::EventAttribute(index);
1261 attr.SetHighlevel();
1262 BASE::pAlphabet->Attribute(index,attr);
1263 }
1264
1265 // SetHighlevel(rName)
1266 TEMP void THIS::SetHighlevel(const std::string& rName) {
1267 FD_DG("TcGenerator(" << this << ")::SetHighlevel(" << rName << ")");
1268 Idx index = BASE::EventIndex(rName);
1269 SetHighlevel(index);
1270 }
1271
1272 //SetHighlevel(rEvents)
1273 TEMP void THIS::SetHighlevel(const EventSet& rEvents) {
1274 FD_DG("TcGenerator(" << this << ")::SetHighlevel(rEvents)");
1275 EventSet::Iterator it;
1276 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1277 SetHighlevel(*it);
1278 }
1279 }
1280
1281 // SetLowlevel(index)
1282 TEMP void THIS::SetLowlevel(Idx index) {
1283 FD_DG("TcGenerator(" << this << ")::SetLowlevel(" << index << ")");
1284 EventAttr attr=BASE::EventAttribute(index);
1285 attr.SetLowlevel();
1286 BASE::pAlphabet->Attribute(index,attr);
1287 }
1288
1289 // SetLowlevel(rName)
1290 TEMP void THIS::SetLowlevel(const std::string& rName) {
1291 FD_DG("TcGenerator(" << this << ")::SetLowlevel(" << rName << ")");
1292 Idx index = BASE::EventIndex(rName);
1293 SetLowlevel(index);
1294 }
1295
1296 //SetLowlevel(rEvents)
1297 TEMP void THIS::SetLowlevel(const EventSet& rEvents) {
1298 FD_DG("TcGenerator(" << this << ")::SetLowlevel(rEvents)");
1299 EventSet::Iterator it;
1300 for(it=rEvents.Begin(); it!=rEvents.End(); it++) {
1301 SetLowlevel(*it);
1302 }
1303 }
1304
1305 //HighlevelEvents()
1306 TEMP EventSet THIS::HighlevelEvents(void) const {
1307 FD_DG("TcGenerator(" << this << ")::HighlevelEvents()");
1308 EventSet res;
1309 EventSet::Iterator it;
1310 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1311 if(Highlevel(*it)) res.Insert(*it);
1312 }
1313 return res;
1314 }
1315
1316 //LowlevelEvents()
1317 TEMP EventSet THIS::LowlevelEvents(void) const {
1318 FD_DG("TcGenerator(" << this << ")::LowlevelEvents()");
1319 EventSet res;
1320 EventSet::Iterator it;
1321 for(it=BASE::AlphabetBegin(); it!=BASE::AlphabetEnd(); it++) {
1322 if(Lowlevel(*it)) res.Insert(*it);
1323 }
1324 return res;
1325 }
1326
1327
1328
1329#undef TEMP
1330#undef BASE
1331#undef THIS
1332
1333
1334} // namespace faudes
1335
1336#endif
1337
#define TEMP
#define BASE
#define THIS
#define FD_DG(message)
#define FAUDES_TAPI
bool Insert(const Idx &rIndex)
virtual const Type * Cast(const Type *pOther) const
TaNameSet< AttributeCFlags > Alphabet
Iterator End(void) const
Iterator Begin(void) const
TBaseVector< System > SystemVector
TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > System
uint32_t Idx
TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > cGenerator
TBaseVector< Alphabet > AlphabetVector
TBaseVector< cGenerator > cGeneratorVector
TaNameSet< AttributeCFlags > cEventSet
TBaseVector< cEventSet > cEventSetVector

libFAUDES 2.34d --- 2026.03.11 --- c++ api documentaion by doxygen