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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.5. Deployment D<strong>es</strong>ign<br />

Hence, those class<strong>es</strong> can only have a stub implementation in the PIM because those hardware<br />

components are always specific. The D-Bus component / daemon provid<strong>es</strong> those interfac<strong>es</strong> to<br />

the libopenETCSPIM component while it requir<strong>es</strong> them from the libopenETCSPSM component.<br />

In that way, m<strong>es</strong>sag<strong>es</strong> from and to the specific class<strong>es</strong> in the PIM can be dispatched to the<br />

PSM without any direct connection in an object-oriented manner.<br />

Of course, it is possible, as proposed in Section 6.2, to place each hardware interface<br />

implementation in an own execution environment or rather virtual machine and to connect each<br />

to the D-Bus component in the EVC. Neverthel<strong>es</strong>s, the domain framework / PIM only defin<strong>es</strong><br />

the interfac<strong>es</strong> to the PSM but do<strong>es</strong> not define how (and where) the concrete implementations<br />

are provided because such details are not relevant for the domain framework deployment d<strong>es</strong>ign<br />

in general.<br />

Finally, it must be emphasised that for an executable EVC state machine not only the source<br />

artefacts from the openETCS domain framework are required but also the generated code from<br />

the openETCS model, which instantiat<strong>es</strong> the class<strong>es</strong> of the domain framework. However, that<br />

generated code is mutable because it depends on the openETCS model and therefore is not a<br />

direct part of the domain framework deployment d<strong>es</strong>ign.<br />

D-Bus Integration Since the preceding paragraphs in this section mainly discussed the general<br />

integration of the D-Bus as middleware, the following paragraphs will explain the details<br />

about the D-Bus usage. The defined interfac<strong>es</strong> IEmergencyBrake, IOdomoter, IServiceBrake,<br />

IBaliseDeviceIn, and IBaliseDeviceOut are not directly typ<strong>es</strong> or rather abstract class<strong>es</strong> [79] and<br />

therefore cannot be simply integrated into the class structure by inheritance. Therefore, the<br />

corr<strong>es</strong>ponding openETCS domain framework class<strong>es</strong> must make use of the interface in a different<br />

manner, which is shown in Figure 8.16. The function block class<strong>es</strong> that are all located in the<br />

PlatformSpecificClientsMOC artefact have all a composition m_pProxy to the corr<strong>es</strong>ponding<br />

interface 9 type. Since the general D-Bus implementation provid<strong>es</strong> only a GLib [31] API,<br />

which is not object oriented, its direct usage in the openETCS domain framework would<br />

cause a break with the so far pure object-oriented d<strong>es</strong>ign and implementation. Thus, as for<br />

the concrete observer implementation CDMIQWidget, Qt 4 is employed because its D-Bus<br />

module [59] provid<strong>es</strong> an object-oriented API. Accordingly, the platform specific class<strong>es</strong> are not<br />

only CFunctionBlock typ<strong>es</strong> but additionally inherit from QObject to be able to use Qt 4’s<br />

signal and slot mechanism [59]. The function block typ<strong>es</strong> use a m_Mutex composition to ensure<br />

thread-safe manipulations of their attribut<strong>es</strong>.<br />

On the one hand, D-Bus itself defin<strong>es</strong> interfac<strong>es</strong> that can be used as proxi<strong>es</strong> for the communication<br />

and, on the other hand, adaptors that must be (re-)implemented with the “real”<br />

implementation [31]. Interface and adaptor are generated from an XML file that defin<strong>es</strong> the<br />

m<strong>es</strong>sag<strong>es</strong> and signals of an adaptor (and its interface), which is sketched in Figure 8.17. The<br />

contents of the XML interface definition can be found in Appendix D. It must be noted that<br />

the generated interface class<strong>es</strong> are no interfac<strong>es</strong> in the meaning of abstract class<strong>es</strong> [79], which<br />

are typ<strong>es</strong> that cannot instantiated directly. Instead, they can be interpreted as proxy objects<br />

that can be used in place of the corr<strong>es</strong>ponding adaptors. The artefacts are generated in the<br />

case of the Qt 4 D-Bus API by the “qdbusxmll2cpp” application [59].<br />

9 prefixed by an “I”<br />

145

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

Saved successfully!

Ooh no, something went wrong!