SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BinaryInputDevice.cpp File Reference
#include <config.h>
#include <string>
#include <utils/geom/Position.h>
#include "BinaryFormatter.h"
#include "BinaryInputDevice.h"

Go to the source code of this file.

Macros

#define BUF_MAX   1000
 

Functions

BinaryInputDeviceoperator>> (BinaryInputDevice &os, char &c)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, unsigned char &c)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, int &i)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, unsigned int &i)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, SUMOReal &f)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, bool &b)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, std::string &s)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, std::vector< std::string > &v)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, std::vector< unsigned int > &v)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, std::vector< std::vector< unsigned int > > &v)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, Position &p)
 

Detailed Description

Author
Daniel Krajzewicz
Michael Behrisch
Date
2005-09-15
Version
Id:
BinaryInputDevice.cpp 13107 2012-12-02 13:57:34Z behrisch

Definition in file BinaryInputDevice.cpp.

Macro Definition Documentation

#define BUF_MAX   1000

Definition at line 44 of file BinaryInputDevice.cpp.

Referenced by operator>>(), and BinaryInputDevice::read().

Function Documentation

BinaryInputDevice& operator>> ( BinaryInputDevice os,
char &  c 
)
Parameters
[in,out]osThe BinaryInputDevice to read the char from
[in]cThe char to store the read value into
Returns
The used BinaryInputDevice for further processing

Definition at line 102 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_BYTE, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
unsigned char &  c 
)
Parameters
[in,out]osThe BinaryInputDevice to read the char from
[in]cThe char to store the read value into
Returns
The used BinaryInputDevice for further processing

Definition at line 110 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_BYTE, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
int i 
)
Parameters
[in,out]osThe BinaryInputDevice to read the int from
[in]iThe int to store the read value into
Returns
The used BinaryInputDevice for further processing

Definition at line 118 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_INTEGER, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
unsigned int i 
)
Parameters
[in,out]osThe BinaryInputDevice to read the unsigned int from
[in]iThe unsigned int to store the read value into
Returns
The used BinaryInputDevice for further processing

Definition at line 126 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_INTEGER, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
SUMOReal f 
)
Parameters
[in,out]osThe BinaryInputDevice to read the SUMOReal from
[in]iThe SUMOReal to store the read value into
Returns
The used BinaryInputDevice for further processing

Definition at line 134 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_FLOAT, BinaryFormatter::BF_SCALED2INT, BinaryInputDevice::checkType(), BinaryInputDevice::myStream, and SUMOReal.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
bool b 
)
Parameters
[in,out]osThe BinaryInputDevice to read the bool from
[in]iThe bool to store the read value into
Returns
The used BinaryInputDevice for further processing

Definition at line 148 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_BYTE, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
std::string &  s 
)

Reads the length of the string as an unsigned int, first. Reads then the specified number of chars into "myBuffer". Please note that the buffer has a fixed size - longer strings will cause an error.

Parameters
[in,out]osThe BinaryInputDevice to read the string from
[in]sThe string to store the read value into
Returns
The used BinaryInputDevice for further processing
Todo:
Use either a buffer with a flexible size or report an error if the buffer is too small!

Definition at line 157 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_STRING, BUF_MAX, BinaryInputDevice::checkType(), BinaryInputDevice::myBuffer, and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
std::vector< std::string > &  v 
)

Reads the length of the vector as an unsigned int, first. Reads then the specified number of strings using the string input operator. Please note that the buffer has a fixed size - longer strings will cause an error.

Parameters
[in,out]osThe BinaryInputDevice to read the string from
[in]vThe string vector to store the read value into
Returns
The used BinaryInputDevice for further processing
Todo:
Use either a buffer with a flexible size or report an error if the buffer is too small!

Definition at line 171 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_LIST, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
std::vector< unsigned int > &  v 
)

Reads the length of the vector as an unsigned int, first. Reads then the specified number of strings using the string input operator. Please note that the buffer has a fixed size - longer strings will cause an error.

Parameters
[in,out]osThe BinaryInputDevice to read the string from
[in]vThe string vector to store the read value into
Returns
The used BinaryInputDevice for further processing
Todo:
Use either a buffer with a flexible size or report an error if the buffer is too small!

Definition at line 186 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_LIST, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.

BinaryInputDevice& operator>> ( BinaryInputDevice os,
std::vector< std::vector< unsigned int > > &  v 
)

Reads the length of the vector as an unsigned int, first. Reads then the specified number of strings using the string input operator. Please note that the buffer has a fixed size - longer strings will cause an error.

Parameters
[in,out]osThe BinaryInputDevice to read the string from
[in]vThe string vector to store the read value into
Returns
The used BinaryInputDevice for further processing
Todo:
Use either a buffer with a flexible size or report an error if the buffer is too small!

Definition at line 201 of file BinaryInputDevice.cpp.

References BinaryFormatter::BF_LIST, BinaryInputDevice::checkType(), and BinaryInputDevice::myStream.