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::CPacket Class Reference

class for holding packet information More...

#include <Language.h>

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

Public Member Functions

 CPacket (oETCS::DF::CEVCStateMachine *const pStateMachine, const unsigned char &cID, const ::std::vector< oETCS::DF::CVariable * > &Variables=::std::vector< oETCS::DF::CVariable * >(0)) throw ()
 general constructor
 CPacket (const CPacket &Source)
 deleted copy constructor
unsigned long GetSize () const throw ()
 gets the size of the packet depending on the variables stored
CPacketoperator<< (::std::vector< bool > &Bits) throw (::oETCS::DF::Error::CException)
 streaming operator for filling a telegram with raw data
CPacket operator= (const CPacket &Source)
 deleted assignment operator
CPacketoperator>> (::std::vector< bool > &Bits) throw ()
 streaming operator for getting the raw data in a packet
virtual ~CPacket () throw ()
 destructor

Public Attributes

const unsigned char m_cID
 numerical unique ID of a packet

Private Attributes

::std::vector
< oETCS::DF::CVariable * > 
m_Variables
 vector with pointers to all possible included variables in their order

Detailed Description

class for holding packet information

Definition at line 347 of file Language.h.

Constructor & Destructor Documentation

oETCS::DF::CPacket::CPacket ( oETCS::DF::CEVCStateMachine *const  pStateMachine,
const unsigned char &  cID,
const ::std::vector< oETCS::DF::CVariable * > &  Variables = ::std::vector< oETCS::DF::CVariable* >(0) 
) throw ()
explicit

general constructor

Parameterises the Packet with all constant members. The Packet object takes over the posession of all variables/memory passed by pointer.

Parameters
[in]pStateMachinepointer to parent EVC state machine
[in]cIDunique numerical ID of the packet
[in]Variablesoptional vector with pointers to all packets supported

Definition at line 950 of file Language.cpp.

oETCS::DF::CPacket::CPacket ( const CPacket Source)

deleted copy constructor

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

destructor

Definition at line 964 of file Language.cpp.

Member Function Documentation

unsigned long oETCS::DF::CPacket::GetSize ( ) const throw ()

gets the size of the packet depending on the variables stored

Returns
size of the packet in bits

Definition at line 975 of file Language.cpp.

References m_Variables.

oETCS::DF::CPacket & oETCS::DF::CPacket::operator<< ( ::std::vector< bool > &  Bits) throw (::oETCS::DF::Error::CException)

streaming operator for filling a telegram with raw data

Bits consumed for packet and underlying variabke reconstruction are removed from bit stream vector. The first sizeof(m_cID) bytes are compared with m_cID. If unequal, the complete bit stream will be ignored.

Parameters
inout]Bits vector of boolean holding the bit raw data in little endian format

Definition at line 1000 of file Language.cpp.

CPacket oETCS::DF::CPacket::operator= ( const CPacket Source)

deleted assignment operator

oETCS::DF::CPacket & oETCS::DF::CPacket::operator>> ( ::std::vector< bool > &  Bits) throw ()

streaming operator for getting the raw data in a packet

Parameters
[out]Bitsvector of boolean holding the bit raw data in little endian format
Returns
reference to this instance

Definition at line 1100 of file Language.cpp.

Member Data Documentation

const unsigned char oETCS::DF::CPacket::m_cID

numerical unique ID of a packet

Definition at line 422 of file Language.h.

::std::vector< oETCS::DF::CVariable* > oETCS::DF::CPacket::m_Variables
private

vector with pointers to all possible included variables in their order

Definition at line 431 of file Language.h.

Referenced by GetSize().


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