Eclipse SUMO - Simulation of Urban MObility
tcpip::Storage Class Reference

#include <storage.h>

Public Types

typedef std::vector< unsigned char > StorageType
 

Public Member Functions

StorageType::const_iterator begin () const
 
StorageType::const_iterator end () const
 
std::string hexDump () const
 Dump storage content as series of hex values. More...
 
Storageoperator= (const Storage &)=delete
 Invalidated assignment operator. More...
 
virtual unsigned int position () const
 
virtual int readByte ()
 
virtual unsigned char readChar ()
 
virtual double readDouble ()
 
virtual std::vector< double > readDoubleList ()
 
virtual float readFloat ()
 
virtual int readInt ()
 
virtual int readShort ()
 
virtual std::string readString ()
 
virtual std::vector< std::string > readStringList ()
 
virtual int readUnsignedByte ()
 
void reset ()
 
void resetPos ()
 
StorageType::size_type size () const
 
 Storage ()
 Standard Constructor. More...
 
 Storage (const unsigned char[], int length=-1)
 Constructor, that fills the storage with an char array. If length is -1, the whole array is handed over. More...
 
virtual bool valid_pos ()
 
virtual void writeByte (int)
 
virtual void writeChar (unsigned char)
 
virtual void writeDouble (double)
 
virtual void writeDoubleList (const std::vector< double > &s)
 
virtual void writeFloat (float)
 
virtual void writeInt (int)
 
virtual void writePacket (const std::vector< unsigned char > &packet)
 
virtual void writePacket (unsigned char *packet, int length)
 
virtual void writeShort (int)
 
virtual void writeStorage (tcpip::Storage &store)
 
virtual void writeString (const std::string &s)
 
virtual void writeStringList (const std::vector< std::string > &s)
 
virtual void writeUnsignedByte (int)
 
virtual ~Storage ()
 

Private Member Functions

void checkReadSafe (unsigned int num) const
 Check if the next num bytes can be read safely. More...
 
void init ()
 Used in constructors to initialize local variables. More...
 
void readByEndianess (unsigned char *array, int size)
 Read size elements into array according to endianess. More...
 
unsigned char readCharUnsafe ()
 Read a byte without validity check. More...
 
void writeByEndianess (const unsigned char *begin, unsigned int size)
 Write size elements of array begin according to endianess. More...
 

Private Attributes

bool bigEndian_
 
StorageType::const_iterator iter_
 
StorageType store
 

Detailed Description

Definition at line 37 of file storage.h.

Member Typedef Documentation

◆ StorageType

typedef std::vector<unsigned char> tcpip::Storage::StorageType

Definition at line 41 of file storage.h.

Constructor & Destructor Documentation

◆ Storage() [1/2]

tcpip::Storage::Storage ( )

Standard Constructor.

Definition at line 32 of file storage.cpp.

References init().

◆ Storage() [2/2]

tcpip::Storage::Storage ( const unsigned char  packet[],
int  length = -1 
)

Constructor, that fills the storage with an char array. If length is -1, the whole array is handed over.

Definition at line 39 of file storage.cpp.

References init(), and store.

◆ ~Storage()

tcpip::Storage::~Storage ( )
virtual

Definition at line 64 of file storage.cpp.

Member Function Documentation

◆ begin()

StorageType::const_iterator tcpip::Storage::begin ( ) const
inline

Definition at line 121 of file storage.h.

References store.

Referenced by TraCIServer::readCommandID(), tcpip::Socket::sendExact(), and writeByEndianess().

Here is the caller graph for this function:

◆ checkReadSafe()

void tcpip::Storage::checkReadSafe ( unsigned int  num) const
private

Check if the next num bytes can be read safely.

Definition at line 397 of file storage.cpp.

References iter_, and store.

Referenced by readByEndianess(), and readString().

Here is the caller graph for this function:

◆ end()

StorageType::const_iterator tcpip::Storage::end ( ) const
inline

Definition at line 122 of file storage.h.

References store.

Referenced by TraCIServer::readCommandID(), readString(), tcpip::Socket::sendExact(), and writeByEndianess().

Here is the caller graph for this function:

◆ hexDump()

std::string tcpip::Storage::hexDump ( ) const

Dump storage content as series of hex values.

Definition at line 448 of file storage.cpp.

References store.

◆ init()

void tcpip::Storage::init ( )
private

Used in constructors to initialize local variables.

Definition at line 52 of file storage.cpp.

References bigEndian_, iter_, and store.

Referenced by Storage().

Here is the caller graph for this function:

◆ operator=()

Storage& tcpip::Storage::operator= ( const Storage )
delete

Invalidated assignment operator.

◆ position()

unsigned int tcpip::Storage::position ( ) const
virtual

Definition at line 76 of file storage.cpp.

References iter_, and store.

Referenced by TraCIAPI::check_commandGetResult(), libtraci::Connection::check_resultState(), TraCIAPI::check_resultState(), TraCIServer::dispatchCommand(), and TraCIServer::readCommandID().

Here is the caller graph for this function:

◆ readByEndianess()

void tcpip::Storage::readByEndianess ( unsigned char *  array,
int  size 
)
private

Read size elements into array according to endianess.

Definition at line 431 of file storage.cpp.

References bigEndian_, checkReadSafe(), readCharUnsafe(), and size().

Referenced by readDouble(), readFloat(), readInt(), and readShort().

Here is the caller graph for this function:

◆ readByte()

int tcpip::Storage::readByte ( )
virtual

Reads a byte form the array

Returns
The read byte (between -128 and 127)

