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

storage class for holding any available meta model data type More...

#include <Storage.h>

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

Public Member Functions

virtual void Calculate () throw (::oETCS::DF::Error::CException)
 virtual method for computing all outputs and setting the all referenced outputs
 CStorage (oETCS::DF::CEVCStateMachine *const pStateMachine, const bool &bDebug=false, const std::string &DebugName="") throw ()
 general constructor
::std::vector< bool > GetBitVector (const unsigned long &lSize) const throw ()
 gets a bit vector corresponding to the value
oETCS::DF::DATA_T GetLastInputType () const throw ()
 gets the type of the last used input during Calculate()
virtual ~CStorage () throw ()
 destructor

Public Attributes

oETCS::DF::BOOL_CONTAINER_T m_bBoolInput
 container of the boolean input
::std::vector
< oETCS::DF::CBitFlow * > 
m_BitValue
 vector of pointers to bit flows
::std::vector
< oETCS::DF::BOOL_OUTPUT_T
m_BoolValue
 pointers to boolean storages
oETCS::DF::DOUBLE_CONTAINER_T m_dDoubleInput
 container of the double input
oETCS::DF::DOUBLE_ARRAY_CONTAINER_T m_DoubleArrayInput
 container of the double array input
::std::vector
< oETCS::DF::DOUBLE_ARRAY_OUTPUT_T
m_DoubleArrayValue
 pointers to double array storages
::std::vector
< oETCS::DF::DOUBLE_OUTPUT_T
m_DoubleValue
 pointers to double storages
oETCS::DF::INT_CONTAINER_T m_iIntInput
 container of the integer input
::std::vector
< oETCS::DF::INT_OUTPUT_T
m_IntValue
 pointers to interger storages
oETCS::DF::CEVCStateMachine *const m_pStateMachine
 pointer to the all contenting EVC state machine
oETCS::DF::STRING_CONTAINER_T m_StringInput
 container of the string input
::std::vector
< oETCS::DF::STRING_OUTPUT_T
m_StringValue
 pointers to string storages

Private Attributes

const bool m_bDebug
 flag for debug output
const std::string m_DebugName
 name of instance for debug output
oETCS::DF::DATA_T m_eLastInputType
 type of the input within the last cycle (call of Calculate())

Detailed Description

storage class for holding any available meta model data type

Definition at line 52 of file Storage.h.

Constructor & Destructor Documentation

oETCS::DF::CStorage::CStorage ( oETCS::DF::CEVCStateMachine *const  pStateMachine,
const bool &  bDebug = false,
const std::string &  DebugName = "" 
) throw ()
explicit

general constructor

Parameters
[in]pStateMachinepointer to the parent EVC state machine object
[in]bDebugoptinal flag for using debug ouput of value
[in]DebugNameoptional name for the debug output

Definition at line 36 of file Storage.cpp.

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

destructor

Definition at line 57 of file Storage.cpp.

Member Function Documentation

void oETCS::DF::CStorage::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 68 of file Storage.cpp.

References oETCS::DF::BOOL, oETCS::DF::DOUBLE, oETCS::DF::DOUBLE_ARRAY, oETCS::DF::INT, oETCS::DF::CFunctionBlock::CInput< INPUT_TYPE_T >::IsModified(), m_bBoolInput, m_bDebug, m_BitValue, m_BoolValue, m_dDoubleInput, m_DebugName, m_DoubleArrayInput, m_DoubleArrayValue, m_DoubleValue, m_eLastInputType, m_iIntInput, m_IntValue, m_StringInput, m_StringValue, oETCS::DF::CFunctionBlock::CInput< INPUT_TYPE_T >::m_Value, and oETCS::DF::STRING.

Referenced by oETCS::DF::CVariable::Calculate(), and oETCS::UT::CFunctionBlock::TestStorage().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< bool > oETCS::DF::CStorage::GetBitVector ( const unsigned long &  lSize) const throw ()

