SUMO - Simulation of Urban MObility
BinaryInputDevice.cpp File Reference
#include <config.h>
#include <string>
#include <utils/common/StdDefs.h>
#include <utils/geom/Position.h>
#include "BinaryFormatter.h"
#include "BinaryInputDevice.h"
Include dependency graph for BinaryInputDevice.cpp:

Go to the source code of this file.

Macros

#define BUF_MAX   10000
 

Functions

BinaryInputDeviceoperator>> (BinaryInputDevice &os, char &c)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, unsigned char &c)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, 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< int > &v)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, std::vector< std::vector< int > > &v)
 
BinaryInputDeviceoperator>> (BinaryInputDevice &os, Position &p)
 

Detailed Description

Author
Daniel Krajzewicz
Michael Behrisch
Date
2005-09-15
Version
Id
BinaryInputDevice.cpp 21182 2016-07-18 06:46:01Z behrisch

Definition in file BinaryInputDevice.cpp.

Macro Definition Documentation

#define BUF_MAX   10000

Definition at line 45 of file BinaryInputDevice.cpp.

Referenced by operator>>().

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 100 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 108 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 116 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 124 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 138 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 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 147 of file BinaryInputDevice.cpp.

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

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

Reads the length of the vector as an 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 164 of file BinaryInputDevice.cpp.

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

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

Reads the length of the vector as an 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 179 of file BinaryInputDevice.cpp.

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

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

Reads the length of the vector as an 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 194 of file BinaryInputDevice.cpp.

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