openETCS
case study for the European Train Control System developed for the authors dissertation
Classes | Public Member Functions | Public Attributes | Private Attributes | List of all members
oETCS::DF::CControlFlow Class Reference

control flow (state machine) class used in a data flow More...

#include <ControlFlow.h>

Inheritance diagram for oETCS::DF::CControlFlow:
Inheritance graph
Collaboration diagram for oETCS::DF::CControlFlow:
Collaboration graph

Classes

class  CState
 state class within a control flow More...

Public Member Functions

void AddState (CState *const pState, const bool &bIsInitial) throw ()
 registers a new state object in a control flow
virtual void Calculate () throw (::oETCS::DF::Error::CException)
 virtual method for computing all outputs and setting the all referenced outputs
 CControlFlow (oETCS::DF::CEVCStateMachine *const pStateMachine) throw ()
 general constructor
CState *const GetCurrentState () const throw ()
 gets the current state of the control flow
bool IsActiveFlow (const oETCS::DF::CAbstractFlow *const pFlow) const throw ()
 returns true, if a CFlow object is active in a control flow
bool IsActiveFunctionBlock (const oETCS::DF::CFunctionBlock *const pFunctionBlock) const throw ()
 returns true, if a CFunctionBlock objects is active in a control flow
virtual ~CControlFlow () throw ()
 destructor

Public Attributes

::std::vector
< oETCS::DF::STRING_OUTPUT_T
m_ActiveStateName
 pointers to outputs for active state name
oETCS::DF::BOOL_INPUT_T m_bStart
 storage of the start input value
::std::vector
< oETCS::DF::BOOL_OUTPUT_T
m_IsRunning
 pointers to outputs for running flag
oETCS::DF::CEVCStateMachine *const m_pStateMachine
 pointer to the all contenting EVC state machine

Private Attributes

::std::vector< CState * > m_AvailableStates
 vector with pointers to all available states in the control flow
CStatem_pCurrentState
 pointer to current active state
CStatem_pInitialState
 pointer to the unique initial state object

Detailed Description

control flow (state machine) class used in a data flow

Definition at line 52 of file ControlFlow.h.

Constructor & Destructor Documentation

oETCS::DF::CControlFlow::CControlFlow ( oETCS::DF::CEVCStateMachine *const  pStateMachine) throw ()
explicit

general constructor

Parameters
[in]pStateMachinepointer to the contenting state machine

Definition at line 229 of file ControlFlow.cpp.

oETCS::DF::CControlFlow::~CControlFlow ( ) throw ()
virtual

destructor

Definition at line 244 of file ControlFlow.cpp.

References m_AvailableStates.

Member Function Documentation

void oETCS::DF::CControlFlow::AddState ( CState *const  pState,
const bool &  bIsInitial 
) throw ()

registers a new state object in a control flow

Parameters
[in]pStatepointer to state object to be registered
[in]bIsInitialoptional flag, if state is the initial state

Definition at line 264 of file ControlFlow.cpp.

References m_AvailableStates, and m_pInitialState.

void oETCS::DF::CControlFlow::Calculate ( ) throw (::oETCS::DF::Error::CException)
virtual

virtual method for computing all outputs and setting the all referenced outputs

Remarks
must be implemented by any inheriting class

Implements oETCS::DF::CFunctionBlock.

Definition at line 347 of file ControlFlow.cpp.

References oETCS::DF::CControlFlow::CState::Execute(), m_ActiveStateName, m_bStart, m_IsRunning, oETCS::DF::CControlFlow::CState::m_Name, m_pCurrentState, and m_pInitialState.

Here is the call graph for this function:

oETCS::DF::CControlFlow::CState *const oETCS::DF::CControlFlow::GetCurrentState ( ) const throw ()

gets the current state of the control flow

Returns
pointer to the current state object

Definition at line 335 of file ControlFlow.cpp.

References m_pCurrentState.

bool oETCS::DF::CControlFlow::IsActiveFlow ( const oETCS::DF::CAbstractFlow *const  pFlow) const throw ()

returns true, if a CFlow object is active in a control flow

Parameters
[in]pFlowpointer to a concerete flow object
Returns
active flow flag

Definition at line 312 of file ControlFlow.cpp.

References oETCS::DF::CControlFlow::CState::IsActiveFlow(), and m_pCurrentState.

Referenced by oETCS::DF::CControlFlow::CState::IsActiveFlow(), and oETCS::DF::CEVCStateMachine::CEVCState::CDataFlow::IsActiveFlow().

Here is the call graph for this function:

Here is the caller graph for this function:

bool oETCS::DF::CControlFlow::IsActiveFunctionBlock ( const oETCS::DF::CFunctionBlock *const  pFunctionBlock) const throw ()

returns true, if a CFunctionBlock objects is active in a control flow

Parameters
[in]pFunctionBlockpointer to a function block object to be testetd
Returns
active state flag

Definition at line 289 of file ControlFlow.cpp.

References oETCS::DF::CControlFlow::CState::IsActiveFunctionBlock(), and m_pCurrentState.

Referenced by oETCS::DF::CControlFlow::CState::IsActiveFunctionBlock().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

::std::vector< oETCS::DF::STRING_OUTPUT_T > oETCS::DF::CControlFlow::m_ActiveStateName

pointers to outputs for active state name

Definition at line 234 of file ControlFlow.h.

Referenced by Calculate(), and oETCS::UT::CControlFlow::setUp().

::std::vector< CState* > oETCS::DF::CControlFlow::m_AvailableStates
private

vector with pointers to all available states in the control flow

Definition at line 250 of file ControlFlow.h.

Referenced by AddState(), and ~CControlFlow().

oETCS::DF::BOOL_INPUT_T oETCS::DF::CControlFlow::m_bStart

storage of the start input value

Definition at line 227 of file ControlFlow.h.

Referenced by Calculate(), and oETCS::UT::CControlFlow::setUp().

::std::vector< oETCS::DF::BOOL_OUTPUT_T > oETCS::DF::CControlFlow::m_IsRunning

pointers to outputs for running flag

Definition at line 241 of file ControlFlow.h.

Referenced by Calculate(), and oETCS::UT::CControlFlow::setUp().

CState* oETCS::DF::CControlFlow::m_pCurrentState
private

pointer to current active state

Definition at line 257 of file ControlFlow.h.

Referenced by Calculate(), GetCurrentState(), IsActiveFlow(), and IsActiveFunctionBlock().

CState* oETCS::DF::CControlFlow::m_pInitialState
private

pointer to the unique initial state object

Definition at line 264 of file ControlFlow.h.

Referenced by AddState(), and Calculate().

oETCS::DF::CEVCStateMachine* const oETCS::DF::CFunctionBlock::m_pStateMachine
inherited

pointer to the all contenting EVC state machine

Definition at line 894 of file EVCStateMachine.h.

Referenced by oETCS::DF::CCondition::Calculate(), and oETCS::DF::CDMIOutput::Calculate().


The documentation for this class was generated from the following files:

Copyright (C) 2010-2012 Johannes Feuser (feuser@uni-bremen.de)
The openETCS library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
The openETCS library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the openETCS library. If not, see "http://www.gnu.org/licenses/.