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.3. Structural D<strong>es</strong>ign<br />

defin<strong>es</strong> the corr<strong>es</strong>ponding implementation or rather C++ type [79], like bool, double, int, etc.<br />

The second template parameter FLOW_TYPE_T defin<strong>es</strong> the type of the related CInput object.<br />

This parameter has the default value CInput< INPUT_TYPE_T > and normally do<strong>es</strong> not have<br />

to be set explicitly. It is used to define the attribute m_pInput of CFlow that is the connected<br />

CInput instance. m_pInput is not modelled as composition in Figure 8.4 because the usage of<br />

template parameters in UML class diagrams is limited.<br />

The CInput template class, which is n<strong>es</strong>ted in the CFunctionBlock base class, is used to<br />

encapsulate each data flow input as property. Its template parameter INPUT_TYPE_T defin<strong>es</strong>,<br />

as for the CFlow class, the concrete implementation data type. This means each input of a<br />

certain function block type or rather class is defined as attribute of the type CInput with the<br />

corr<strong>es</strong>ponding template parameter for the concrete data flow type corr<strong>es</strong>ponding to the meta<br />

model. Compared with the direct usage of an implementation data type, this has the advantage<br />

that the modification state of each input can be made available or visible to its poss<strong>es</strong>sing<br />

function block object. Furthermore, the acc<strong>es</strong>s of inputs can be made thread-safe [7] by using<br />

a mutable exclusion (mutex) [7] object via the m_ValueMutex composition. It must be noted<br />

that the mutex class is located within the std:: name space of the standard C++ library [7],<br />

which is not explicitly modelled in Figure 8.4.<br />

Unfortunately, the bit data flow type between oVariableStorage objects in the openETCS meta<br />

model (see Subsection 7.3.2) cannot be directly mapped to a data type in the implementation.<br />

Hence, the CFlow template class cannot be used for those data flows and the additional<br />

CBitFlow class was added, which is not a template class and is <strong>es</strong>pecially d<strong>es</strong>igned for data<br />

flows between CStorage instanc<strong>es</strong>. Corr<strong>es</strong>pondingly, the aggregation between those two class<strong>es</strong><br />

has the two ends m_pInput and m_BitValue. The first is the input storage object, from the view<br />

of CFlow while the latter holds all outputs to other CStorage objects. It should be remarked<br />

that m_pInput is modelled as aggregation compared to the m_pInput because CBitFlow is not<br />

a template class.<br />

Since all interconnections or rather all flows are assigned to a certain parent CEVCStateMachine<br />

object via the m_Flows composition, CAbstractFlow is used as base class for the both<br />

concrete flow typ<strong>es</strong>. Finally, to solve the initial problem of the general usage or rather execution<br />

of all existing interconnection / data flows, each CAbstractFlow instance requ<strong>es</strong>ts via the<br />

m_pStateMachine aggregation if it is part of the currently executed data flow, which means<br />

an element of the m_Flows aggregation. If not, any m<strong>es</strong>sage from a connected function block<br />

object using operator=() is ignored. Otherwise, the value is marshalled to the related input.<br />

Since the flows between function block objects that are part of an embedded state machine<br />

r<strong>es</strong>pectively a CControlFlow instance should only be executed if the related CState object is<br />

currently active, also CState poss<strong>es</strong> an aggregation m_Flows to CAbstractFlow.<br />

8.3.2. Driver Machine Interface Details<br />

All class<strong>es</strong> <strong>es</strong>pecially related to the DMI are pr<strong>es</strong>ented in a separated class diagram in Figure 8.5.<br />

CDMIObserver is the abstract observer [32, pp. 293-303], from which each concrete observer<br />

implementation must be <strong>der</strong>ived and methods called by the CEVCStateMachine class must be<br />

implemented by overriding [79]. The parent CEVCStateMachine instance holds pointers to all<br />

registered, concrete observers in the aggregation m_Observers via the abstract base type to be<br />

131

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

Saved successfully!

Ooh no, something went wrong!