openETCS
case study for the European Train Control System developed for the authors dissertation
|
control flow (state machine) class used in a data flow More...
#include <ControlFlow.h>
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 | |
CState * | m_pCurrentState |
pointer to current active state | |
CState * | m_pInitialState |
pointer to the unique initial state object |
control flow (state machine) class used in a data flow
Definition at line 52 of file ControlFlow.h.
|
explicit |
general constructor
[in] | pStateMachine | pointer to the contenting state machine |
Definition at line 229 of file ControlFlow.cpp.
|
virtual |
void oETCS::DF::CControlFlow::AddState | ( | CState *const | pState, |
const bool & | bIsInitial | ||
) | throw () |
registers a new state object in a control flow
[in] | pState | pointer to state object to be registered |
[in] | bIsInitial | optional flag, if state is the initial state |
Definition at line 264 of file ControlFlow.cpp.
References m_AvailableStates, and m_pInitialState.
|
virtual |
virtual method for computing all outputs and setting the all referenced outputs
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.
oETCS::DF::CControlFlow::CState *const oETCS::DF::CControlFlow::GetCurrentState | ( | ) | const throw () |
gets the current state of the control flow
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
[in] | pFlow | pointer to a concerete flow object |
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().
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
[in] | pFunctionBlock | pointer to a function block object to be testetd |
Definition at line 289 of file ControlFlow.cpp.
References oETCS::DF::CControlFlow::CState::IsActiveFunctionBlock(), and m_pCurrentState.
Referenced by oETCS::DF::CControlFlow::CState::IsActiveFunctionBlock().
::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().
|
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().
|
private |
pointer to current active state
Definition at line 257 of file ControlFlow.h.
Referenced by Calculate(), GetCurrentState(), IsActiveFlow(), and IsActiveFunctionBlock().
|
private |
pointer to the unique initial state object
Definition at line 264 of file ControlFlow.h.
Referenced by AddState(), and Calculate().
|
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().
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/.