DiaDes  0.1
DIAgnosis of Discrete-Event System
Union.hh
Go to the documentation of this file.
1 
9 #ifndef __DIADES__AUTOMATA__EXPERIMENTAL__UNION__HH__
10 #define __DIADES__AUTOMATA__EXPERIMENTAL__UNION__HH__
18 
19 namespace Diades
20 {
21  namespace Automata
22  {
23  namespace Experimental
24  {
25 
34  template<typename TransInserter>
35  void
36  insertTransitions(TransInserter & inserter)
37  {
38  // first insert all the states as some may no be source or target of
39  // transitions
40  std::for_each(inserter.source().stateBegin(),
41  inserter.source().stateEnd(),
42  [&](typename TransInserter::State s)
43  {
44  inserter.insertState(s);
45  });
46  // then insert the transitions
47  std::for_each(inserter.source().transitionBegin(),
48  inserter.source().transitionEnd(),
49  [&](typename TransInserter::Transition t)
50  {
51  inserter.insertTransition(t);
52  });
53  }
54 
69  template<typename TransInserterIterator>
70  void
71  insertRangeOfTransitions(TransInserterIterator begin, TransInserterIterator end)
72  {
73  while(begin != end)
74  {
75  insertTransitions(*begin);
76  ++begin;
77  }
78  }
79  }
80  }
81 }
82 
83 
84 
85 #endif /* __DIADES__AUTOMATA__EXPERIMENTAL__UNION__HH__ */
86 
void insertRangeOfTransitions(TransInserterIterator begin, TransInserterIterator end)
Definition: Union.hh:71
AutFsm::State State
Definition: Run.cc:72
AutFsm::Transition Transition
Definition: Run.cc:73
Namespace of the Diades project.
void insertTransitions(TransInserter &inserter)
Definition: Union.hh:36