Definition at line 128 of file storage.cpp.

References readChar().

Referenced by TraCIServer::addSubscriptionFilter(), libtraci::Domain< GET, SET >::getByte(), LIBSUMO_NAMESPACE::Lane::handleVariable(), TraCIServer::initialiseSubscription(), TraCITestClient::readAndReportTypeDependent(), TraCIServer::readTypeCheckingByte(), and libsumo::StorageHelper::readTypedByte().

Here is the caller graph for this function:

◆ readChar()

unsigned char tcpip::Storage::readChar ( )
virtual

Reads a char form the array

Returns
The read char (between 0 and 255)

Definition at line 102 of file storage.cpp.

References readCharUnsafe(), and valid_pos().

Referenced by TraCIServer::dispatchCommand(), readByte(), and readUnsignedByte().

Here is the caller graph for this function:

◆ readCharUnsafe()

unsigned char tcpip::Storage::readCharUnsafe ( )
private

Read a byte without validity check.

Definition at line 410 of file storage.cpp.

References iter_.

Referenced by readByEndianess(), and readChar().

Here is the caller graph for this function:

◆ readDouble()

◆ readDoubleList()

std::vector< double > tcpip::Storage::readDoubleList ( )
virtual

Reads a double list from the array

Returns
The read double list

Definition at line 229 of file storage.cpp.

References readDouble(), and readInt().

Referenced by libtraci::Domain< GET, SET >::getDoubleVector(), and TraCIServer::readTypeCheckingDoubleList().

Here is the caller graph for this function:

◆ readFloat()

float tcpip::Storage::readFloat ( )
virtual

restores a float , which was split up in four bytes acording to the specification, it must have been split by its row byte representation with MSBF-order

Returns
the unspoiled float value

Definition at line 336 of file storage.cpp.

References readByEndianess().

◆ readInt()

int tcpip::Storage::readInt ( )
virtual

restores an integer, which was split up in four bytes acording to the specification, it must have been split by its row byte representation with MSBF-order

Returns
the unspoiled integer value (between -2.147.483.648 and 2.147.483.647)

Definition at line 311 of file storage.cpp.

References readByEndianess().

