31.01.2014 Views

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix D. openETCS Domain Framework<br />

36 } // f o r ( x = 0 ; x < m_TransitionStack . s i z e ( ) ; x++)<br />

37<br />

38 // execute t r a n s i t i o n<br />

39 m_pParent−>m_pCurrentState = p T r a n s i t i o n −>G e t T a r g e t S t a t e ( ) ;<br />

40<br />

41 } // i f ( ! m_TransitionStack . empty ( ) )<br />

42<br />

43 // check i f t h i s s t a t e i s a f i n a l s t a t e<br />

44 i f ( m_bIsFinal )<br />

45 {<br />

46 // t e l l parent c o n t r o l f l o w to terminate<br />

47 m_pParent−>m_pCurrentState = 0 ;<br />

48<br />

49 } // i f ( m_bIsFinal )<br />

50<br />

51 } // t r y<br />

52 catch ( const : : oETCS : : DF : : E r r o r : : CException&)<br />

53 {<br />

54 // re−throw exception<br />

55 throw ;<br />

56<br />

57 } // catch ( const : : oETCS : :DF: : Error : : CException&)<br />

58<br />

59 } // void CControlFlow : : CState : : Execute ( )<br />

Listing D.5: EVC state machine execution<br />

1 while ( m_bStarted )<br />

2 {<br />

3 try<br />

4 {<br />

5 // s t a r t execution o f current s t a t e<br />

6 m_pCurrentState−>S t a r t ( ) ;<br />

7<br />

8 } // t r y<br />

9 catch ( const : : oETCS : : DF : : E r r o r : : CException& E x ception )<br />

10 {<br />

11 // s e t s t a r t f l a g to stopped<br />

12 m_bStarted = f a l s e ;<br />

13<br />

14 // c r e a t e and p r i n t error m<strong>es</strong>sage to s t d e r r<br />

15 : : s t d : : c e r r

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!