gets a bit vector corresponding to the value

If the required size is smaller than the calculated needed size, the vector is truncated. In case of an array, the vector is truncated+ element-wise.

Parameters
[in]lSizerequired size of the bit vector
Returns
vector of boolean holding the bit raw data in little endian format

Definition at line 298 of file Storage.cpp.

References oETCS::DF::BOOL, oETCS::DF::DOUBLE, oETCS::DF::DOUBLE_ARRAY, oETCS::DF::INT, and oETCS::DF::STRING.

oETCS::DF::DATA_T oETCS::DF::CStorage::GetLastInputType ( ) const throw ()

gets the type of the last used input during Calculate()

Returns
type of the input

Definition at line 428 of file Storage.cpp.

References m_eLastInputType.

Member Data Documentation

oETCS::DF::BOOL_CONTAINER_T oETCS::DF::CStorage::m_bBoolInput

container of the boolean input

Definition at line 108 of file Storage.h.

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

const bool oETCS::DF::CStorage::m_bDebug
private

flag for debug output

Definition at line 194 of file Storage.h.

Referenced by Calculate().

::std::vector< oETCS::DF::CBitFlow* > oETCS::DF::CStorage::m_BitValue

vector of pointers to bit flows

Definition at line 178 of file Storage.h.

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

::std::vector< oETCS::DF::BOOL_OUTPUT_T > oETCS::DF::CStorage::m_BoolValue
oETCS::DF::DOUBLE_CONTAINER_T oETCS::DF::CStorage::m_dDoubleInput

container of the double input

Definition at line 115 of file Storage.h.

Referenced by Calculate(), oETCS::DF::CVariable::Calculate(), and oETCS::UT::CFunctionBlock::TestStorage().

const std::string oETCS::DF::CStorage::m_DebugName
private

name of instance for debug output

Definition at line 201 of file Storage.h.

Referenced by Calculate().

oETCS::DF::DOUBLE_ARRAY_CONTAINER_T oETCS::DF::CStorage::m_DoubleArrayInput

container of the double array input

Definition at line 122 of file Storage.h.

Referenced by Calculate(), oETCS::DF::CVariable::Calculate(), and oETCS::UT::CFunctionBlock::TestStorage().

::std::vector< oETCS::DF::DOUBLE_ARRAY_OUTPUT_T > oETCS::DF::CStorage::m_DoubleArrayValue

pointers to double array storages

Definition at line 157 of file Storage.h.

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

::std::vector< oETCS::DF::DOUBLE_OUTPUT_T > oETCS::DF::CStorage::m_DoubleValue

pointers to double storages

Definition at line 150 of file Storage.h.

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

oETCS::DF::DATA_T oETCS::DF::CStorage::m_eLastInputType
private

type of the input within the last cycle (call of Calculate())

Definition at line 187 of file Storage.h.

Referenced by Calculate(), and GetLastInputType().

oETCS::DF::INT_CONTAINER_T oETCS::DF::CStorage::m_iIntInput

container of the integer input

Definition at line 129 of file Storage.h.

Referenced by Calculate(), oETCS::DF::CVariable::Calculate(), and oETCS::UT::CFunctionBlock::TestStorage().

::std::vector< oETCS::DF::INT_OUTPUT_T > oETCS::DF::CStorage::m_IntValue

pointers to interger storages

Definition at line 164 of file Storage.h.

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

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().

oETCS::DF::STRING_CONTAINER_T oETCS::DF::CStorage::m_StringInput

container of the string input

Definition at line 136 of file Storage.h.

Referenced by Calculate(), oETCS::DF::CVariable::Calculate(), and oETCS::UT::CFunctionBlock::TestStorage().

::std::vector< oETCS::DF::STRING_OUTPUT_T > oETCS::DF::CStorage::m_StringValue

pointers to string storages

Definition at line 171 of file Storage.h.

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


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