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

state class within a control flow More...

#include <ControlFlow.h>

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

Public Member Functions

 CState (CControlFlow *const pParent, const std::string &StateName, const ::std::vector< oETCS::DF::CFunctionBlock * > &FunctionBlocks, const ::std::vector< oETCS::DF::CAbstractFlow * > &Flows, const bool &bIsFinal=false, const bool &bIsInitial=false) throw ()
 general constructor
void Execute () throw (::oETCS::DF::Error::CException)
 executes the state including data flow and possible transitions
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 ~CState () throw ()

Public Attributes

const bool m_bIsFinal
 flag for a final state
const ::std::string m_Name
 literal name of the state

Private Attributes

::std::vector
< oETCS::DF::CAbstractFlow * > 
m_Flows
 vector with pointer to all flows/connections used in a control flow state
const ::std::vector
< oETCS::DF::CFunctionBlock * > 
m_FunctionBlocks
 vector with pointers to all function block objects, which are executed in a state
CControlFlow *const m_pParent
 pointer to the parent control flow object
::std::vector
< oETCS::DF::CTransition * > 
m_TransitionStack
 vector with pointers to transition objects, which were activated

Friends

class oETCS::DF::CCondition

Detailed Description

state class within a control flow

Definition at line 58 of file ControlFlow.h.

Constructor & Destructor Documentation

oETCS::DF::CControlFlow::CState::CState ( CControlFlow *const  pParent,
const std::string &  StateName,
const ::std::vector< oETCS::DF::CFunctionBlock * > &  FunctionBlocks,
const ::std::vector< oETCS::DF::CAbstractFlow * > &  Flows,
const bool &  bIsFinal = false,
const bool &  bIsInitial = false 
) throw ()

general constructor

Parameterises the state with all constant members. The data flow object takes over the posession of the passed data flow object.

Parameters
[in]pParentpointer to the parent control flow object
[in]StateNameliteral name of the state
[in]FunctionBlocksvector with pointers to function blocks, which are executed by this state
[in]Flowsvector with pointer to flow objects, which connect function blocks in this state
[in]bIsFinaloptinal flag for a final state
[in]bIsFinaloptinal flag for the initial state

Definition at line 36 of file ControlFlow.cpp.

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

Definition at line 59 of file ControlFlow.cpp.

Member Function Documentation

void oETCS::DF::CControlFlow::CState::Execute ( ) throw (::oETCS::DF::Error::CException)

executes the state including data flow and possible transitions

Definition at line 143 of file ControlFlow.cpp.

Referenced by oETCS::DF::CControlFlow::Calculate().

Here is the caller graph for this function:

bool oETCS::DF::CControlFlow::CState::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 104 of file ControlFlow.cpp.

References oETCS::DF::CControlFlow::IsActiveFlow().

Referenced by oETCS::DF::CControlFlow::IsActiveFlow().

Here is the call graph for this function:

Here is the caller graph for this function:

bool oETCS::DF::CControlFlow::CState::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 70 of file ControlFlow.cpp.

References oETCS::DF::CControlFlow::IsActiveFunctionBlock().

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

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class oETCS::DF::CCondition
friend

Definition at line 153 of file ControlFlow.h.

Member Data Documentation

const bool oETCS::DF::CControlFlow::CState::m_bIsFinal

flag for a final state

Definition at line 119 of file ControlFlow.h.

::std::vector< oETCS::DF::CAbstractFlow* > oETCS::DF::CControlFlow::CState::m_Flows
private

vector with pointer to all flows/connections used in a control flow state

Definition at line 149 of file ControlFlow.h.

const ::std::vector< oETCS::DF::CFunctionBlock* > oETCS::DF::CControlFlow::CState::m_FunctionBlocks
private

vector with pointers to all function block objects, which are executed in a state

Definition at line 142 of file ControlFlow.h.

const ::std::string oETCS::DF::CControlFlow::CState::m_Name

literal name of the state

Definition at line 112 of file ControlFlow.h.

Referenced by oETCS::DF::CControlFlow::Calculate().

CControlFlow* const oETCS::DF::CControlFlow::CState::m_pParent
private

pointer to the parent control flow object

Definition at line 128 of file ControlFlow.h.

::std::vector< oETCS::DF::CTransition* > oETCS::DF::CControlFlow::CState::m_TransitionStack
private

vector with pointers to transition objects, which were activated

Definition at line 135 of file ControlFlow.h.


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/.