openETCS
case study for the European Train Control System developed for the authors dissertation
|
class for holding packet information More...
#include <Language.h>
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 | |
CPacket & | operator<< (::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 | |
CPacket & | operator>> (::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 |
class for holding packet information
Definition at line 347 of file Language.h.
|
explicit |
general constructor
Parameterises the Packet with all constant members. The Packet object takes over the posession of all variables/memory passed by pointer.
[in] | pStateMachine | pointer to parent EVC state machine |
[in] | cID | unique numerical ID of the packet |
[in] | Variables | optional 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
|
virtual |
destructor
Definition at line 964 of file Language.cpp.
unsigned long oETCS::DF::CPacket::GetSize | ( | ) | const throw () |
gets the size of the packet depending on the variables stored
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.
inout] | Bits vector of boolean holding the bit raw data in little endian format |
Definition at line 1000 of file Language.cpp.
oETCS::DF::CPacket & oETCS::DF::CPacket::operator>> | ( | ::std::vector< bool > & | Bits | ) | throw () |
streaming operator for getting the raw data in a packet
[out] | Bits | vector of boolean holding the bit raw data in little endian format |
Definition at line 1100 of file Language.cpp.
const unsigned char oETCS::DF::CPacket::m_cID |
numerical unique ID of a packet
Definition at line 422 of file Language.h.
|
private |
vector with pointers to all possible included variables in their order
Definition at line 431 of file Language.h.
Referenced by GetSize().
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/.