SUMO - Simulation of Urban MObility
|
Static storage of an output device and its base (abstract) implementation. More...
#include <OutputDevice.h>
Static Public Member Functions | |
static std::string | realString (const SUMOReal v, const int precision=OUTPUT_ACCURACY) |
Helper method for string formatting. More... | |
static access methods to OutputDevices | |
static OutputDevice & | getDevice (const std::string &name) |
Returns the described OutputDevice. More... | |
static bool | createDeviceByOption (const std::string &optionName, const std::string &rootElement="", const std::string &schemaFile="") |
Creates the device using the output definition stored in the named option. More... | |
static OutputDevice & | getDeviceByOption (const std::string &name) |
Returns the device described by the option. More... | |
static void | closeAll () |
OutputDevice member methods | |
static std::map< std::string, OutputDevice * > | myOutputDevices |
map from names to output devices More... | |
OutputFormatter * | myFormatter |
The formatter for XML. More... | |
const bool | myAmBinary |
OutputDevice (const bool binary=false, const unsigned int defaultIndentation=0) | |
Constructor. More... | |
virtual | ~OutputDevice () |
Destructor. More... | |
virtual bool | ok () |
returns the information whether one can write into the device More... | |
void | close () |
Closes the device and removes it from the dictionary. More... | |
void | setPrecision (unsigned int precision=OUTPUT_ACCURACY) |
Sets the precison or resets it to default. More... | |
bool | writeXMLHeader (const std::string &rootElement, const std::string &attrs="", const std::string &comment="") |
Writes an XML header with optional configuration. More... | |
template<typename E > | |
bool | writeHeader (const SumoXMLTag &rootElement) |
OutputDevice & | openTag (const std::string &xmlElement) |
Opens an XML tag. More... | |
OutputDevice & | openTag (const SumoXMLTag &xmlElement) |
Opens an XML tag. More... | |
bool | closeTag () |
Closes the most recently opened tag. More... | |
void | lf () |
writes a line feed if applicable More... | |
bool | isBinary () const |
Returns whether we have a binary output. More... | |
template<typename T > | |
OutputDevice & | writeAttr (const SumoXMLAttr attr, const T &val) |
writes a named attribute More... | |
template<typename T > | |
OutputDevice & | writeAttr (const std::string &attr, const T &val) |
writes an arbitrary attribute More... | |
OutputDevice & | writeNonEmptyAttr (const SumoXMLAttr attr, const std::string &val) |
writes a string attribute only if it is not the empty string and not the string "default" More... | |
OutputDevice & | writePreformattedTag (const std::string &val) |
writes a preformatted tag to the device but ensures that any pending tags are closed More... | |
void | inform (const std::string &msg, const char progress=0) |
Retrieves a message to this device. More... | |
template<class T > | |
OutputDevice & | operator<< (const T &t) |
Abstract output operator. More... | |
OutputDevice (const OutputDevice &) | |
Invalidated copy constructor. More... | |
virtual std::ostream & | getOStream ()=0 |
Returns the associated ostream. More... | |
virtual void | postWriteHook () |
Called after every write access. More... | |
OutputDevice & | operator= (const OutputDevice &) |
Invalidated assignment operator. More... | |
Static storage of an output device and its base (abstract) implementation.
OutputDevices are basically a capsule around an std::ostream, which give a unified access to sockets, files and stdout.
Usually, an application builds as many output devices as needed. Each output device may also be used to save outputs from several sources (several detectors, for example). Building is done using OutputDevice::getDevice() what also parses the given output description in order to decide what kind of an OutputDevice shall be built. OutputDevices are closed via OutputDevice::closeAll(), normally called at the application's end.
Although everything that can be written to a stream can also be written to an OutputDevice, there is special support for XML tags (remembering all open tags to close them at the end). OutputDevices are still lacking support for function pointers with the '<<' operator (no endl, use '
'). The most important method to implement in subclasses is getOStream, the most used part of the interface is the '<<' operator.
The Boolean markers are used rarely and might get removed in future versions.
Definition at line 71 of file OutputDevice.h.
OutputDevice::OutputDevice | ( | const bool | binary = false , |
const unsigned int | defaultIndentation = 0 |
||
) |
|
virtual |
OutputDevice::OutputDevice | ( | const OutputDevice & | ) |
Invalidated copy constructor.
void OutputDevice::close | ( | ) |
Closes the device and removes it from the dictionary.
Definition at line 213 of file OutputDevice.cpp.
References closeTag(), and myOutputDevices.
Referenced by RONet::cleanup(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_Breakpoints::onCmdSave(), GUIDialog_EditViewport::onCmdSave(), GUIParameterTracker::onCmdSave(), GUIDialog_ViewSettings::onCmdSaveDecals(), PCPolyContainer::save(), RODFDetectorCon::save(), GUISelectedStorage::save(), RODFDetectorCon::saveAsPOIs(), RODFDetectorCon::saveRoutes(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_XML::writeStreetSigns(), NWWriter_XML::writeTrafficLights(), and RODFDetectorCon::writeValidationDetectors().
|
static |
Closes all registered devices
Definition at line 141 of file OutputDevice.cpp.
References MsgHandler::getErrorInstance(), MsgHandler::isRetriever(), myOutputDevices, and WRITE_ERROR.
Referenced by SystemFrame::close(), and GUIRunThread::deleteSim().
bool OutputDevice::closeTag | ( | ) |
Closes the most recently opened tag.
The topmost xml-element from the stack is written into the stream as a closing element. Depending on the formatter used this may be something like "</" + element + ">" or "/>" or nothing at all.
Definition at line 253 of file OutputDevice.cpp.
References OutputFormatter::closeTag(), getOStream(), myFormatter, and postWriteHook().
Referenced by MSDevice_Routing::adaptEdgeEfforts(), RORouteHandler::addStop(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), close(), RORouteHandler::closeContainer(), RORouteHandler::closePerson(), computeRoutes(), MSRoute::dict_saveState(), MSContainerControl::erase(), MSPersonControl::erase(), MSVTypeProbe::execute(), MSDevice_Example::generateOutput(), MSDevice_Tripinfo::generateOutputForUnfinished(), RORouteHandler::myStartElement(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_EditViewport::onCmdSave(), GUIDialog_ViewSettings::onCmdSaveDecals(), MSPerson::MSPersonStage_Walking::routeOutput(), MSContainer::MSContainerStage_Driving::routeOutput(), MSContainer::MSContainerStage_Waiting::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), MSPerson::MSPersonStage_Waiting::routeOutput(), MSContainer::MSContainerStage_Tranship::routeOutput(), RORouteHandler::routePedestrian(), RODFRouteCont::save(), PCPolyContainer::save(), GUIPropertyScheme< T >::save(), RODFDetectorCon::save(), GUIVisualizationSettings::save(), ROVehicle::saveAllAsXML(), GUIDialog_ViewSettings::saveDecals(), MSVehicleControl::saveState(), MSLane::saveState(), MSVehicle::saveState(), MSVehicleControl::scheduleVehicleRemoval(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), MSContainer::MSContainerStage_Waiting::tripInfoOutput(), MSPerson::MSPersonStage_Driving::tripInfoOutput(), MSPerson::MSPersonStage_Waiting::tripInfoOutput(), MSContainer::MSContainerStage_Tranship::tripInfoOutput(), MSQueueExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSFullExport::write(), MSXMLRawOut::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), SUMOVTypeParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), ODMatrix::write(), MSInstantInductLoop::write(), MSLink::writeApproaching(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NBRequest::writeCrossingResponse(), NWWriter_SUMO::writeDistrict(), MSQueueExport::writeEdge(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitters(), ODMatrix::writeFlows(), NWWriter_SUMO::writeInternalConnection(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writeInternalNodes(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), MSXMLRawOut::writeLane(), NWWriter_SUMO::writeLane(), NBRequest::writeLaneResponse(), GeoConvHelper::writeLocation(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), MSNet::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), NWWriter_SUMO::writeProhibitions(), NWWriter_SUMO::writeRoundabout(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), SUMOVehicleParameter::writeStops(), MSFullExport::writeTLS(), NWWriter_SUMO::writeTrafficLights(), RODFDetectorCon::writeValidationDetectors(), MSAmitranTrajectories::writeVehicle(), MSXMLRawOut::writeVehicle(), MSFullExport::writeVehicles(), GUIDialog_EditViewport::writeXML(), SUMO::Polygon::writeXML(), RORouteDef::writeXMLDefinition(), RORoute::writeXMLDefinition(), TrajectoriesHandler::writeXMLEmissions(), MSRouteProbe::writeXMLOutput(), and MSMeanData::writeXMLOutput().
|
static |
Creates the device using the output definition stored in the named option.
Creates and returns the device named by the option. Asks whether the option and retrieves the name from the option if so. Optionally the XML header gets written as well. Returns whether a device was created (option was set).
Please note, that we do not have to consider the "application base" herein, because this call is only used to get file names of files referenced within XML-declarations of structures which paths already is aware of the cwd.
[in] | optionName | The name of the option to use for retrieving the output definition |
[in] | rootElement | The root element to use (XML-output) |
[in] | schemaFile | The basename of the schema file to use (XML-output) |
IOError | If the output could not be built for any reason (error message is supplied) |
Definition at line 112 of file OutputDevice.cpp.
References getDevice(), OptionsCont::getOptions(), and writeXMLHeader().
Referenced by MSFrame::buildStreams(), MSDevice_Routing::buildVehicleDevices(), MSDevice_Vehroutes::init(), and main().
|
static |
Returns the described OutputDevice.
Creates and returns the named device. "stdout" and "stderr" refer to the relevant console streams, "hostname:port" initiates socket connection. Otherwise a filename is assumed (where "nul" and "/dev/null" do what you would expect on both platforms). If there already is a device with the same name this one is returned.
[in] | name | The description of the output name/port/whatever |
IOError | If the output could not be built for any reason (error message is supplied) |
Definition at line 66 of file OutputDevice.cpp.
References TplConvert::_2int(), OutputDevice_COUT::getDevice(), OutputDevice_CERR::getDevice(), OptionsCont::getOptions(), getOStream(), OptionsCont::getString(), FileHelpers::isSocket(), myOutputDevices, FileHelpers::prependToLastPathComponent(), and setPrecision().
Referenced by MSDetectorControl::add(), NLDetectorBuilder::buildE2Detector(), NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), NLDetectorBuilder::buildVTypeProbe(), createDeviceByOption(), GUIDetectorBuilder::createInstantInductLoop(), NLDetectorBuilder::createInstantInductLoop(), getDeviceByOption(), MsgHandler::initOutputOptions(), main(), MSCalibrator::MSCalibrator(), MsgHandler::MsgHandler(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_Breakpoints::onCmdSave(), GUIDialog_EditViewport::onCmdSave(), GUIParameterTracker::onCmdSave(), GUIDialog_ViewSettings::onCmdSaveDecals(), RONet::openOutput(), GUILoadThread::run(), PCPolyContainer::save(), RODFDetectorCon::save(), GUISelectedStorage::save(), RODFDetectorCon::saveAsPOIs(), RODFDetectorCon::saveRoutes(), MSStateHandler::saveState(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_XML::writeJoinedJunctions(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_Amitran::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_XML::writeStreetSigns(), NWWriter_XML::writeTrafficLights(), NWWriter_DlrNavteq::writeTrafficSignals(), and RODFDetectorCon::writeValidationDetectors().
|
static |
Returns the device described by the option.
Returns the device named by the option. If the option is unknown, unset or the device was not created before, InvalidArgument is thrown.
Please note, that we do not have to consider the "application base" herein.
[in] | name | The name of the option to use for retrieving the output definition |
IOError | If the output could not be built for any reason (error message is supplied) |
InvalidArgument | If the option with the given name does not exist |
Definition at line 131 of file OutputDevice.cpp.
References getDevice(), OptionsCont::getOptions(), OptionsCont::getString(), and myOutputDevices.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSContainerControl::erase(), MSPersonControl::erase(), MSDevice_Emissions::generateOutput(), MSDevice_Tripinfo::generateOutput(), MSDevice_Vehroutes::generateOutput(), MSDevice_Example::generateOutput(), MSDevice_Tripinfo::generateOutputForUnfinished(), main(), MSVehicleControl::scheduleVehicleRemoval(), MSNet::writeOutput(), and MSDevice_BTreceiver::BTreceiverUpdate::writeOutput().
|
protectedpure virtual |
Returns the associated ostream.
Implemented in GUIMessageWindow::MsgOutputDevice, OutputDevice_Network, MsgRetrievingFunction< T >, OutputDevice_String, OutputDevice_File, OutputDevice_CERR, and OutputDevice_COUT.
Referenced by closeTag(), getDevice(), inform(), lf(), ok(), openTag(), operator<<(), setPrecision(), writeAttr(), writeHeader(), writePreformattedTag(), and writeXMLHeader().
void OutputDevice::inform | ( | const std::string & | msg, |
const char | progress = 0 |
||
) |
Retrieves a message to this device.
Implementation of the MessageRetriever interface. Writes the given message to the output device.
[in] | msg | The msg to write to the device |
Definition at line 267 of file OutputDevice.cpp.
References getOStream(), and postWriteHook().
|
inline |
Returns whether we have a binary output.
Definition at line 245 of file OutputDevice.h.
References myAmBinary.
Referenced by MSDevice_Vehroutes::generateOutput().
|
inline |
writes a line feed if applicable
Definition at line 235 of file OutputDevice.h.
References getOStream(), and myAmBinary.
Referenced by AGActivityTripWriter::AGActivityTripWriter(), GUIVisualizationSettings::save(), NWWriter_XML::writeEdgesAndConnections(), GeoConvHelper::writeLocation(), NWWriter_SUMO::writeNetwork(), NWWriter_SUMO::writeRoundabouts(), and NWWriter_SUMO::writeTrafficLights().
|
virtual |
returns the information whether one can write into the device
Definition at line 207 of file OutputDevice.cpp.
References getOStream().
OutputDevice & OutputDevice::openTag | ( | const std::string & | xmlElement | ) |
Opens an XML tag.
An indentation, depending on the current xml-element-stack size, is written followed by the given xml element ("<" + xmlElement) The xml element is added to the stack, then.
[in] | xmlElement | Name of element to open |
Definition at line 239 of file OutputDevice.cpp.
References getOStream(), myFormatter, and OutputFormatter::openTag().
Referenced by MSDevice_Routing::adaptEdgeEfforts(), RORouteHandler::addStop(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), MSPerson::MSPersonStage_Walking::beginEventOutput(), MSContainer::MSContainerStage_Driving::beginEventOutput(), MSContainer::MSContainerStage_Waiting::beginEventOutput(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), computeRoutes(), MSRoute::dict_saveState(), MSPerson::MSPersonStage_Walking::endEventOutput(), MSContainer::MSContainerStage_Driving::endEventOutput(), MSContainer::MSContainerStage_Waiting::endEventOutput(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSContainerControl::erase(), MSPersonControl::erase(), MSVTypeProbe::execute(), MSDevice_Emissions::generateOutput(), MSDevice_Tripinfo::generateOutput(), MSDevice_Example::generateOutput(), RORouteHandler::myStartElement(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_EditViewport::onCmdSave(), GUIDialog_ViewSettings::onCmdSaveDecals(), MSMeanData_Amitran::openInterval(), MSMeanData::openInterval(), MSPerson::MSPersonStage_Walking::routeOutput(), MSContainer::MSContainerStage_Driving::routeOutput(), MSContainer::MSContainerStage_Waiting::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), MSPerson::MSPersonStage_Waiting::routeOutput(), MSContainer::MSContainerStage_Tranship::routeOutput(), RORouteHandler::routePedestrian(), RODFRouteCont::save(), PCPolyContainer::save(), GUIPropertyScheme< T >::save(), RODFDetectorCon::save(), GUIVisualizationSettings::save(), ROVehicle::saveAllAsXML(), RODFDetectorCon::saveAsPOIs(), GUIDialog_ViewSettings::saveDecals(), MSBaseVehicle::saveState(), MSVehicleControl::saveState(), MSLane::saveState(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), MSContainer::MSContainerStage_Waiting::tripInfoOutput(), MSPerson::MSPersonStage_Driving::tripInfoOutput(), MSPerson::MSPersonStage_Waiting::tripInfoOutput(), MSContainer::MSContainerStage_Tranship::tripInfoOutput(), MSEmissionExport::write(), MSFCDExport::write(), MSQueueExport::write(), MSFullExport::write(), MSXMLRawOut::write(), SUMOVTypeParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), ODMatrix::write(), MSInstantInductLoop::write(), SUMOVehicleParameter::write(), MSLink::writeApproaching(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NBRequest::writeCrossingResponse(), NWWriter_SUMO::writeDistrict(), MSQueueExport::writeEdge(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), ODMatrix::writeFlows(), NWWriter_SUMO::writeInternalConnection(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writeInternalNodes(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), MSXMLRawOut::writeLane(), NWWriter_SUMO::writeLane(), NBRequest::writeLaneResponse(), GeoConvHelper::writeLocation(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), MSNet::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), MSMeanData_Amitran::writePrefix(), MSMeanData::writePrefix(), NWWriter_SUMO::writeProhibitions(), NWWriter_SUMO::writeRoundabout(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), SUMOVehicleParameter::writeStops(), MSFullExport::writeTLS(), NWWriter_SUMO::writeTrafficLights(), RODFDetectorCon::writeValidationDetectors(), MSAmitranTrajectories::writeVehicle(), MSXMLRawOut::writeVehicle(), MSFullExport::writeVehicles(), GUIDialog_EditViewport::writeXML(), SUMO::Polygon::writeXML(), RORouteDef::writeXMLDefinition(), RORoute::writeXMLDefinition(), TrajectoriesHandler::writeXMLEmissions(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().
OutputDevice & OutputDevice::openTag | ( | const SumoXMLTag & | xmlElement | ) |
Opens an XML tag.
Helper method which finds the correct string before calling openTag.
[in] | xmlElement | Id of the element to open |
Definition at line 246 of file OutputDevice.cpp.
References getOStream(), myFormatter, and OutputFormatter::openTag().
|
inline |
Abstract output operator.
Definition at line 322 of file OutputDevice.h.
References getOStream(), and postWriteHook().
|
private |
Invalidated assignment operator.
|
protectedvirtual |
Called after every write access.
Default implementation does nothing.
Reimplemented in GUIMessageWindow::MsgOutputDevice, OutputDevice_Network, MsgRetrievingFunction< T >, OutputDevice_CERR, and OutputDevice_COUT.
Definition at line 263 of file OutputDevice.cpp.
Referenced by closeTag(), inform(), and operator<<().
|
static |
Helper method for string formatting.
[in] | v | The floating point value to be formatted |
[in] | precision | the precision to achieve |
Definition at line 171 of file OutputDevice.cpp.
Referenced by MSDevice_Emissions::generateOutput(), and MSMeanData_Emissions::MSLaneMeanDataValues::write().
void OutputDevice::setPrecision | ( | unsigned int | precision = OUTPUT_ACCURACY | ) |
Sets the precison or resets it to default.
[in] | precision | The accuracy (number of digits behind '.') to set |
Definition at line 226 of file OutputDevice.cpp.
References getOStream().
Referenced by MSVTypeProbe::execute(), getDevice(), PCPolyContainer::save(), MSFCDExport::write(), MSXMLRawOut::write(), NWWriter_XML::writeEdgesAndConnections(), GeoConvHelper::writeLocation(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_DlrNavteq::writeTrafficSignals(), and RORoute::writeXMLDefinition().
|
inline |
writes a named attribute
[in] | attr | The attribute (name) |
[in] | val | The attribute value |
Definition at line 257 of file OutputDevice.h.
References getOStream(), myAmBinary, PlainXMLFormatter::writeAttr(), and BinaryFormatter::writeAttr().
Referenced by MSDevice_Routing::adaptEdgeEfforts(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), MSPerson::MSPersonStage_Walking::beginEventOutput(), MSContainer::MSContainerStage_Driving::beginEventOutput(), MSContainer::MSContainerStage_Waiting::beginEventOutput(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), computeRoutes(), MSRoute::dict_saveState(), MSPerson::MSPersonStage_Walking::endEventOutput(), MSContainer::MSContainerStage_Driving::endEventOutput(), MSContainer::MSContainerStage_Waiting::endEventOutput(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSContainerControl::erase(), MSPersonControl::erase(), MSVTypeProbe::execute(), MSDevice_Tripinfo::generateOutput(), MSDevice_Example::generateOutput(), GUIDialog_ViewSettings::onCmdExportSetting(), MSMeanData_Amitran::openInterval(), MSMeanData::openInterval(), RONet::openOutput(), GUIVisualizationTextSettings::print(), GUIVisualizationSizeSettings::print(), MSPerson::MSPersonStage_Walking::routeOutput(), MSContainer::MSContainerStage_Driving::routeOutput(), MSContainer::MSContainerStage_Waiting::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), MSPerson::MSPersonStage_Waiting::routeOutput(), MSContainer::MSContainerStage_Tranship::routeOutput(), RORouteHandler::routePedestrian(), RODFRouteCont::save(), PCPolyContainer::save(), GUIPropertyScheme< T >::save(), RODFDetectorCon::save(), GUIVisualizationSettings::save(), ROVehicle::saveAllAsXML(), RODFDetectorCon::saveAsPOIs(), GUIDialog_ViewSettings::saveDecals(), MSStateHandler::saveState(), MSBaseVehicle::saveState(), MSVehicleControl::saveState(), MSLane::saveState(), MSVehicle::saveState(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), MSContainer::MSContainerStage_Waiting::tripInfoOutput(), MSPerson::MSPersonStage_Driving::tripInfoOutput(), MSPerson::MSPersonStage_Waiting::tripInfoOutput(), MSContainer::MSContainerStage_Tranship::tripInfoOutput(), MSFCDExport::write(), MSEmissionExport::write(), MSQueueExport::write(), SUMOVTypeParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), ODMatrix::write(), MSInstantInductLoop::write(), SUMOVehicleParameter::write(), MSLink::writeApproaching(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NBRequest::writeCrossingResponse(), ODMatrix::writeDefaultAttrs(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), ODMatrix::writeFlows(), NWWriter_SUMO::writeInternalConnection(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writeInternalNodes(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_SUMO::writeLane(), NBRequest::writeLaneResponse(), GeoConvHelper::writeLocation(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), writeNonEmptyAttr(), MSNet::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), NWWriter_SUMO::writePermissions(), NWFrame::writePositionLong(), NWWriter_SUMO::writePreferences(), MSMeanData_Amitran::writePrefix(), MSMeanData::writePrefix(), NWWriter_SUMO::writeProhibitions(), NWWriter_SUMO::writeRoundabout(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), SUMOVehicleParameter::writeStops(), MSFullExport::writeTLS(), NWWriter_SUMO::writeTrafficLights(), RODFDetectorCon::writeValidationDetectors(), MSAmitranTrajectories::writeVehicle(), MSXMLRawOut::writeVehicle(), MSFullExport::writeVehicles(), GUIDialog_EditViewport::writeXML(), SUMO::Polygon::writeXML(), RORouteDef::writeXMLDefinition(), RORoute::writeXMLDefinition(), and TrajectoriesHandler::writeXMLEmissions().
|
inline |
writes an arbitrary attribute
[in] | attr | The attribute (name) |
[in] | val | The attribute value |
Definition at line 274 of file OutputDevice.h.
References getOStream(), myAmBinary, PlainXMLFormatter::writeAttr(), and BinaryFormatter::writeAttr().
|
inline |
Definition at line 189 of file OutputDevice.h.
References getOStream(), myAmBinary, and myFormatter.
Referenced by RONet::openOutput(), and MSStateHandler::saveState().
|
inline |
writes a string attribute only if it is not the empty string and not the string "default"
[in] | attr | The attribute (name) |
[in] | val | The attribute value |
Definition at line 290 of file OutputDevice.h.
References writeAttr().
Referenced by SUMOVehicleParameter::write(), and RODFDetector::writeEmitterDefinition().
|
inline |
writes a preformatted tag to the device but ensures that any pending tags are closed
[in] | val | The preformatted data |
Definition at line 303 of file OutputDevice.h.
References getOStream(), myFormatter, and OutputFormatter::writePreformattedTag().
Referenced by RONet::saveAndRemoveRoutesUntil().
bool OutputDevice::writeXMLHeader | ( | const std::string & | rootElement, |
const std::string & | attrs = "" , |
||
const std::string & | comment = "" |
||
) |
Writes an XML header with optional configuration.
If something has been written (myXMLStack is not empty), nothing is written and false returned.
[in] | rootElement | The root element to use |
[in] | attrs | Additional attributes to save within the rootElement |
[in] | comment | Additional comment (saved in front the rootElement) |
Check which parameter is used herein
Describe what is saved
Definition at line 232 of file OutputDevice.cpp.
References getOStream(), myFormatter, and OutputFormatter::writeXMLHeader().
Referenced by Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), createDeviceByOption(), MSCalibrator::MSCalibrator(), MSVTypeProbe::MSVTypeProbe(), RONet::openOutput(), PCPolyContainer::save(), RODFDetectorCon::save(), RODFDetectorCon::saveAsPOIs(), RODFDetectorCon::saveRoutes(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_XML::writeStreetSigns(), NWWriter_XML::writeTrafficLights(), RODFDetectorCon::writeValidationDetectors(), MSRouteProbe::writeXMLDetectorProlog(), MS_E2_ZS_CollectorOverLanes::writeXMLDetectorProlog(), MSInstantInductLoop::writeXMLDetectorProlog(), MSMeanData_Amitran::writeXMLDetectorProlog(), MSE2Collector::writeXMLDetectorProlog(), MSInductLoop::writeXMLDetectorProlog(), MSE3Collector::writeXMLDetectorProlog(), and MSMeanData::writeXMLDetectorProlog().
|
private |
Definition at line 349 of file OutputDevice.h.
Referenced by isBinary(), lf(), writeAttr(), and writeHeader().
|
private |
The formatter for XML.
Definition at line 347 of file OutputDevice.h.
Referenced by closeTag(), openTag(), OutputDevice(), writeHeader(), writePreformattedTag(), writeXMLHeader(), and ~OutputDevice().
|
staticprivate |
map from names to output devices
Definition at line 342 of file OutputDevice.h.
Referenced by close(), closeAll(), getDevice(), and getDeviceByOption().