Referenced by libtraci::Connection::check_commandGetResult(), TraCIAPI::check_commandGetResult(), TraCIServer::dispatchCommand(), libtraci::Domain< GET, SET >::getInt(), libtraci::Domain< GET, SET >::getPolygon(), libtraci::Domain< GET, SET >::getTraCIStage(), TraCIAPI::getVersion(), TraCIServer::initialiseSubscription(), TraCIServerAPI_Vehicle::insertReplaceStop(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_TrafficLight::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_OverheadWire::processSet(), TraCIServerAPI_ParkingArea::processSet(), TraCIServerAPI_Person::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Rerouter::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_RouteProbe::processSet(), TraCIServerAPI_TrafficLight::processSet(), TraCIServerAPI_VariableSpeedSign::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServer::processSingleSubscription(), TraCITestClient::readAndReportTypeDependent(), TraCIServer::readCommandID(), libsumo::StorageHelper::readCompound(), TraCIAPI::readContextSubscription(), libtraci::Connection::readContextSubscription(), readDoubleList(), readString(), readStringList(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingPolygon(), libsumo::StorageHelper::readTypedInt(), libtraci::Connection::readVariables(), TraCIAPI::readVariables(), tcpip::Socket::receiveExact(), TraCIServerAPI_VehicleType::setVariable(), libtraci::Connection::simulationStep(), TraCIAPI::simulationStep(), TraCITestClient::validateSimulationStep2(), and TraCITestClient::validateSubscription().

Here is the caller graph for this function:

◆ readShort()

int tcpip::Storage::readShort ( )
virtual

Restores an integer, which was split up in two bytes according to the specification, it must have been split by its row byte representation with MSBF-order

Returns
the unspoiled integer value (between -32768 and 32767)

Definition at line 280 of file storage.cpp.

References readByEndianess().

◆ readString()

std::string tcpip::Storage::readString ( )
virtual

Reads a string form the array

Returns
The read string

Definition at line 180 of file storage.cpp.

References checkReadSafe(), end(), iter_, and readInt().

Referenced by TraCIServer::addObjectVariableSubscription(), libtraci::Connection::check_commandGetResult(), TraCIAPI::check_commandGetResult(), libtraci::Connection::check_resultState(), TraCIAPI::check_resultState(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCITestClient::commandGetVariable(), TraCIServerAPI_Simulation::commandPositionConversion(), libtraci::Domain< GET, SET >::getString(), TraCIAPI::getVersion(), LIBSUMO_NAMESPACE::BusStop::handleVariable(), LIBSUMO_NAMESPACE::Calibrator::handleVariable(), LIBSUMO_NAMESPACE::ChargingStation::handleVariable(), LIBSUMO_NAMESPACE::Edge::handleVariable(), LIBSUMO_NAMESPACE::InductionLoop::handleVariable(), LIBSUMO_NAMESPACE::Junction::handleVariable(), LIBSUMO_NAMESPACE::Lane::handleVariable(), LIBSUMO_NAMESPACE::LaneArea::handleVariable(), LIBSUMO_NAMESPACE::MeanData::handleVariable(), LIBSUMO_NAMESPACE::MultiEntryExit::handleVariable(), LIBSUMO_NAMESPACE::OverheadWire::handleVariable(), LIBSUMO_NAMESPACE::ParkingArea::handleVariable(), LIBSUMO_NAMESPACE::Person::handleVariable(), LIBSUMO_NAMESPACE::POI::handleVariable(), LIBSUMO_NAMESPACE::Polygon::handleVariable(), LIBSUMO_NAMESPACE::Rerouter::handleVariable(), LIBSUMO_NAMESPACE::Route::handleVariable(), LIBSUMO_NAMESPACE::RouteProbe::handleVariable(), LIBSUMO_NAMESPACE::Simulation::handleVariable(), LIBSUMO_NAMESPACE::TrafficLight::handleVariable(), LIBSUMO_NAMESPACE::VariableSpeedSign::handleVariable(), LIBSUMO_NAMESPACE::Vehicle::handleVariable(), LIBSUMO_NAMESPACE::VehicleType::handleVariableWithID(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_BusStop::processGet(), TraCIServerAPI_Calibrator::processGet(), TraCIServerAPI_ChargingStation::processGet(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_LaneArea::processGet(), TraCIServerAPI_MeanData::processGet(), TraCIServerAPI_MultiEntryExit::processGet(), TraCIServerAPI_OverheadWire::processGet(), TraCIServerAPI_ParkingArea::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Rerouter::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_RouteProbe::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_TrafficLight::processGet(), TraCIServerAPI_VariableSpeedSign::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_BusStop::processSet(), TraCIServerAPI_Calibrator::processSet(), TraCIServerAPI_ChargingStation::processSet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_InductionLoop::processSet(), TraCIServerAPI_Junction::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_LaneArea::processSet(), TraCIServerAPI_MultiEntryExit::processSet(), TraCIServerAPI_OverheadWire::processSet(), TraCIServerAPI_ParkingArea::processSet(), TraCIServerAPI_Person::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Rerouter::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_RouteProbe::processSet(), TraCIServerAPI_Simulation::processSet(), TraCIServerAPI_TrafficLight::processSet(), TraCIServerAPI_VariableSpeedSign::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_VehicleType::processSet(), TraCIServer::processSingleSubscription(), TraCITestClient::readAndReportTypeDependent(), TraCIAPI::readContextSubscription(), libtraci::Connection::readContextSubscription(), readStringList(), TraCIServer::readTypeCheckingString(), libsumo::StorageHelper::readTypedString(), libtraci::Connection::readVariables(), TraCIAPI::readVariables(), TraCIAPI::readVariableSubscription(), libtraci::Connection::readVariableSubscription(), and TraCITestClient::validateSubscription().

◆ readStringList()

std::vector< std::string > tcpip::Storage::readStringList ( )
virtual

Reads a string list form the array

Returns
The read string

Definition at line 211 of file storage.cpp.

References readInt(), and readString().

Referenced by TraCIServer::addSubscriptionFilter(), libtraci::Domain< GET, SET >::getStringVector(), TraCITestClient::readAndReportTypeDependent(), TraCIServer::readTypeCheckingStringList(), and libsumo::StorageHelper::readTypedStringList().

Here is the caller graph for this function:

◆ readUnsignedByte()

int tcpip::Storage::readUnsignedByte ( )
virtual

Reads an unsigned byte form the array

Returns
The read byte (between 0 and 255)

Definition at line 155 of file storage.cpp.

References readChar().

Referenced by TraCIServer::addObjectVariableSubscription(), TraCIServer::addSubscriptionFilter(), libtraci::Connection::check_commandGetResult(), TraCIAPI::check_commandGetResult(), libtraci::Connection::check_resultState(), TraCIAPI::check_resultState(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCITestClient::commandGetVariable(), TraCIServerAPI_Simulation::commandPositionConversion(), libtraci::Domain< GET, SET >::getCol(), libtraci::Domain< GET, SET >::getPolygon(), libtraci::Domain< GET, SET >::getUnsignedByte(), TraCIAPI::getVersion(), LIBSUMO_NAMESPACE::BusStop::handleVariable(), LIBSUMO_NAMESPACE::Calibrator::handleVariable(), LIBSUMO_NAMESPACE::ChargingStation::handleVariable(), LIBSUMO_NAMESPACE::Edge::handleVariable(), LIBSUMO_NAMESPACE::InductionLoop::handleVariable(), LIBSUMO_NAMESPACE::Junction::handleVariable(), LIBSUMO_NAMESPACE::Lane::handleVariable(), LIBSUMO_NAMESPACE::LaneArea::handleVariable(), LIBSUMO_NAMESPACE::MeanData::handleVariable(), LIBSUMO_NAMESPACE::MultiEntryExit::handleVariable(), LIBSUMO_NAMESPACE::OverheadWire::handleVariable(), LIBSUMO_NAMESPACE::ParkingArea::handleVariable(), LIBSUMO_NAMESPACE::Person::handleVariable(), LIBSUMO_NAMESPACE::POI::handleVariable(), LIBSUMO_NAMESPACE::Polygon::handleVariable(), LIBSUMO_NAMESPACE::Rerouter::handleVariable(), LIBSUMO_NAMESPACE::Route::handleVariable(), LIBSUMO_NAMESPACE::RouteProbe::handleVariable(), LIBSUMO_NAMESPACE::Simulation::handleVariable(), LIBSUMO_NAMESPACE::TrafficLight::handleVariable(), LIBSUMO_NAMESPACE::VariableSpeedSign::handleVariable(), LIBSUMO_NAMESPACE::Vehicle::handleVariable(), LIBSUMO_NAMESPACE::VehicleType::handleVariableWithID(), TraCIServerAPI_Vehicle::insertReplaceStop(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_BusStop::processGet(), TraCIServerAPI_Calibrator::processGet(), TraCIServerAPI_ChargingStation::processGet(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_LaneArea::processGet(), TraCIServerAPI_MeanData::processGet(), TraCIServerAPI_MultiEntryExit::processGet(), TraCIServerAPI_OverheadWire::processGet(), TraCIServerAPI_ParkingArea::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Rerouter::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_RouteProbe::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_TrafficLight::processGet(), TraCIServerAPI_VariableSpeedSign::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_BusStop::processSet(), TraCIServerAPI_Calibrator::processSet(), TraCIServerAPI_ChargingStation::processSet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_InductionLoop::processSet(), TraCIServerAPI_Junction::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_LaneArea::processSet(), TraCIServerAPI_MultiEntryExit::processSet(), TraCIServerAPI_OverheadWire::processSet(), TraCIServerAPI_ParkingArea::processSet(), TraCIServerAPI_Person::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Rerouter::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_RouteProbe::processSet(), TraCIServerAPI_Simulation::processSet(), TraCIServerAPI_TrafficLight::processSet(), TraCIServerAPI_VariableSpeedSign::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_VehicleType::processSet(), TraCIServer::processSingleSubscription(), TraCITestClient::readAndReportTypeDependent(), libsumo::StorageHelper::readBool(), TraCIServer::readCommandID(), libsumo::StorageHelper::readCompound(), TraCIAPI::readContextSubscription(), libtraci::Connection::readContextSubscription(), TraCIServer::readTypeCheckingColor(), TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingDoubleList(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingPolygon(), TraCIServer::readTypeCheckingPosition2D(), TraCIServer::readTypeCheckingString(), TraCIServer::readTypeCheckingStringList(), TraCIServer::readTypeCheckingUnsignedByte(), libsumo::StorageHelper::readTypedByte(), libsumo::StorageHelper::readTypedDouble(), libsumo::StorageHelper::readTypedInt(), libsumo::StorageHelper::readTypedString(), libsumo::StorageHelper::readTypedStringList(), libtraci::Connection::readVariables(), TraCIAPI::readVariables(), TraCIAPI::readVariableSubscription(), libtraci::Connection::readVariableSubscription(), TraCIServerAPI_VehicleType::setVariable(), and TraCITestClient::validateSubscription().

◆ reset()

◆ resetPos()

void tcpip::Storage::resetPos ( )

Definition at line 92 of file storage.cpp.

References iter_, and store.

◆ size()

◆ valid_pos()

bool tcpip::Storage::valid_pos ( )
virtual

Definition at line 69 of file storage.cpp.

References iter_, and store.

Referenced by TraCIServer::dispatchCommand(), TraCIServer::initialiseSubscription(), TraCIServer::processCommands(), and readChar().

Here is the caller graph for this function:

◆ writeByEndianess()

void tcpip::Storage::writeByEndianess ( const unsigned char *  begin,
unsigned int  size 
)
private

Write size elements of array begin according to endianess.

Definition at line 419 of file storage.cpp.

References begin(), bigEndian_, end(), iter_, size(), and store.

Referenced by writeDouble(), writeFloat(), writeInt(), and writeShort().

Here is the caller graph for this function:

◆ writeByte()

void tcpip::Storage::writeByte ( int  value)
virtual

Definition at line 140 of file storage.cpp.

References writeChar().

Referenced by TraCIAPI::EdgeScope::adaptTraveltime(), TraCIAPI::VehicleScope::addSubscriptionFilterByteList(), TraCIAPI::VehicleScope::changeLane(), TraCIAPI::VehicleScope::changeLaneRelative(), TraCIAPI::SimulationScope::convert2D(), TraCIAPI::SimulationScope::convert3D(), TraCIAPI::SimulationScope::convertGeo(), TraCIAPI::SimulationScope::convertRoad(), TraCIAPI::SimulationScope::findRoute(), TraCIAPI::EdgeScope::getAdaptedTraveltime(), TraCIAPI::SimulationScope::getDistance2D(), TraCIAPI::SimulationScope::getDistanceRoad(), TraCIAPI::PersonScope::getEdges(), TraCIAPI::EdgeScope::getEffort(), TraCIAPI::VehicleScope::getFollower(), TraCIAPI::VehicleScope::getFollowSpeed(), TraCIAPI::VehicleScope::getLaneChangeState(), TraCIAPI::VehicleScope::getLeader(), TraCIAPI::TraCIScopeWrapper::getParameter(), TraCIAPI::VehicleScope::getSecureGap(), TraCIAPI::TrafficLightScope::getServedPersonCount(), TraCIAPI::PersonScope::getStage(), TraCIAPI::VehicleScope::getStopSpeed(), TraCIServer::initialiseSubscription(), TraCIAPI::PersonScope::moveToXY(), TraCIAPI::VehicleScope::moveToXY(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIAPI::PersonScope::removeStage(), TraCIAPI::GUIScope::screenshot(), TraCIAPI::GUIScope::setBoundary(), TraCIAPI::EdgeScope::setEffort(), TraCIAPI::VehicleScope::setLaneChangeMode(), TraCIAPI::VehicleScope::setSpeedMode(), TraCIAPI::VehicleScope::setStop(), TraCITestClient::setValueTypeDependant(), and libsumo::StorageHelper::writeTypedByte().

Here is the caller graph for this function:

◆ writeChar()

void tcpip::Storage::writeChar ( unsigned char  value)
virtual

Definition at line 116 of file storage.cpp.

References iter_, and store.

Referenced by TraCIServerAPI_Vehicle::processGet(), TraCIServer::processSingleSubscription(), writeByte(), and writeUnsignedByte().

Here is the caller graph for this function:

◆ writeDouble()

void tcpip::Storage::writeDouble ( double  value)
virtual

Definition at line 354 of file storage.cpp.

References writeByEndianess().

Referenced by TraCIAPI::EdgeScope::adaptTraveltime(), TraCIAPI::PersonScope::add(), TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), TraCIAPI::VehicleScope::addSubscriptionFilterFloat(), TraCIAPI::PersonScope::appendStage(), TraCIAPI::PersonScope::appendWaitingStage(), TraCIAPI::PersonScope::appendWalkingStage(), TraCIAPI::VehicleScope::changeLane(), TraCIAPI::VehicleScope::changeLaneRelative(), TraCIAPI::VehicleScope::changeSublane(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIAPI::SimulationScope::convert2D(), TraCIAPI::SimulationScope::convert3D(), TraCIAPI::SimulationScope::convertGeo(), TraCIAPI::SimulationScope::convertRoad(), TraCIAPI::SimulationScope::findRoute(), TraCIAPI::EdgeScope::getAdaptedTraveltime(), TraCIAPI::SimulationScope::getDistance2D(), TraCIAPI::SimulationScope::getDistanceRoad(), TraCIAPI::EdgeScope::getEffort(), TraCIAPI::VehicleScope::getFollower(), TraCIAPI::VehicleScope::getFollowSpeed(), TraCIAPI::VehicleScope::getLeader(), TraCIAPI::VehicleScope::getSecureGap(), TraCIAPI::VehicleScope::getStopSpeed(), TraCIAPI::PersonScope::moveTo(), TraCIAPI::VehicleScope::moveTo(), TraCIAPI::PersonScope::moveToXY(), TraCIAPI::VehicleScope::moveToXY(), TraCIAPI::VehicleScope::openGap(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIAPI::send_commandSimulationStep(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), TraCIAPI::VehicleTypeScope::setAccel(), TraCIAPI::VehicleScope::setAcceleration(), TraCIAPI::VehicleTypeScope::setApparentDecel(), TraCIAPI::GUIScope::setBoundary(), TraCIAPI::VehicleTypeScope::setDecel(), libtraci::Domain< GET, SET >::setDouble(), TraCIAPI::TraCIScopeWrapper::setDouble(), TraCIAPI::EdgeScope::setEffort(), TraCIAPI::VehicleTypeScope::setEmergencyDecel(), TraCIAPI::PersonScope::setHeight(), TraCIAPI::VehicleTypeScope::setHeight(), TraCIAPI::VehicleTypeScope::setImperfection(), TraCIAPI::PersonScope::setLength(), TraCIAPI::VehicleTypeScope::setLength(), TraCIAPI::PolygonScope::setLineWidth(), TraCIAPI::VehicleTypeScope::setMaxSpeed(), TraCIAPI::VehicleScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMaxSpeedLat(), TraCIAPI::PersonScope::setMinGap(), TraCIAPI::VehicleTypeScope::setMinGap(), TraCIAPI::VehicleScope::setMinGap(), TraCIAPI::VehicleTypeScope::setMinGapLat(), TraCIAPI::GUIScope::setOffset(), TraCIAPI::TrafficLightScope::setPhaseDuration(), TraCIAPI::POIScope::setPosition(), TraCIAPI::VehicleScope::setPreviousSpeed(), TraCIAPI::TrafficLightScope::setProgramLogic(), TraCIAPI::PolygonScope::setShape(), TraCIAPI::PersonScope::setSpeed(), TraCIAPI::VehicleScope::setSpeed(), TraCIAPI::VehicleTypeScope::setSpeedDeviation(), TraCIAPI::PersonScope::setSpeedFactor(), TraCIAPI::VehicleTypeScope::setSpeedFactor(), TraCIAPI::VehicleScope::setSpeedFactor(), TraCIAPI::VehicleScope::setStop(), TraCIAPI::VehicleTypeScope::setTau(), TraCITestClient::setValueTypeDependant(), TraCIAPI::PersonScope::setWidth(), TraCIAPI::VehicleTypeScope::setWidth(), libtraci::Connection::simulationStep(), TraCIAPI::VehicleScope::slowDown(), libtraci::Connection::subscribe(), TraCIServer::wrapDouble(), TraCIServer::wrapPosition(), TraCIServer::wrapPositionVector(), TraCIServer::wrapStringDoublePair(), writeDoubleList(), TraCIServerAPI_Vehicle::writeNextStops(), libsumo::StorageHelper::writePolygon(), TraCIServer::writePositionVector(), and libsumo::StorageHelper::writeTypedDouble().

◆ writeDoubleList()

void tcpip::Storage::writeDoubleList ( const std::vector< double > &  s)
virtual

Writes a double list into the array;

Parameters
sThe double list to be written

Definition at line 262 of file storage.cpp.

References writeDouble(), and writeInt().

Referenced by TraCIServer::wrapDoubleList().

Here is the caller graph for this function:

◆ writeFloat()

void tcpip::Storage::writeFloat ( float  value)
virtual

Definition at line 346 of file storage.cpp.

References writeByEndianess().

◆ writeInt()

void tcpip::Storage::writeInt ( int  value)
virtual

Definition at line 321 of file storage.cpp.

References writeByEndianess().

Referenced by TraCIAPI::EdgeScope::adaptTraveltime(), TraCIAPI::PersonScope::add(), TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), TraCIAPI::VehicleScope::add(), TraCIAPI::PersonScope::appendDrivingStage(), TraCIAPI::PersonScope::appendStage(), TraCIAPI::PersonScope::appendWaitingStage(), TraCIAPI::PersonScope::appendWalkingStage(), TraCIAPI::VehicleScope::changeLane(), TraCIAPI::VehicleScope::changeLaneRelative(), TraCIServer::commandGetVersion(), TraCIAPI::SimulationScope::convert2D(), TraCIAPI::SimulationScope::convert3D(), TraCIAPI::SimulationScope::convertGeo(), TraCIAPI::SimulationScope::convertRoad(), TraCIAPI::createCommand(), libtraci::Connection::createCommand(), TraCIAPI::createFilterCommand(), TraCIAPI::SimulationScope::findRoute(), TraCIAPI::SimulationScope::getDistance2D(), TraCIAPI::SimulationScope::getDistanceRoad(), TraCIAPI::PersonScope::getEdges(), TraCIAPI::VehicleScope::getFollowSpeed(), TraCIAPI::VehicleScope::getLaneChangeState(), TraCIAPI::VehicleScope::getSecureGap(), TraCIAPI::TrafficLightScope::getServedPersonCount(), TraCIAPI::PersonScope::getStage(), TraCIAPI::VehicleScope::getStopSpeed(), TraCIServer::initialiseSubscription(), TraCIAPI::load(), TraCIAPI::PersonScope::moveTo(), TraCIAPI::VehicleScope::moveTo(), TraCIAPI::PersonScope::moveToXY(), TraCIAPI::VehicleScope::moveToXY(), TraCIAPI::VehicleScope::openGap(), TraCIServer::openSocket(), TraCIServer::postProcessSimulationStep(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_TrafficLight::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServer::processSingleSubscription(), TraCIAPI::POIScope::remove(), TraCIAPI::PolygonScope::remove(), TraCIAPI::PersonScope::removeStage(), TraCIAPI::PersonScope::rerouteTraveltime(), TraCIAPI::VehicleScope::rerouteTraveltime(), TraCIAPI::GUIScope::screenshot(), TraCIAPI::send_commandSetOrder(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), tcpip::Socket::sendExact(), TraCIAPI::VehicleScope::setAcceleration(), TraCIAPI::EdgeScope::setEffort(), libtraci::Domain< GET, SET >::setInt(), TraCIAPI::TraCIScopeWrapper::setInt(), TraCIAPI::VehicleScope::setLaneChangeMode(), libtraci::Connection::setOrder(), TraCIAPI::setOrder(), TraCIAPI::TraCIScopeWrapper::setParameter(), TraCIAPI::TrafficLightScope::setPhase(), TraCIAPI::VehicleScope::setPreviousSpeed(), TraCIAPI::TrafficLightScope::setProgramLogic(), TraCIAPI::VehicleScope::setRoute(), TraCIAPI::VehicleScope::setRoutingMode(), TraCIAPI::PolygonScope::setShape(), TraCIAPI::VehicleScope::setSignals(), TraCIAPI::VehicleScope::setSpeedMode(), TraCIAPI::VehicleScope::setStop(), TraCIAPI::TraCIScopeWrapper::setStringVector(), TraCITestClient::setValueTypeDependant(), TraCIAPI::VehicleScope::setVia(), TraCIAPI::VehicleScope::slowDown(), libtraci::Connection::subscribe(), TraCIServer::wrapInt(), TraCIServer::wrapPositionVector(), TraCIServer::wrapStringDoublePair(), TraCIServer::wrapStringPair(), libsumo::StorageHelper::writeCompound(), writeDoubleList(), TraCIServerAPI_Vehicle::writeNextStops(), libsumo::StorageHelper::writePolygon(), TraCIServer::writePositionVector(), TraCIServer::writeResponseWithLength(), libsumo::StorageHelper::writeStage(), writeString(), writeStringList(), TraCIServerAPI_Simulation::writeTransportableStateNumber(), libsumo::StorageHelper::writeTypedInt(), and TraCIServerAPI_Simulation::writeVehicleStateNumber().

◆ writePacket() [1/2]

void tcpip::Storage::writePacket ( const std::vector< unsigned char > &  packet)
virtual

Definition at line 380 of file storage.cpp.

References iter_, and store.

◆ writePacket() [2/2]

void tcpip::Storage::writePacket ( unsigned char *  packet,
int  length 
)
virtual

Definition at line 372 of file storage.cpp.

References iter_, and store.

Referenced by tcpip::Socket::receiveExact().

Here is the caller graph for this function:

◆ writeShort()

void tcpip::Storage::writeShort ( int  value)
virtual

Definition at line 290 of file storage.cpp.

References writeByEndianess().

◆ writeStorage()

◆ writeString()

void tcpip::Storage::writeString ( const std::string &  s)
virtual

Writes a string into the array;

Parameters
sThe string to be written

Definition at line 197 of file storage.cpp.

References iter_, store, and writeInt().

Referenced by TraCIAPI::PersonScope::add(), TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), TraCIAPI::VehicleScope::add(), TraCIAPI::PersonScope::appendDrivingStage(), TraCIAPI::PersonScope::appendStage(), TraCIAPI::PersonScope::appendWaitingStage(), TraCIAPI::PersonScope::appendWalkingStage(), TraCIAPI::VehicleScope::changeTarget(), TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIAPI::SimulationScope::convert2D(), TraCIAPI::SimulationScope::convert3D(), TraCIAPI::SimulationScope::convertRoad(), TraCIAPI::VehicleTypeScope::copy(), TraCIAPI::createCommand(), libtraci::Connection::createCommand(), TraCIAPI::SimulationScope::findRoute(), TraCIAPI::SimulationScope::getDistanceRoad(), TraCIAPI::LaneScope::getFoes(), TraCIAPI::VehicleScope::getFollowSpeed(), TraCIAPI::TraCIScopeWrapper::getParameter(), TraCIAPI::TraCIScopeWrapper::getParameterWithKey(), TraCIAPI::VehicleScope::getSecureGap(), TraCIServer::initWrapper(), TraCIAPI::SimulationScope::loadState(), TraCIAPI::PersonScope::moveTo(), TraCIAPI::VehicleScope::moveTo(), TraCIAPI::PersonScope::moveToXY(), TraCIAPI::VehicleScope::moveToXY(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_TrafficLight::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServer::processSingleSubscription(), TraCIAPI::SimulationScope::saveState(), TraCIAPI::GUIScope::screenshot(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), TraCIAPI::VehicleTypeScope::setEmissionClass(), TraCIAPI::VehicleScope::setEmissionClass(), TraCIAPI::VehicleTypeScope::setLateralAlignment(), TraCIAPI::VehicleScope::setLine(), TraCIAPI::TraCIScopeWrapper::setParameter(), TraCIAPI::TrafficLightScope::setPhaseName(), TraCIAPI::TrafficLightScope::setProgram(), TraCIAPI::TrafficLightScope::setProgramLogic(), TraCIAPI::TrafficLightScope::setRedYellowGreenState(), TraCIAPI::VehicleScope::setRoute(), TraCIAPI::VehicleScope::setRouteID(), TraCIAPI::VehicleTypeScope::setShapeClass(), TraCIAPI::VehicleScope::setShapeClass(), TraCIAPI::VehicleScope::setStop(), libtraci::Domain< GET, SET >::setString(), TraCIAPI::TraCIScopeWrapper::setString(), TraCIAPI::TraCIScopeWrapper::setStringVector(), TraCIAPI::PersonScope::setType(), TraCIAPI::PolygonScope::setType(), TraCIAPI::VehicleScope::setType(), TraCITestClient::setValueTypeDependant(), TraCIAPI::VehicleTypeScope::setVehicleClass(), TraCIAPI::VehicleScope::setVia(), libtraci::Connection::subscribe(), TraCIServer::wrapString(), TraCIServer::wrapStringDoublePair(), TraCIServer::wrapStringPair(), TraCIAPI::SimulationScope::writeMessage(), TraCIServerAPI_Vehicle::writeNextStops(), TraCIServer::writeStatusCmd(), writeStringList(), and libsumo::StorageHelper::writeTypedString().

◆ writeStringList()

◆ writeUnsignedByte()

void tcpip::Storage::writeUnsignedByte ( int  value)
virtual

Definition at line 165 of file storage.cpp.

References writeChar().

Referenced by TraCIAPI::PersonScope::add(), TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), TraCIAPI::RouteScope::add(), TraCIAPI::VehicleScope::add(), TraCIAPI::VehicleScope::addSubscriptionFilterByteList(), TraCIAPI::VehicleScope::addSubscriptionFilterFloat(), TraCIAPI::VehicleScope::addSubscriptionFilterStringList(), TraCIAPI::PersonScope::appendDrivingStage(), TraCIAPI::PersonScope::appendStage(), TraCIAPI::PersonScope::appendWaitingStage(), TraCIAPI::PersonScope::appendWalkingStage(), TraCIAPI::VehicleScope::changeLane(), TraCIAPI::VehicleScope::changeLaneRelative(), TraCIAPI::VehicleScope::changeSublane(), TraCIAPI::VehicleScope::changeTarget(), TraCIServer::checkClientOrdering(), libtraci::Connection::close(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIAPI::VehicleTypeScope::copy(), TraCIAPI::createCommand(), libtraci::Connection::createCommand(), TraCIAPI::createFilterCommand(), TraCIAPI::SimulationScope::findRoute(), TraCIAPI::LaneScope::getFoes(), TraCIAPI::VehicleScope::getFollowSpeed(), TraCIAPI::TraCIScopeWrapper::getParameterWithKey(), TraCIAPI::VehicleScope::getSecureGap(), TraCIAPI::VehicleScope::getStopSpeed(), TraCIAPI::getVersion(), TraCIServer::initWrapper(), TraCIAPI::load(), TraCIAPI::SimulationScope::loadState(), TraCIAPI::PersonScope::moveTo(), TraCIAPI::VehicleScope::moveTo(), TraCIAPI::PersonScope::moveToXY(), TraCIAPI::VehicleScope::moveToXY(), TraCIAPI::VehicleScope::openGap(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_TrafficLight::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServer::processSingleSubscription(), TraCIAPI::POIScope::remove(), TraCIAPI::PolygonScope::remove(), TraCIAPI::VehicleScope::remove(), TraCIAPI::PersonScope::rerouteTraveltime(), TraCIAPI::VehicleScope::rerouteTraveltime(), TraCIAPI::SimulationScope::saveState(), TraCIAPI::send_commandClose(), TraCIAPI::send_commandSetOrder(), TraCIAPI::send_commandSimulationStep(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), TraCIAPI::VehicleTypeScope::setAccel(), TraCIAPI::VehicleScope::setAcceleration(), TraCIAPI::VehicleTypeScope::setApparentDecel(), TraCIAPI::GUIScope::setBoundary(), libtraci::Domain< GET, SET >::setCol(), TraCIAPI::PersonScope::setColor(), TraCIAPI::POIScope::setColor(), TraCIAPI::PolygonScope::setColor(), TraCIAPI::VehicleTypeScope::setColor(), TraCIAPI::VehicleScope::setColor(), TraCIAPI::VehicleTypeScope::setDecel(), libtraci::Domain< GET, SET >::setDouble(), TraCIAPI::TraCIScopeWrapper::setDouble(), TraCIAPI::VehicleTypeScope::setEmergencyDecel(), TraCIAPI::VehicleTypeScope::setEmissionClass(), TraCIAPI::VehicleScope::setEmissionClass(), TraCIAPI::PersonScope::setHeight(), TraCIAPI::VehicleTypeScope::setHeight(), TraCIAPI::VehicleTypeScope::setImperfection(), libtraci::Domain< GET, SET >::setInt(), TraCIAPI::TraCIScopeWrapper::setInt(), TraCIAPI::VehicleTypeScope::setLateralAlignment(), TraCIAPI::PersonScope::setLength(), TraCIAPI::VehicleTypeScope::setLength(), TraCIAPI::VehicleScope::setLine(), TraCIAPI::PolygonScope::setLineWidth(), TraCIAPI::VehicleTypeScope::setMaxSpeed(), TraCIAPI::VehicleScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMaxSpeedLat(), TraCIAPI::PersonScope::setMinGap(), TraCIAPI::VehicleTypeScope::setMinGap(), TraCIAPI::VehicleScope::setMinGap(), TraCIAPI::VehicleTypeScope::setMinGapLat(), TraCIAPI::GUIScope::setOffset(), libtraci::Connection::setOrder(), TraCIAPI::setOrder(), TraCIAPI::TraCIScopeWrapper::setParameter(), TraCIAPI::TrafficLightScope::setPhase(), TraCIAPI::TrafficLightScope::setPhaseDuration(), TraCIAPI::TrafficLightScope::setPhaseName(), TraCIAPI::POIScope::setPosition(), TraCIAPI::VehicleScope::setPreviousSpeed(), TraCIAPI::TrafficLightScope::setProgram(), TraCIAPI::TrafficLightScope::setProgramLogic(), TraCIAPI::TrafficLightScope::setRedYellowGreenState(), TraCIAPI::VehicleScope::setRoute(), TraCIAPI::VehicleScope::setRouteID(), TraCIAPI::VehicleScope::setRoutingMode(), TraCIAPI::PolygonScope::setShape(), TraCIAPI::VehicleTypeScope::setShapeClass(), TraCIAPI::VehicleScope::setShapeClass(), TraCIAPI::VehicleScope::setSignals(), TraCIAPI::PersonScope::setSpeed(), TraCIAPI::VehicleScope::setSpeed(), TraCIAPI::VehicleTypeScope::setSpeedDeviation(), TraCIAPI::PersonScope::setSpeedFactor(), TraCIAPI::VehicleTypeScope::setSpeedFactor(), TraCIAPI::VehicleScope::setSpeedFactor(), TraCIAPI::VehicleScope::setStop(), libtraci::Domain< GET, SET >::setString(), TraCIAPI::TraCIScopeWrapper::setString(), libtraci::Domain< GET, SET >::setStringVector(), TraCIAPI::TraCIScopeWrapper::setStringVector(), TraCIAPI::VehicleTypeScope::setTau(), TraCIAPI::PersonScope::setType(), TraCIAPI::PolygonScope::setType(), TraCIAPI::VehicleScope::setType(), TraCITestClient::setValueTypeDependant(), TraCIAPI::VehicleTypeScope::setVehicleClass(), TraCIAPI::VehicleScope::setVia(), TraCIAPI::PersonScope::setWidth(), TraCIAPI::VehicleTypeScope::setWidth(), libtraci::Connection::simulationStep(), TraCIAPI::VehicleScope::slowDown(), libtraci::Connection::subscribe(), TraCIServer::wrapColor(), TraCIServer::wrapDouble(), TraCIServer::wrapDoubleList(), TraCIServer::wrapInt(), TraCIServer::wrapPosition(), TraCIServer::wrapPositionVector(), TraCIServer::wrapString(), TraCIServer::wrapStringDoublePair(), TraCIServer::wrapStringList(), TraCIServer::wrapStringPair(), libsumo::StorageHelper::writeCompound(), TraCIAPI::SimulationScope::writeMessage(), TraCIServerAPI_Vehicle::writeNextStops(), libsumo::StorageHelper::writePolygon(), TraCIServer::writePositionVector(), TraCIServer::writeResponseWithLength(), libsumo::StorageHelper::writeStage(), TraCIServer::writeStatusCmd(), TraCIServerAPI_Simulation::writeTransportableStateIDs(), TraCIServerAPI_Simulation::writeTransportableStateNumber(), libsumo::StorageHelper::writeTypedByte(), libsumo::StorageHelper::writeTypedDouble(), libsumo::StorageHelper::writeTypedInt(), libsumo::StorageHelper::writeTypedString(), libsumo::StorageHelper::writeTypedStringList(), TraCIServerAPI_Simulation::writeVehicleStateIDs(), and TraCIServerAPI_Simulation::writeVehicleStateNumber().

Field Documentation

◆ bigEndian_

bool tcpip::Storage::bigEndian_
private

Definition at line 48 of file storage.h.

Referenced by init(), readByEndianess(), and writeByEndianess().

◆ iter_

StorageType::const_iterator tcpip::Storage::iter_
private

◆ store


The documentation for this class was generated from the following files: