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.

DopenETCS Domain Framework<br />

D.1. Domain Framework Software Reference<br />

The reference documentation for the openETCS domain framework sourc<strong>es</strong> can be found at<br />

http://www.informatik.uni-bremen.de/agbs/jfeuser/openETCS/doxygen.<br />

D.2. Domain Framework Source Code<br />

The complete source code of the openETCS domain framework is located at<br />

http://www.informatik.uni-bremen.de/agbs/jfeuser/openETCS/openETCS-GaDF.tar.bz2.<br />

The following C++ source code listings are used as exampl<strong>es</strong> for the main part of this document.<br />

Listing D.1: Thread creation in C++11<br />

1 int y ;<br />

2<br />

3 // s t a r t a l l independent data f l o w s threads<br />

4 f o r ( y = 0 ; y < m_CurrentDataFlow . s i z e ( ) ; y++)<br />

5 {<br />

6<br />

7 // c r e a t e new thread<br />

8 m_Threads [ y ] = (new : : s t d : : t h r e a d ( & : : oETCS : : DF : : CEVCStateMachine : : CEVCState : : DataFlowThread ,<br />

this , y ) ) ;<br />

9<br />

10 } // f o r ( y = 0 ; y < m_CurrentDataFlow . s i z e ( ) ; y++)<br />

1 // wait f o r a l l threads to f i n i s h and d e l e t e them<br />

2 f o r ( y = 0 ; y < m_Threads . s i z e ( ) ; y++)<br />

3 {<br />

4 // check i f current thread i s j o i n a b l e<br />

5 i f ( m_Threads [ y]−> j o i n a b l e ( ) )<br />

6 {<br />

7 // wait f o r current thread<br />

8 m_Threads [ y]−> j o i n ( ) ;<br />

9<br />

10 } // i f (m_Threads [ y]−> j o i n a b l e ( ) )<br />

11<br />

12 // d e l e t e current thread<br />

13 delete m_Threads [ y ] ;<br />

14<br />

15 } // f o r ( y = 0 ; y < m_Threads . s i z e ( ) ; y++)<br />

Listing D.2: Thread joining in C++11<br />

253

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

Saved successfully!

Ooh no, something went wrong!