SUMO - Simulation of Urban MObility
|
#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... | |
virtual unsigned int | position () const |
virtual int | readByte () throw (std::invalid_argument) |
virtual unsigned char | readChar () throw (std::invalid_argument) |
virtual double | readDouble () throw (std::invalid_argument) |
virtual float | readFloat () throw (std::invalid_argument) |
virtual int | readInt () throw (std::invalid_argument) |
virtual int | readShort () throw (std::invalid_argument) |
virtual std::string | readString () throw (std::invalid_argument) |
virtual std::vector< std::string > | readStringList () throw (std::invalid_argument) |
virtual int | readUnsignedByte () throw (std::invalid_argument) |
void | reset () |
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) throw (std::invalid_argument) |
virtual void | writeChar (unsigned char) throw () |
virtual void | writeDouble (double) throw () |
virtual void | writeFloat (float) throw () |
virtual void | writeInt (int) throw () |
virtual void | writePacket (unsigned char *packet, int length) |
virtual void | writePacket (const std::vector< unsigned char > &packet) |
virtual void | writeShort (int) throw (std::invalid_argument) |
virtual void | writeStorage (tcpip::Storage &store) |
virtual void | writeString (const std::string &s) throw () |
virtual void | writeStringList (const std::vector< std::string > &s) throw () |
virtual void | writeUnsignedByte (int) throw (std::invalid_argument) |
virtual | ~Storage () |
Private Member Functions | |
void | checkReadSafe (unsigned int num) const throw (std::invalid_argument) |
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 |
typedef std::vector<unsigned char> tcpip::Storage::StorageType |
tcpip::Storage::Storage | ( | ) |
Standard Constructor.
tcpip::Storage::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.
|
virtual |
|
inline |
Definition at line 117 of file storage.h.
References store.
Referenced by tcpip::Socket::sendExact().
|
private |
Check if the next num
bytes can be read safely.
|
inline |
Definition at line 118 of file storage.h.
References store.
Referenced by tcpip::Socket::sendExact().
std::string tcpip::Storage::hexDump | ( | ) | const |
Dump storage content as series of hex values.
|
private |
Used in constructors to initialize local variables.
|
virtual |
|
private |
Read size
elements into array
according to endianess.
|
virtual |
|
virtual |
Referenced by traci::TraCIServer::dispatchCommand().
|
private |
Read a byte without validity check.
|
virtual |
Referenced by traci::TraCIServer::addObjectContextSubscription(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIAPI::getBoundingBox(), TraCIAPI::getDouble(), TraCIAPI::getPolygon(), TraCIAPI::getPosition(), testclient::TraCITestClient::readAndReportTypeDependent(), traci::TraCIServer::readTypeCheckingBoundary(), traci::TraCIServer::readTypeCheckingDouble(), traci::TraCIServer::readTypeCheckingPolygon(), and traci::TraCIServer::readTypeCheckingPosition2D().
|
virtual |
|
virtual |
Referenced by traci::TraCIServer::addObjectContextSubscription(), traci::TraCIServer::addObjectVariableSubscription(), TraCIAPI::check_commandGetResult(), TraCIServerAPI_Vehicle::commandDistanceRequest(), traci::TraCIServer::dispatchCommand(), TraCIAPI::TrafficLightScope::getCompleteRedYellowGreenDefinition(), TraCIAPI::TrafficLightScope::getControlledLinks(), TraCIAPI::getInt(), TraCIAPI::getPolygon(), TraCIAPI::getStringVector(), TraCIAPI::getSUMOTime(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Vehicle::processSet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::readAndReportTypeDependent(), traci::TraCIServer::readTypeCheckingInt(), tcpip::Socket::receiveExact(), testclient::TraCITestClient::validateSimulationStep2(), and testclient::TraCITestClient::validateSubscription().
|
virtual |
|
virtual |
Referenced by traci::TraCIServer::addObjectContextSubscription(), traci::TraCIServer::addObjectVariableSubscription(), TraCIAPI::check_resultState(), traci::TraCIServer::commandAddVehicle(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIAPI::TrafficLightScope::getCompleteRedYellowGreenDefinition(), TraCIAPI::TrafficLightScope::getControlledLinks(), TraCIAPI::getString(), TraCIAPI::getStringVector(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_VehicleType::processSet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::readAndReportTypeDependent(), traci::TraCIServer::readTypeCheckingString(), and testclient::TraCITestClient::validateSubscription().
|
virtual |
|
virtual |
Referenced by traci::TraCIServer::addObjectContextSubscription(), traci::TraCIServer::addObjectVariableSubscription(), TraCIAPI::check_commandGetResult(), TraCIAPI::check_resultState(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), TraCIServerAPI_Simulation::commandPositionConversion(), traci::TraCIServer::dispatchCommand(), TraCIAPI::getColor(), TraCIAPI::TrafficLightScope::getCompleteRedYellowGreenDefinition(), TraCIAPI::TrafficLightScope::getControlledLinks(), TraCIAPI::getUnsignedByte(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_VehicleType::processSet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::readAndReportTypeDependent(), traci::TraCIServer::readTypeCheckingBoundary(), traci::TraCIServer::readTypeCheckingByte(), traci::TraCIServer::readTypeCheckingColor(), traci::TraCIServer::readTypeCheckingDouble(), traci::TraCIServer::readTypeCheckingInt(), traci::TraCIServer::readTypeCheckingPolygon(), traci::TraCIServer::readTypeCheckingPosition2D(), traci::TraCIServer::readTypeCheckingString(), traci::TraCIServer::readTypeCheckingStringList(), traci::TraCIServer::readTypeCheckingUnsignedByte(), and testclient::TraCITestClient::validateSubscription().
void tcpip::Storage::reset | ( | ) |
Referenced by traci::TraCIServer::processCommandsUntilSimStep().
|
inline |
Definition at line 115 of file storage.h.
Referenced by traci::TraCIServer::commandGetVersion(), traci::TraCIServer::processCommandsUntilSimStep(), traci::TraCIServer::processSingleSubscription(), TraCIAPI::send_commandGetVariable(), TraCIAPI::send_commandSetValue(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), and traci::TraCIServer::writeResponseWithLength().
|
virtual |
|
private |
Write size
elements of array begin
according to endianess.
|
virtual |
|
virtual |
|
virtual |
Referenced by TraCIAPI::EdgeScope::adaptTraveltime(), TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIServerAPI_VehicleType::getVariable(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::VehicleTypeScope::setAccel(), TraCIAPI::GUIScope::setBoundary(), TraCIAPI::VehicleTypeScope::setDecel(), TraCIAPI::EdgeScope::setEffort(), TraCIAPI::VehicleTypeScope::setImperfection(), TraCIAPI::LaneScope::setLength(), TraCIAPI::VehicleTypeScope::setLength(), TraCIAPI::EdgeScope::setMaxSpeed(), TraCIAPI::LaneScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMinGap(), TraCIAPI::GUIScope::setOffset(), TraCIAPI::POIScope::setPosition(), TraCIAPI::PolygonScope::setShape(), TraCIAPI::VehicleTypeScope::setSpeedDeviation(), TraCIAPI::VehicleTypeScope::setSpeedFactor(), TraCIAPI::VehicleTypeScope::setTau(), testclient::TraCITestClient::setValueTypeDependant(), TraCIAPI::VehicleTypeScope::setWidth(), and TraCIAPI::GUIScope::setZoom().
|
virtual |
Referenced by testclient::TraCITestClient::setValueTypeDependant().
|
virtual |
Referenced by TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), traci::TraCIServer::commandGetVersion(), TraCIAPI::EdgeScope::getAdaptedTraveltime(), TraCIAPI::EdgeScope::getEffort(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), traci::TraCIServer::processSingleSubscription(), TraCIAPI::POIScope::remove(), TraCIAPI::PolygonScope::remove(), TraCIAPI::send_commandSimulationStep(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), tcpip::Socket::sendExact(), TraCIAPI::LaneScope::setAllowed(), TraCIAPI::TrafficLightScope::setCompleteRedYellowGreenDefinition(), TraCIAPI::LaneScope::setDisallowed(), TraCIAPI::TrafficLightScope::setPhase(), TraCIAPI::TrafficLightScope::setPhaseDuration(), TraCIAPI::PolygonScope::setShape(), testclient::TraCITestClient::setValueTypeDependant(), and traci::TraCIServer::writeResponseWithLength().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Referenced by traci::TraCIServer::commandGetVersion(), traci::TraCIServer::initialiseSubscription(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), traci::TraCIServer::processSingleSubscription(), TraCIAPI::send_commandGetVariable(), TraCIAPI::send_commandSetValue(), and traci::TraCIServer::writeResponseWithLength().
|
virtual |
Referenced by TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), traci::TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIServerAPI_VehicleType::getVariable(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), traci::TraCIServer::processSingleSubscription(), TraCIAPI::GUIScope::screenshot(), TraCIAPI::send_commandGetVariable(), TraCIAPI::send_commandSetValue(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), TraCIAPI::LaneScope::setAllowed(), TraCIAPI::TrafficLightScope::setCompleteRedYellowGreenDefinition(), TraCIAPI::LaneScope::setDisallowed(), TraCIAPI::VehicleTypeScope::setEmissionClass(), TraCIAPI::TrafficLightScope::setProgram(), TraCIAPI::TrafficLightScope::setRedYellowGreenState(), TraCIAPI::GUIScope::setSchema(), TraCIAPI::VehicleTypeScope::setShapeClass(), TraCIAPI::POIScope::setType(), TraCIAPI::PolygonScope::setType(), testclient::TraCITestClient::setValueTypeDependant(), TraCIAPI::VehicleTypeScope::setVehicleClass(), TraCIAPI::GUIScope::trackVehicle(), and traci::TraCIServer::writeStatusCmd().
|
virtual |
Referenced by TraCIAPI::RouteScope::add(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), and testclient::TraCITestClient::setValueTypeDependant().
|
virtual |
Referenced by TraCIAPI::POIScope::add(), TraCIAPI::PolygonScope::add(), TraCIAPI::RouteScope::add(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), traci::TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIServerAPI_VehicleType::getVariable(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), traci::TraCIServer::processSingleSubscription(), TraCIAPI::POIScope::remove(), TraCIAPI::PolygonScope::remove(), TraCIAPI::send_commandClose(), TraCIAPI::send_commandGetVariable(), TraCIAPI::send_commandSetValue(), TraCIAPI::send_commandSimulationStep(), TraCIAPI::send_commandSubscribeObjectContext(), TraCIAPI::send_commandSubscribeObjectVariable(), TraCIAPI::VehicleTypeScope::setAccel(), TraCIAPI::LaneScope::setAllowed(), TraCIAPI::GUIScope::setBoundary(), TraCIAPI::POIScope::setColor(), TraCIAPI::PolygonScope::setColor(), TraCIAPI::VehicleTypeScope::setColor(), TraCIAPI::TrafficLightScope::setCompleteRedYellowGreenDefinition(), TraCIAPI::VehicleTypeScope::setDecel(), TraCIAPI::LaneScope::setDisallowed(), TraCIAPI::VehicleTypeScope::setEmissionClass(), TraCIAPI::VehicleTypeScope::setImperfection(), TraCIAPI::LaneScope::setLength(), TraCIAPI::VehicleTypeScope::setLength(), TraCIAPI::LaneScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMaxSpeed(), TraCIAPI::VehicleTypeScope::setMinGap(), TraCIAPI::GUIScope::setOffset(), TraCIAPI::TrafficLightScope::setPhase(), TraCIAPI::TrafficLightScope::setPhaseDuration(), TraCIAPI::POIScope::setPosition(), TraCIAPI::TrafficLightScope::setProgram(), TraCIAPI::TrafficLightScope::setRedYellowGreenState(), TraCIAPI::PolygonScope::setShape(), TraCIAPI::VehicleTypeScope::setShapeClass(), TraCIAPI::VehicleTypeScope::setSpeedDeviation(), TraCIAPI::VehicleTypeScope::setSpeedFactor(), TraCIAPI::VehicleTypeScope::setTau(), TraCIAPI::POIScope::setType(), TraCIAPI::PolygonScope::setType(), testclient::TraCITestClient::setValueTypeDependant(), TraCIAPI::VehicleTypeScope::setVehicleClass(), TraCIAPI::VehicleTypeScope::setWidth(), traci::TraCIServer::writeResponseWithLength(), and traci::TraCIServer::writeStatusCmd().
|
private |