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.

9.5. Implementation<br />

outside the closed loop. Hence, the start object can be arbitrarily chosen. Because data flows<br />

are modelled as relationships or rather bindings in GOPPRR, the needed proc<strong>es</strong>sing of objects<br />

is quite more complicated than for all other cas<strong>es</strong> in the openETCS meta model. Therefore, a<br />

specialised abstract model of data flows is used to determine the execution or<strong>der</strong> in each data<br />

flow of the model. The class diagram of this abstract model is shown in Figure 9.10. Due to<br />

Figure 9.10.: UML class diagram of the abstract model for data flow execution or<strong>der</strong> generation<br />

its specialisation for the data flow or<strong>der</strong>, the abstract model is quite simple and only consists<br />

of the struct CFBNode. It holds the attribut<strong>es</strong> m_OID which is the OID of the corr<strong>es</strong>ponding<br />

function block object and m_eState, which is an enumeration type used during the creation<br />

of the abstract model. The m_Inputs aggregation repr<strong>es</strong>ents the connection from outputs of<br />

other function block objects, which is the backward direction of the data flow. The other or<br />

rather forward data flow direction, the connection of inputs to outputs, is not relevant for the<br />

data flow abstract model because only function block objects without inputs shall be found.<br />

The abstract data flow model is created by the CCPPGenerator::BuildAbstractModel()<br />

method, which is located in Listing E.1 in Appendix E.<br />

After the execution of this method, the abstract model consists of CFBNode objects, which<br />

have the m_eState DEFINED, which means those do not have to be modified further and are<br />

final in the data flow abstract model. In contrast, all objects in each m_Inputs are created as<br />

UNDEFINED. They can be interpreted as place hol<strong>der</strong>s and must afterwards be replaced by a<br />

reference to the “real” (DEFINED) object with the same OID, which can be easily done by the<br />

code in Listing E.2.<br />

The execution and also generation or<strong>der</strong> is finally computed by the CCPPGenerator::-<br />

Proc<strong>es</strong>sAbstractModel() method, which simply generat<strong>es</strong> a list of function block object OIDs<br />

in the required execution or<strong>der</strong> in Listing E.3.<br />

Although the openETCS domain framework provid<strong>es</strong> the parallelisation of independent data<br />

flows (see Section 8.3), this is currently not taken into account for the C++ code generator<br />

because the performance by a plain, serial data flow execution is sufficient for this case study.<br />

CBuildGenerator Implementation In the next step, the build configuration for cmake is<br />

generated by the Generate() method of the m_BuildGenerator object. This is completely independent<br />

from the GOPPRR C++ abstract syntax model because it only requir<strong>es</strong> information<br />

about the source code file, include directori<strong>es</strong> [79], and librari<strong>es</strong> for linking.<br />

173

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

Saved successfully!

Ooh no, something went wrong!