TraCIServerAPIHelper Class Reference

#include <TraCIServerAPIHelper.h>


Detailed Description

Some helper functions for communication.

Definition at line 43 of file TraCIServerAPIHelper.h.


Static Public Member Functions

static void writeStatusCmd (int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
 Writes the status command.

Private Member Functions

TraCIServerAPIHelperoperator= (const TraCIServerAPIHelper &s)
 invalidated assignment operator
 TraCIServerAPIHelper (const TraCIServerAPIHelper &s)
 invalidated copy constructor

Constructor & Destructor Documentation

TraCIServerAPIHelper::TraCIServerAPIHelper ( const TraCIServerAPIHelper s  )  [private]

invalidated copy constructor


Member Function Documentation

TraCIServerAPIHelper& TraCIServerAPIHelper::operator= ( const TraCIServerAPIHelper s  )  [private]

invalidated assignment operator

void TraCIServerAPIHelper::writeStatusCmd ( int  commandId,
int  status,
const std::string &  description,
tcpip::Storage outputStorage 
) [static]

Writes the status command.

Parameters:
[in] commandId The command id
[in] status The return status
[in] description The message
[out] outputStorage The storage to write the status to

Definition at line 52 of file TraCIServerAPIHelper.cpp.

References MsgHandler::getErrorInstance(), MsgHandler::inform(), RTYPE_ERR, RTYPE_NOTIMPLEMENTED, toString(), tcpip::Storage::writeString(), and tcpip::Storage::writeUnsignedByte().

Referenced by TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Lane::processSet(), TraCIServerAPI_Edge::processSet(), and traci::TraCIServer::processSingleSubscription().

00053                                                                                                 {
00054     if (status == RTYPE_ERR) {
00055         MsgHandler::getErrorInstance()->inform("Answered with error to command " + toString(commandId) +
00056                                                ": " + description);
00057     } else if (status == RTYPE_NOTIMPLEMENTED) {
00058         MsgHandler::getErrorInstance()->inform("Requested command not implemented (" + toString(commandId) +
00059                                                "): " + description);
00060     }
00061     // command length
00062     outputStorage.writeUnsignedByte(1 + 1 + 1 + 4 + static_cast<int>(description.length()));
00063     // command type
00064     outputStorage.writeUnsignedByte(commandId);
00065     // status
00066     outputStorage.writeUnsignedByte(status);
00067     // description
00068     outputStorage.writeString(description);
00069     return;
00070 }


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

Generated on Wed May 5 00:07:01 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6