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. | |
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. | |
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 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. | |
void | init () |
Used in constructors to initialize local variables. | |
void | readByEndianess (unsigned char *array, int size) |
Read size elements into array according to endianess. | |
unsigned char | readCharUnsafe () |
Read a byte without validity check. | |
void | writeByEndianess (const unsigned char *begin, unsigned int size) |
Write size elements of array begin according to endianess. | |
Private Attributes | |
bool | bigEndian_ |
StorageType::const_iterator | iter_ |
StorageType | store |
typedef std::vector<unsigned char> tcpip::Storage::StorageType |
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 tcpip::Storage::~Storage | ( | ) | [virtual] |
StorageType::const_iterator tcpip::Storage::begin | ( | ) | const [inline] |
Definition at line 117 of file storage.h.
References store.
Referenced by tcpip::Socket::sendExact().
void tcpip::Storage::checkReadSafe | ( | unsigned int | num | ) | const throw (std::invalid_argument) [private] |
Check if the next num
bytes can be read safely.
StorageType::const_iterator tcpip::Storage::end | ( | ) | const [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.
void tcpip::Storage::init | ( | ) | [private] |
Used in constructors to initialize local variables.
virtual unsigned int tcpip::Storage::position | ( | ) | const [virtual] |
Referenced by testclient::TraCITestClient::commandGetVariable(), testclient::TraCITestClient::commandGetVariablePlus(), traci::TraCIServer::dispatchCommand(), testclient::TraCITestClient::reportResultState(), testclient::TraCITestClient::validateDistanceRequest(), testclient::TraCITestClient::validatePositionConversion(), and testclient::TraCITestClient::validateSubscription().
void tcpip::Storage::readByEndianess | ( | unsigned char * | array, |
int | size | ||
) | [private] |
Read size
elements into array
according to endianess.
virtual int tcpip::Storage::readByte | ( | ) | throw (std::invalid_argument) [virtual] |
virtual unsigned char tcpip::Storage::readChar | ( | ) | throw (std::invalid_argument) [virtual] |
Referenced by traci::TraCIServer::dispatchCommand().
unsigned char tcpip::Storage::readCharUnsafe | ( | ) | [private] |
Read a byte without validity check.
virtual double tcpip::Storage::readDouble | ( | ) | throw (std::invalid_argument) [virtual] |
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Vehicle::processSet(), testclient::TraCITestClient::readAndReportTypeDependent(), TraCIServerAPI_VehicleType::setVariable(), testclient::TraCITestClient::validateDistanceRequest(), and testclient::TraCITestClient::validatePositionConversion().
virtual float tcpip::Storage::readFloat | ( | ) | throw (std::invalid_argument) [virtual] |
virtual int tcpip::Storage::readInt | ( | ) | throw (std::invalid_argument) [virtual] |
Referenced by traci::TraCIServer::addSubscription(), TraCIServerAPI_Vehicle::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), testclient::TraCITestClient::commandGetVariablePlus(), traci::TraCIServer::dispatchCommand(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Vehicle::processSet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::readAndReportTypeDependent(), tcpip::Socket::receiveExact(), testclient::TraCITestClient::validateSimulationStep2(), and testclient::TraCITestClient::validateSubscription().
virtual int tcpip::Storage::readShort | ( | ) | throw (std::invalid_argument) [virtual] |
virtual std::string tcpip::Storage::readString | ( | ) | throw (std::invalid_argument) [virtual] |
Referenced by traci::TraCIServer::addSubscription(), traci::TraCIServer::commandAddVehicle(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), testclient::TraCITestClient::commandGetVariablePlus(), TraCIServerAPI_Simulation::commandPositionConversion(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_VehicleType::processSet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::readAndReportTypeDependent(), testclient::TraCITestClient::reportResultState(), TraCIServerAPI_VehicleType::setVariable(), testclient::TraCITestClient::validatePositionConversion(), and testclient::TraCITestClient::validateSubscription().
virtual std::vector<std::string> tcpip::Storage::readStringList | ( | ) | throw (std::invalid_argument) [virtual] |
virtual int tcpip::Storage::readUnsignedByte | ( | ) | throw (std::invalid_argument) [virtual] |
Referenced by traci::TraCIServer::addSubscription(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), testclient::TraCITestClient::commandGetVariablePlus(), TraCIServerAPI_Simulation::commandPositionConversion(), traci::TraCIServer::dispatchCommand(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_VehicleType::processSet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::readAndReportTypeDependent(), testclient::TraCITestClient::reportResultState(), TraCIServerAPI_VehicleType::setVariable(), testclient::TraCITestClient::validateDistanceRequest(), testclient::TraCITestClient::validatePositionConversion(), and testclient::TraCITestClient::validateSubscription().
void tcpip::Storage::reset | ( | ) |
Referenced by traci::TraCIServer::processCommandsUntilSimStep().
StorageType::size_type tcpip::Storage::size | ( | ) | const [inline] |
Definition at line 115 of file storage.h.
Referenced by testclient::TraCITestClient::commandDistanceRequest(), traci::TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), testclient::TraCITestClient::commandPositionConversion(), traci::TraCIServer::processCommandsUntilSimStep(), traci::TraCIServer::processSingleSubscription(), and traci::TraCIServer::writeResponseWithLength().
virtual bool tcpip::Storage::valid_pos | ( | ) | [virtual] |
void tcpip::Storage::writeByEndianess | ( | const unsigned char * | begin, |
unsigned int | size | ||
) | [private] |
Write size
elements of array begin
according to endianess.
virtual void tcpip::Storage::writeByte | ( | int | ) | throw (std::invalid_argument) [virtual] |
virtual void tcpip::Storage::writeChar | ( | unsigned | char | ) | throw () [virtual] |
virtual void tcpip::Storage::writeDouble | ( | double | ) | throw () [virtual] |
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), testclient::TraCITestClient::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), testclient::TraCITestClient::commandPositionConversion(), TraCIServerAPI_VehicleType::getVariable(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), and testclient::TraCITestClient::setValueTypeDependant().
virtual void tcpip::Storage::writeFloat | ( | float | ) | throw () [virtual] |
Referenced by testclient::TraCITestClient::setValueTypeDependant().
virtual void tcpip::Storage::writeInt | ( | int | ) | throw () [virtual] |
Referenced by traci::TraCIServer::commandGetVersion(), testclient::TraCITestClient::commandSimulationStep2(), testclient::TraCITestClient::commandSubscribeVariable(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), traci::TraCIServer::processSingleSubscription(), tcpip::Socket::sendExact(), testclient::TraCITestClient::setValueTypeDependant(), and traci::TraCIServer::writeResponseWithLength().
virtual void tcpip::Storage::writePacket | ( | unsigned char * | packet, |
int | length | ||
) | [virtual] |
virtual void tcpip::Storage::writePacket | ( | const std::vector< unsigned char > & | packet | ) | [virtual] |
virtual void tcpip::Storage::writeShort | ( | int | ) | throw (std::invalid_argument) [virtual] |
virtual void tcpip::Storage::writeStorage | ( | tcpip::Storage & | store | ) | [virtual] |
Referenced by traci::TraCIServer::addSubscription(), testclient::TraCITestClient::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariablePlus(), traci::TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), testclient::TraCITestClient::commandPositionConversion(), testclient::TraCITestClient::commandSetValue(), traci::TraCIServer::dispatchCommand(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), traci::TraCIServer::processSingleSubscription(), and traci::TraCIServer::writeResponseWithLength().
virtual void tcpip::Storage::writeString | ( | const std::string & | s | ) | throw () [virtual] |
Referenced by testclient::TraCITestClient::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), testclient::TraCITestClient::commandGetVariablePlus(), traci::TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), testclient::TraCITestClient::commandPositionConversion(), testclient::TraCITestClient::commandSetValue(), testclient::TraCITestClient::commandSubscribeVariable(), TraCIServerAPI_VehicleType::getVariable(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::setValueTypeDependant(), and traci::TraCIServer::writeStatusCmd().
virtual void tcpip::Storage::writeStringList | ( | const std::vector< std::string > & | s | ) | throw () [virtual] |
Referenced by TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), and testclient::TraCITestClient::setValueTypeDependant().
virtual void tcpip::Storage::writeUnsignedByte | ( | int | ) | throw (std::invalid_argument) [virtual] |
Referenced by testclient::TraCITestClient::commandClose(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), testclient::TraCITestClient::commandDistanceRequest(), testclient::TraCITestClient::commandGetVariable(), testclient::TraCITestClient::commandGetVariablePlus(), traci::TraCIServer::commandGetVersion(), TraCIServerAPI_Simulation::commandPositionConversion(), testclient::TraCITestClient::commandPositionConversion(), testclient::TraCITestClient::commandSetValue(), testclient::TraCITestClient::commandSimulationStep2(), testclient::TraCITestClient::commandSubscribeVariable(), TraCIServerAPI_VehicleType::getVariable(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_GUI::processGet(), traci::TraCIServer::processSingleSubscription(), testclient::TraCITestClient::setValueTypeDependant(), traci::TraCIServer::writeResponseWithLength(), and traci::TraCIServer::writeStatusCmd().
bool tcpip::Storage::bigEndian_ [private] |
StorageType::const_iterator tcpip::Storage::iter_ [private] |
StorageType tcpip::Storage::store [private] |