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, double &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 23529 2017-03-18 10:22:36Z behrisch

Definition in file BinaryInputDevice.cpp.

Macro Definition Documentation

◆ BUF_MAX

#define BUF_MAX   10000

Definition at line 41 of file BinaryInputDevice.cpp.

Referenced by operator>>().

Function Documentation

◆ operator>>() [1/10]

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 96 of file BinaryInputDevice.cpp.

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

◆ operator>>() [2/10]

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 104 of file BinaryInputDevice.cpp.

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

◆ operator>>() [3/10]

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 112 of file BinaryInputDevice.cpp.

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

◆ operator>>() [4/10]

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

Definition at line 120 of file BinaryInputDevice.cpp.

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

◆ operator>>() [5/10]

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 134 of file BinaryInputDevice.cpp.

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

◆ operator>>() [6/10]

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 143 of file BinaryInputDevice.cpp.

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

◆ operator>>() [7/10]

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 160 of file BinaryInputDevice.cpp.

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

◆ operator>>() [8/10]

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 175 of file BinaryInputDevice.cpp.

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

◆ operator>>() [9/10]

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 190 of file BinaryInputDevice.cpp.

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

◆ operator>>() [10/10]