Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
OutputDevice_File Class Reference

An output device that encapsulates an ofstream. More...

#include <OutputDevice_File.h>

Inheritance diagram for OutputDevice_File:
[legend]
Collaboration diagram for OutputDevice_File:
[legend]

Public Member Functions

bool isNull () override
 returns the information whether the device will discard all output
 
 OutputDevice_File (const std::string &fullName, const bool compressed=false)
 Constructor.
 
 ~OutputDevice_File ()
 Destructor.
 

Static Public Member Functions

static std::string realString (const double v, const int precision=gPrecision)
 Helper method for string formatting.
 
static access methods to OutputDevices
static OutputDevicegetDevice (const std::string &name, bool usePrefix=true)
 Returns the described OutputDevice.
 
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.
 
static OutputDevicegetDeviceByOption (const std::string &name)
 Returns the device described by the option.
 
static void flushAll ()
 
static void closeAll (bool keepErrorRetrievers=false)
 

Protected Member Functions

Methods that override/implement OutputDevice-methods
std::ostream & getOStream () override
 Returns the associated ostream.
 

Private Attributes

bool myAmNull = false
 am I redirecting to /dev/null
 
std::ostream * myFileStream = nullptr
 The wrapped ofstream.
 

OutputDevice member methods

OutputFormatter *const myFormatter
 The formatter for XML.
 
virtual bool ok ()
 returns the information whether one can write into the device
 
const std::string & getFilename ()
 get filename or suitable description of this device
 
void close ()
 Closes the device and removes it from the dictionary.
 
void setPrecision (int precision=gPrecision)
 Sets the precision or resets it to default.
 
int precision ()
 return precision set on the device
 
int getPrecision ()
 Returns the precision of the underlying stream.
 
bool writeXMLHeader (const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
 Writes an XML header with optional configuration.
 
template<typename E >
bool writeHeader (const SumoXMLTag &rootElement)
 
OutputDeviceopenTag (const std::string &xmlElement)
 Opens an XML tag.
 
OutputDeviceopenTag (const SumoXMLTag &xmlElement)
 Opens an XML tag.
 
bool closeTag (const std::string &comment="")
 Closes the most recently opened tag and optionally adds a comment.
 
void lf ()
 writes a line feed if applicable
 
template<typename T >
OutputDevicewriteAttr (const SumoXMLAttr attr, const T &val)
 writes a named attribute
 
template<typename T >
OutputDevicewriteAttr (const std::string &attr, const T &val)
 writes an arbitrary attribute
 
bool useAttribute (const SumoXMLAttr attr, SumoXMLAttrMask attributeMask) const
 
template<typename T >
OutputDevicewriteOptionalAttr (const SumoXMLAttr attr, const T &val, long long int attributeMask)
 writes a named attribute unless filtered
 
template<typename T >
OutputDevicewriteOptionalAttr (const SumoXMLAttr attr, const T &val, SumoXMLAttrMask attributeMask)
 
OutputDevicewriteNonEmptyAttr (const SumoXMLAttr attr, const std::string &val)
 writes a string attribute only if it is not the empty string and not the string "default"
 
OutputDevicewritePreformattedTag (const std::string &val)
 writes a preformatted tag to the device but ensures that any pending tags are closed
 
OutputDevicewritePadding (const std::string &val)
 writes padding (ignored for binary output)
 
void inform (const std::string &msg, const bool progress=false)
 Retrieves a message to this device.
 
template<class T >
OutputDeviceoperator<< (const T &t)
 Abstract output operator.
 
void flush ()
 
bool wroteHeader () const
 
virtual void postWriteHook ()
 Called after every write access.
 
static std::map< std::string, OutputDevice * > myOutputDevices
 map from names to output devices
 
static int myPrevConsoleCP = -1
 old console code page to restore after ending
 
const std::string myFilename
 

Detailed Description

An output device that encapsulates an ofstream.

Please note that the device gots responsible for the stream and deletes it (it should not be deleted elsewhere).

Definition at line 38 of file OutputDevice_File.h.

Constructor & Destructor Documentation

◆ OutputDevice_File()

OutputDevice_File::OutputDevice_File ( const std::string &  fullName,
const bool  compressed = false 
)

Constructor.

Parameters
[in]fullNameThe name of the output file to use
[in]compressedwhether to apply gzip compression
Exceptions
IOErrorShould not be thrown by this implementation

Definition at line 38 of file OutputDevice_File.cpp.

References myAmNull, myFileStream, TLF, StringUtils::transcodeToLocal(), UNUSED_PARAMETER, and strict_fstream::Exception::what().

◆ ~OutputDevice_File()

OutputDevice_File::~OutputDevice_File ( )

Destructor.

Definition at line 75 of file OutputDevice_File.cpp.

References myFileStream.

Member Function Documentation

◆ close()

void OutputDevice::close ( )
inherited

Closes the device and removes it from the dictionary.

Definition at line 228 of file OutputDevice.cpp.

References OutputDevice::closeTag(), OutputDevice::myOutputDevices, and MsgHandler::removeRetrieverFromAllInstances().

Referenced by RONet::cleanup(), AStarRouter< E, V >::compute(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_Breakpoints::onCmdSave(), GNESelectorFrame::SelectionOperation::onCmdSave(), GUIParameterTracker::onCmdSave(), GUIDialog_EditViewport::onCmdSave(), GNERunNetgenerateDialog::onCmdSaveLog(), GNERunPythonToolDialog::onCmdSaveLog(), GNEMultipleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNESingleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNEVTypeDistributionsDialog::ParametersOperations::onCmdSaveParameters(), GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(), GUIDialog_ViewSettings::onCmdSaveXMLDecals(), RODFDetectorCon::save(), PCPolyContainer::save(), GUISelectedStorage::save(), GNENet::saveAdditionalsConfirmed(), RODFDetectorCon::saveAsPOIs(), GNEFixDemandElements::FixOptions::saveContents(), GNEFixNetworkElements::FixOptions::saveContents(), GNENet::saveDataElementsConfirmed(), GNENet::saveDemandElementsConfirmed(), PCPolyContainer::saveDlrTDP(), GNENet::saveEdgeTypes(), GNENet::saveJuPedSimElements(), GNENet::saveMeanDatasConfirmed(), RODFDetectorCon::saveRoutes(), MSStateHandler::saveState(), GNENet::saveTLSPrograms(), GNEViewNet::saveVisualizationSettings(), NWWriter_DlrNavteq::writeConnectedLanes(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_XML::writeJoinedJunctions(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_Amitran::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_XML::writeParkingAreas(), NWWriter_DlrNavteq::writeProhibitedManoeuvres(), NWWriter_XML::writePTLines(), NWWriter_XML::writePTStops(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_XML::writeStreetSigns(), NWWriter_XML::writeTrafficLights(), NWWriter_DlrNavteq::writeTrafficSignals(), NWWriter_XML::writeTypes(), and RODFDetectorCon::writeValidationDetectors().

◆ closeAll()

void OutputDevice::closeAll ( bool  keepErrorRetrievers = false)
staticinherited

Closes all registered devices

Definition at line 149 of file OutputDevice.cpp.

References MsgHandler::getErrorInstance(), MsgHandler::isRetriever(), OutputDevice::myOutputDevices, OutputDevice::myPrevConsoleCP, TL, and WRITE_ERROR.

Referenced by MSNet::clearAll(), SystemFrame::close(), GUIRunThread::deleteSim(), and main().

Here is the caller graph for this function:

◆ closeTag()

bool OutputDevice::closeTag ( const std::string &  comment = "")
inherited

Closes the most recently opened tag and optionally adds a comment.

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.

Returns
Whether a further element existed in the stack and could be closed
Todo:
it is not verified that the topmost element was closed

Definition at line 281 of file OutputDevice.cpp.

References OutputFormatter::closeTag(), OutputDevice::getOStream(), OutputDevice::myFormatter, and OutputDevice::postWriteHook().

Referenced by MSDriveWay::_saveState(), MSRoutingEngine::adaptEdgeEfforts(), RORouteHandler::addStop(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), MSDevice_SSM::cleanup(), MSDevice_ToC::cleanup(), OutputDevice::close(), RORouteHandler::closeContainer(), RORouteHandler::closeContainerFlow(), computeRoutes(), MSRoute::dict_saveState(), MSDispatch_GreedyShared::dispatch(), MSDispatch_RouteExtension::dispatch(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), MSVTypeProbe::execute(), MSDevice_SSM::flushGlobalMeasures(), MSDevice_Bluelight::generateOutput(), MSDevice_ElecHybrid::generateOutput(), MSDevice_Emissions::generateOutput(), MSDevice_Example::generateOutput(), MSDevice_Taxi::generateOutput(), MSDevice_Battery::generateOutput(), MSDevice_StationFinder::generateOutput(), MSDevice_Tripinfo::generateOutputForUnfinished(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSRailSignalControl::haveDeadlock(), MSAbstractLaneChangeModel::laneChangeOutput(), RORouteHandler::myStartElement(), MSDevice_Vehroutes::notifyStopEnded(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_EditViewport::onCmdSave(), GNEMultipleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNESingleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNEVTypeDistributionsDialog::ParametersOperations::onCmdSaveParameters(), GUIDialog_ViewSettings::onCmdSaveXMLDecals(), MSVehicleControl::removePending(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageTrip::routeOutput(), MSStageWaiting::routeOutput(), MSStageWalking::routeOutput(), MSTransportable::routeOutput(), RODFDetectorCon::save(), GUIVisualizationSettings::save(), GUIPropertyScheme< T >::save(), RODFRouteCont::save(), ROPerson::Stop::saveAsXML(), ROPerson::PersonTrip::saveAsXML(), ROPerson::Ride::saveAsXML(), ROPerson::Walk::saveAsXML(), ROPerson::saveAsXML(), ROVehicle::saveAsXML(), GUIDialog_ViewSettings::saveDecals(), GNENet::saveEdgeTypes(), MSStateHandler::saveRNGs(), MSLane::saveRNGStates(), MSStateHandler::saveState(), MEVehicle::saveState(), MSEdgeControl::saveState(), MSInsertionControl::saveState(), MSLane::saveState(), MSVehicle::saveState(), MSVehicleControl::saveState(), MSVehicleTransfer::saveState(), MSRailSignalConstraint::saveState(), MSRailSignalConstraint_Predecessor::PassedTracker::saveState(), MSTransportable::saveState(), MESegment::saveState(), MSDevice_Routing::saveState(), MSDevice_Transportable::saveState(), MSDevice_Tripinfo::saveState(), MSDevice_Vehroutes::saveState(), MSTransportableDevice_Routing::saveState(), MSDevice_Battery::saveState(), MSDevice_StationFinder::saveState(), MSSimpleTrafficLightLogic::saveState(), GNEViewNet::saveVisualizationSettings(), MSStopOut::stopEnded(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSStageWalking::tripInfoOutput(), MSInstantInductLoop::write(), MSStop::write(), SUMOVTypeParameter::write(), SUMOVehicleParameter::Stop::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), NBPTLine::write(), NBPTStop::write(), NBParking::write(), MSXMLRawOut::write(), MSElecHybridExport::write(), MSFullExport::write(), MSQueueExport::write(), MSFCDExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), MSRailSignalConstraint_Predecessor::write(), ODMatrix::write(), GNEAccess::writeAdditional(), GNEBusStop::writeAdditional(), GNECalibrator::writeAdditional(), GNECalibratorFlow::writeAdditional(), GNEChargingStation::writeAdditional(), GNEClosingLaneReroute::writeAdditional(), GNEClosingReroute::writeAdditional(), GNEContainerStop::writeAdditional(), GNEDestProbReroute::writeAdditional(), GNEEntryExitDetector::writeAdditional(), GNEInductionLoopDetector::writeAdditional(), GNEInstantInductionLoopDetector::writeAdditional(), GNELaneAreaDetector::writeAdditional(), GNEMultiEntryExitDetector::writeAdditional(), GNEOverheadWire::writeAdditional(), GNEParkingArea::writeAdditional(), GNEParkingAreaReroute::writeAdditional(), GNEParkingSpace::writeAdditional(), GNERerouter::writeAdditional(), GNERerouterInterval::writeAdditional(), GNERouteProbe::writeAdditional(), GNERouteProbReroute::writeAdditional(), GNETAZ::writeAdditional(), GNETAZSourceSink::writeAdditional(), GNETractionSubstation::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSign::writeAdditional(), GNEVariableSpeedSignStep::writeAdditional(), MSElecHybridExport::writeAggregated(), MSChargingStation::writeAggregatedChargingStationOutput(), MSLink::writeApproaching(), NBSign::writeAsPOI(), MSDriveWay::writeBlocks(), MSRailSignal::writeBlocks(), MSDriveWay::writeBlockVehicles(), MSChargingStation::writeChargingStationOutput(), MSNet::writeCollisions(), NWWriter_SUMO::writeConnection(), Command_SaveTLSProgram::writeCurrent(), GNEDataSet::writeDataSet(), GNEContainer::writeDemandElement(), GNEPerson::writeDemandElement(), GNEPersonTrip::writeDemandElement(), GNERide::writeDemandElement(), GNERoute::writeDemandElement(), GNERouteDistribution::writeDemandElement(), GNEStopPlan::writeDemandElement(), GNETranship::writeDemandElement(), GNETransport::writeDemandElement(), GNEVehicle::writeDemandElement(), GNEVTypeDistribution::writeDemandElement(), GNEWalk::writeDemandElement(), MSDriveWay::writeDepatureBlocks(), NWWriter_SUMO::writeDistrict(), MSMeanData::writeEdge(), NWWriter_SUMO::writeEdge(), MSFullExport::writeEdge(), MSQueueExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NBTypeCont::writeEdgeTypes(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitters(), ODMatrix::writeFlows(), GNEEdgeData::writeGenericData(), GNEEdgeRelData::writeGenericData(), GNETAZRelData::writeGenericData(), NWWriter_OpenDrive::writeGeomLines(), NWWriter_OpenDrive::writeGeomPP3(), RONet::writeIntermodal(), NWWriter_SUMO::writeInternalConnection(), NWWriter_OpenDrive::writeInternalEdge(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writeInternalNodes(), ROMAAssignments::writeInterval(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), NWWriter_SUMO::writeLane(), MSFullExport::writeLane(), MSQueueExport::writeLane(), MSXMLRawOut::writeLane(), GeoConvHelper::writeLocation(), NBRequest::writeLogic(), GNEMeanData::writeMeanData(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), IntermodalRouter< E, L, N, V >::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_OpenDrive::writeNormalEdge(), GNEDemandElementPlan::writeOriginStop(), MSDevice_SSM::writeOutConflict(), MSDevice_ToC::writeOutput(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), MSOverheadWire::writeOverheadWireSegmentOutput(), Parameterised::writeParams(), NWWriter_SUMO::writeProhibitions(), MSDevice_Tripinfo::writeRideStatistics(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), NWWriter_OpenDrive::writeRoadObjects(), NWWriter_SUMO::writeRoundabout(), NWWriter_OpenDrive::writeSignals(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), MSNet::writeStatistics(), MSDevice_Tripinfo::writeStatistics(), NWWriter_SUMO::writeStopOffsets(), MSNet::writeSummaryOutput(), MSFullExport::writeTLS(), MSTractionSubstation::writeTractionSubstationOutput(), NWWriter_SUMO::writeTrafficLight(), MSFCDExport::writeTransportable(), MSXMLRawOut::writeTransportable(), RODFDetectorCon::writeValidationDetectors(), MSXMLRawOut::writeVehicle(), MSAmitranTrajectories::writeVehicle(), MSChargingStation::writeVehicle(), MSOverheadWire::writeVehicle(), MSFullExport::writeVehicles(), IntermodalRouter< E, L, N, V >::writeWeights(), GUIDialog_EditViewport::writeXML(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), RORouteDef::writeXMLDefinition(), RORoute::writeXMLDefinition(), TrajectoriesHandler::writeXMLEmissions(), MSInductLoop::writeXMLOutput(), MSMeanData::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

◆ createDeviceByOption()

bool OutputDevice::createDeviceByOption ( const std::string &  optionName,
const std::string &  rootElement = "",
const std::string &  schemaFile = "" 
)
staticinherited

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.

Parameters
[in]optionNameThe name of the option to use for retrieving the output definition
[in]rootElementThe root element to use (XML-output)
[in]schemaFileThe basename of the schema file to use (XML-output)
Returns
Whether a device was built (the option was set)
Exceptions
IOErrorIf the output could not be built for any reason (error message is supplied)

Definition at line 116 of file OutputDevice.cpp.

References OutputDevice::getDevice(), OptionsCont::getOptions(), and OutputDevice::writeXMLHeader().

Referenced by MSFrame::buildStreams(), computeAllPairs(), computeRoutes(), MSDevice_Vehroutes::init(), MSPModel_JuPedSim::initialize(), MSRoutingEngine::initWeightUpdate(), main(), main(), MSDispatch::MSDispatch(), MSTransportableControl::MSTransportableControl(), GNEAttributeCarrier::writeAttributeHelp(), RONet::writeIntermodal(), and NWWriter_OpenDrive::writeNetwork().

Here is the caller graph for this function:

◆ flush()

void OutputDevice::flush ( )
inlineinherited

Definition at line 349 of file OutputDevice.h.

References OutputDevice::getOStream().

Referenced by OutputDevice_CERR::postWriteHook(), OutputDevice_COUT::postWriteHook(), MSVehicleControl::removePending(), and MSMeanData::writeXMLOutput().

Here is the caller graph for this function:

◆ flushAll()

void OutputDevice::flushAll ( )
staticinherited

Flushes all registered devices

Definition at line 141 of file OutputDevice.cpp.

References OutputDevice::myOutputDevices.

Referenced by GUINet::flushOutputsAtEnd().

Here is the caller graph for this function:

◆ getDevice()

OutputDevice & OutputDevice::getDevice ( const std::string &  name,
bool  usePrefix = true 
)
staticinherited

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.

Parameters
[in]nameThe description of the output name/port/whatever
Returns
The corresponding (built or existing) device
Exceptions
IOErrorIf the output could not be built for any reason (error message is supplied)

Definition at line 60 of file OutputDevice.cpp.

References OutputDevice_CERR::getDevice(), OutputDevice_COUT::getDevice(), OptionsIO::getLoadTime(), OptionsCont::getOptions(), OutputDevice::getOStream(), OptionsCont::getString(), FileHelpers::isSocket(), OutputDevice::myOutputDevices, OutputDevice::myPrevConsoleCP, FileHelpers::prependToLastPathComponent(), OutputDevice::setPrecision(), StringUtils::substituteEnvironment(), TL, and StringUtils::toInt().

Referenced by MSDetectorControl::add(), MSDetectorControl::add(), NLDetectorBuilder::buildE2Detector(), NLDetectorBuilder::buildE2Detector(), NLDiscreteEventBuilder::buildSaveTLSProgramCommand(), NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), NLDetectorBuilder::buildVTypeProbe(), MSDevice_SSM::cleanup(), MSDevice_ToC::cleanup(), AStarRouter< E, V >::compute(), OutputDevice::createDeviceByOption(), NLDetectorBuilder::createInstantInductLoop(), GUIDetectorBuilder::createInstantInductLoop(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), OutputDevice::getDeviceByOption(), MsgHandler::initOutputOptions(), main(), MSCalibrator::MSCalibrator(), MSDevice_SSM::MSDevice_SSM(), MSDevice_ToC::MSDevice_ToC(), MsgHandler::MsgHandler(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_Breakpoints::onCmdSave(), GNESelectorFrame::SelectionOperation::onCmdSave(), GUIParameterTracker::onCmdSave(), GUIDialog_EditViewport::onCmdSave(), GNERunNetgenerateDialog::onCmdSaveLog(), GNERunPythonToolDialog::onCmdSaveLog(), GNEMultipleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNESingleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNEVTypeDistributionsDialog::ParametersOperations::onCmdSaveParameters(), GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(), GUIDialog_ViewSettings::onCmdSaveXMLDecals(), RONet::openOutput(), RandHelper::rand(), GUILoadThread::run(), RODFDetectorCon::save(), PCPolyContainer::save(), GUISelectedStorage::save(), GNENet::saveAdditionalsConfirmed(), RODFDetectorCon::saveAsPOIs(), GNEFixDemandElements::FixOptions::saveContents(), GNEFixNetworkElements::FixOptions::saveContents(), GNENet::saveDataElementsConfirmed(), GNENet::saveDemandElementsConfirmed(), PCPolyContainer::saveDlrTDP(), GNENet::saveEdgeTypes(), GNENet::saveJuPedSimElements(), GNENet::saveMeanDatasConfirmed(), RODFDetectorCon::saveRoutes(), MSStateHandler::saveState(), GNENet::saveTLSPrograms(), GNEViewNet::saveVisualizationSettings(), NWWriter_DlrNavteq::writeConnectedLanes(), NWWriter_XML::writeDistricts(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), RONet::writeIntermodal(), NWWriter_XML::writeJoinedJunctions(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_Amitran::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), MSNet::writeOutput(), NWWriter_XML::writeParkingAreas(), NWWriter_DlrNavteq::writeProhibitedManoeuvres(), NWWriter_XML::writePTLines(), NWWriter_XML::writePTStops(), NIImporter_OpenDrive::writeRoadObjects(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_XML::writeStreetSigns(), NWWriter_XML::writeTrafficLights(), NWWriter_DlrNavteq::writeTrafficSignals(), NWWriter_XML::writeTypes(), and RODFDetectorCon::writeValidationDetectors().

◆ getDeviceByOption()

OutputDevice & OutputDevice::getDeviceByOption ( const std::string &  name)
staticinherited

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.

Parameters
[in]nameThe name of the option to use for retrieving the output definition
Returns
The corresponding (built or existing) device
Exceptions
IOErrorIf the output could not be built for any reason (error message is supplied)
InvalidArgumentIf the option with the given name does not exist

Definition at line 131 of file OutputDevice.cpp.

References OutputDevice::getDevice(), OptionsCont::getOptions(), OptionsCont::getString(), and OutputDevice::myOutputDevices.

Referenced by MSRoutingEngine::adaptEdgeEfforts(), MSNet::closeSimulation(), computeAllPairs(), computeRoutes(), MSTransportableControl::erase(), MSDevice_Tripinfo::generateOutputForUnfinished(), MSRailSignalControl::haveDeadlock(), MSDevice_Vehroutes::init(), MSStopOut::init(), MSPModel_JuPedSim::initialize(), MSAbstractLaneChangeModel::laneChangeOutput(), main(), MSDispatch::MSDispatch(), MSTransportableControl::MSTransportableControl(), MSVehicleControl::removePending(), GNEAttributeCarrier::writeAttributeHelp(), MSNet::writeChargingStationOutput(), MSNet::writeCollisions(), RONet::writeIntermodal(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), MSNet::writeOverheadWireSegmentOutput(), MSNet::writeRailSignalBlocks(), MSNet::writeStatistics(), MSNet::writeSubstationOutput(), and MSNet::writeSummaryOutput().

Here is the caller graph for this function:

◆ getFilename()

const std::string & OutputDevice::getFilename ( )
inherited

get filename or suitable description of this device

Definition at line 223 of file OutputDevice.cpp.

References OutputDevice::myFilename.

◆ getOStream()

std::ostream & OutputDevice_File::getOStream ( )
overrideprotectedvirtual

Returns the associated ostream.

Returns
The used stream

Implements OutputDevice.

Definition at line 81 of file OutputDevice_File.cpp.

References myFileStream.

◆ getPrecision()

int OutputDevice::getPrecision ( )
inlineinherited

Returns the precision of the underlying stream.

Definition at line 177 of file OutputDevice.h.

References OutputDevice::getOStream().

Referenced by GUIPropertyScheme< T >::save().

Here is the caller graph for this function:

◆ inform()

void OutputDevice::inform ( const std::string &  msg,
const bool  progress = false 
)
inherited

Retrieves a message to this device.

Implementation of the MessageRetriever interface. Writes the given message to the output device.

Parameters
[in]msgThe msg to write to the device

Definition at line 295 of file OutputDevice.cpp.

References OutputDevice::getOStream(), and OutputDevice::postWriteHook().

◆ isNull()

bool OutputDevice_File::isNull ( )
inlineoverridevirtual

returns the information whether the device will discard all output

Returns
Whether the device redirects to /dev/null

Reimplemented from OutputDevice.

Definition at line 54 of file OutputDevice_File.h.

References myAmNull.

◆ lf()

void OutputDevice::lf ( )
inlineinherited

◆ ok()

bool OutputDevice::ok ( )
virtualinherited

returns the information whether one can write into the device

Returns
Whether the device can be used (stream is good)

Definition at line 217 of file OutputDevice.cpp.

References OutputDevice::getOStream().

◆ openTag() [1/2]

OutputDevice & OutputDevice::openTag ( const std::string &  xmlElement)
inherited

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.

Parameters
[in]xmlElementName of element to open
Returns
The OutputDevice for further processing

Definition at line 267 of file OutputDevice.cpp.

References OutputDevice::getOStream(), OutputDevice::myFormatter, and OutputFormatter::openTag().

Referenced by MSDriveWay::_saveState(), MSRoutingEngine::adaptEdgeEfforts(), RORouteHandler::addStop(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), computeRoutes(), MSRoute::dict_saveState(), MSDispatch_GreedyShared::dispatch(), MSDispatch_RouteExtension::dispatch(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), MSVTypeProbe::execute(), MSDevice_SSM::flushGlobalMeasures(), MSDevice_Bluelight::generateOutput(), MSDevice_ElecHybrid::generateOutput(), MSDevice_Emissions::generateOutput(), MSDevice_Example::generateOutput(), MSDevice_Taxi::generateOutput(), MSDevice_Tripinfo::generateOutput(), MSDevice_Battery::generateOutput(), MSDevice_StationFinder::generateOutput(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSRailSignalControl::haveDeadlock(), MSAbstractLaneChangeModel::laneChangeOutput(), RORouteHandler::myStartElement(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_EditViewport::onCmdSave(), GNEMultipleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNESingleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNEVTypeDistributionsDialog::ParametersOperations::onCmdSaveParameters(), GUIDialog_ViewSettings::onCmdSaveXMLDecals(), MSMeanData::openInterval(), MSMeanData_Amitran::openInterval(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageTrip::routeOutput(), MSStageWaiting::routeOutput(), MSStageWalking::routeOutput(), RODFDetectorCon::save(), GUIVisualizationSettings::save(), GUIPropertyScheme< T >::save(), RODFRouteCont::save(), RODFDetectorCon::saveAsPOIs(), ROPerson::PersonTrip::saveAsXML(), ROPerson::Ride::saveAsXML(), ROPerson::Walk::saveAsXML(), GUIDialog_ViewSettings::saveDecals(), GNENet::saveEdgeTypes(), MSStateHandler::saveRNGs(), MSLane::saveRNGStates(), MSStateHandler::saveState(), MSEdgeControl::saveState(), MSLane::saveState(), MSVehicleControl::saveState(), MSVehicleTransfer::saveState(), MSRailSignalConstraint::saveState(), MSRailSignalConstraint_Predecessor::PassedTracker::saveState(), MESegment::saveState(), MSDevice_Routing::saveState(), MSDevice_Transportable::saveState(), MSDevice_Tripinfo::saveState(), MSDevice_Vehroutes::saveState(), MSTransportableDevice_Routing::saveState(), MSDevice_Battery::saveState(), MSDevice_StationFinder::saveState(), MSSimpleTrafficLightLogic::saveState(), GNENet::saveTLSPrograms(), GNEViewNet::saveVisualizationSettings(), MSStopOut::stopEnded(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSStageWalking::tripInfoOutput(), MSInstantInductLoop::write(), SUMOVTypeParameter::write(), SUMOVehicleParameter::Stop::write(), SUMOVehicleParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), NBPTLine::write(), NBPTStop::write(), NBParking::write(), MSXMLRawOut::write(), MSElecHybridExport::write(), MSFullExport::write(), MSQueueExport::write(), MSFCDExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), MSRailSignalConstraint_Predecessor::write(), ODMatrix::write(), GNEAccess::writeAdditional(), GNEBusStop::writeAdditional(), GNECalibrator::writeAdditional(), GNECalibratorFlow::writeAdditional(), GNEChargingStation::writeAdditional(), GNEClosingLaneReroute::writeAdditional(), GNEClosingReroute::writeAdditional(), GNEContainerStop::writeAdditional(), GNEDestProbReroute::writeAdditional(), GNEEntryExitDetector::writeAdditional(), GNEInductionLoopDetector::writeAdditional(), GNEInstantInductionLoopDetector::writeAdditional(), GNELaneAreaDetector::writeAdditional(), GNEMultiEntryExitDetector::writeAdditional(), GNEOverheadWire::writeAdditional(), GNEParkingArea::writeAdditional(), GNEParkingAreaReroute::writeAdditional(), GNEParkingSpace::writeAdditional(), GNERerouter::writeAdditional(), GNERerouterInterval::writeAdditional(), GNERouteProbe::writeAdditional(), GNERouteProbReroute::writeAdditional(), GNETAZ::writeAdditional(), GNETAZSourceSink::writeAdditional(), GNETractionSubstation::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSign::writeAdditional(), GNEVariableSpeedSignStep::writeAdditional(), MSElecHybridExport::writeAggregated(), MSChargingStation::writeAggregatedChargingStationOutput(), MSLink::writeApproaching(), NBSign::writeAsPOI(), MSDriveWay::writeBlocks(), MSRailSignal::writeBlocks(), MSDriveWay::writeBlockVehicles(), MSChargingStation::writeChargingStationOutput(), MSNet::writeCollisions(), NWWriter_SUMO::writeConnection(), Command_SaveTLSProgram::writeCurrent(), GNEDataSet::writeDataSet(), GNEPersonTrip::writeDemandElement(), GNERide::writeDemandElement(), GNERoute::writeDemandElement(), GNERouteDistribution::writeDemandElement(), GNEStop::writeDemandElement(), GNEStopPlan::writeDemandElement(), GNETranship::writeDemandElement(), GNETransport::writeDemandElement(), GNEVTypeDistribution::writeDemandElement(), GNEWalk::writeDemandElement(), MSDriveWay::writeDepatureBlocks(), NWWriter_SUMO::writeDistrict(), MSMeanData::writeEdge(), NWWriter_SUMO::writeEdge(), MSFullExport::writeEdge(), MSQueueExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NBTypeCont::writeEdgeTypes(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), ODMatrix::writeFlows(), GNEEdgeData::writeGenericData(), GNEEdgeRelData::writeGenericData(), GNETAZRelData::writeGenericData(), NWWriter_OpenDrive::writeGeomLines(), NWWriter_OpenDrive::writeGeomPP3(), RONet::writeIntermodal(), NWWriter_SUMO::writeInternalConnection(), NWWriter_OpenDrive::writeInternalEdge(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writeInternalNodes(), ROMAAssignments::writeInterval(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), NWWriter_SUMO::writeLane(), MSFullExport::writeLane(), MSQueueExport::writeLane(), MSXMLRawOut::writeLane(), GeoConvHelper::writeLocation(), NBRequest::writeLogic(), GNEMeanData::writeMeanData(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), IntermodalRouter< E, L, N, V >::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_OpenDrive::writeNormalEdge(), GNEDemandElementPlan::writeOriginStop(), MSDevice_SSM::writeOutConflict(), MSDevice_ToC::writeOutput(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), MSOverheadWire::writeOverheadWireSegmentOutput(), Parameterised::writeParams(), MSMeanData::writePrefix(), MSMeanData_Amitran::writePrefix(), NWWriter_SUMO::writeProhibitions(), MSDevice_Tripinfo::writeRideStatistics(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), NWWriter_OpenDrive::writeRoadObjects(), NWWriter_SUMO::writeRoundabout(), NWWriter_OpenDrive::writeSignals(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), MSNet::writeStatistics(), MSDevice_Tripinfo::writeStatistics(), NWWriter_SUMO::writeStopOffsets(), MSNet::writeSummaryOutput(), MSFullExport::writeTLS(), MSTractionSubstation::writeTractionSubstationOutput(), NWWriter_SUMO::writeTrafficLight(), MSFCDExport::writeTransportable(), MSXMLRawOut::writeTransportable(), RODFDetectorCon::writeValidationDetectors(), MSXMLRawOut::writeVehicle(), MSAmitranTrajectories::writeVehicle(), MSChargingStation::writeVehicle(), MSOverheadWire::writeVehicle(), MSFullExport::writeVehicles(), IntermodalRouter< E, L, N, V >::writeWeights(), GUIDialog_EditViewport::writeXML(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), RORouteDef::writeXMLDefinition(), RORoute::writeXMLDefinition(), TrajectoriesHandler::writeXMLEmissions(), MEInductLoop::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

◆ openTag() [2/2]

OutputDevice & OutputDevice::openTag ( const SumoXMLTag xmlElement)
inherited

Opens an XML tag.

Helper method which finds the correct string before calling openTag.

Parameters
[in]xmlElementId of the element to open
Returns
The OutputDevice for further processing

Definition at line 274 of file OutputDevice.cpp.

References OutputDevice::getOStream(), OutputDevice::myFormatter, and OutputFormatter::openTag().

◆ operator<<()

template<class T >
OutputDevice & OutputDevice::operator<< ( const T &  t)
inlineinherited

Abstract output operator.

Returns
The OutputDevice for further processing

Definition at line 343 of file OutputDevice.h.

References OutputDevice::getOStream(), and OutputDevice::postWriteHook().

◆ postWriteHook()

void OutputDevice::postWriteHook ( )
protectedvirtualinherited

Called after every write access.

Default implementation does nothing.

Reimplemented in MsgRetrievingFunction< T >, GUIMessageWindow::MsgOutputDevice, OutputDevice_CERR, OutputDevice_COUT, and OutputDevice_Network.

Definition at line 291 of file OutputDevice.cpp.

Referenced by OutputDevice::closeTag(), OutputDevice::inform(), and OutputDevice::operator<<().

Here is the caller graph for this function:

◆ precision()

int OutputDevice::precision ( )
inherited

return precision set on the device

Definition at line 248 of file OutputDevice.cpp.

References OutputDevice::getOStream().

Referenced by OutputDevice::realString(), MSBaseVehicle::saveState(), OutputDevice::setPrecision(), and SUMOVehicleParameter::write().

Here is the caller graph for this function:

◆ realString()

std::string OutputDevice::realString ( const double  v,
const int  precision = gPrecision 
)
staticinherited

Helper method for string formatting.

Parameters
[in]vThe floating point value to be formatted
[in]precisionthe precision to achieve
Returns
The formatted string

Definition at line 186 of file OutputDevice.cpp.

References OutputDevice::precision().

Referenced by MSDevice_Emissions::generateOutput(), NBNodeCont::joinSameJunctions(), and MSMeanData_Emissions::MSLaneMeanDataValues::write().

Here is the caller graph for this function:

◆ setPrecision()

void OutputDevice::setPrecision ( int  precision = gPrecision)
inherited

Sets the precision or resets it to default.

Parameters
[in]precisionThe accuracy (number of digits behind '.') to set

Definition at line 242 of file OutputDevice.cpp.

References OutputDevice::getOStream(), and OutputDevice::precision().

Referenced by MSVTypeProbe::execute(), OutputDevice::getDevice(), MSPModel_JuPedSim::initialize(), OutputDevice_String::OutputDevice_String(), PCPolyContainer::save(), GUIPropertyScheme< T >::save(), ROPerson::PersonTrip::saveAsXML(), ROVehicle::saveAsXML(), PCPolyContainer::saveDlrTDP(), MSStateHandler::saveState(), MSBaseVehicle::saveState(), MSTransportable::saveState(), SUMOVehicleParameter::write(), MSXMLRawOut::write(), MSElecHybridExport::write(), MSFCDExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), MSElecHybridExport::writeAggregated(), NWWriter_SUMO::writeConnection(), ODMatrix::writeFlows(), NWWriter_OpenDrive::writeInternalEdge(), GeoConvHelper::writeLocation(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writeNormalEdge(), MSDevice_Vehroutes::writeOutput(), NWWriter_OpenDrive::writeRoadObjects(), NWWriter_XML::writeShape(), NWWriter_OpenDrive::writeSignals(), MSDevice_Tripinfo::writeStatistics(), MSNet::writeSubstationOutput(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFCDExport::writeTransportable(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), and RORoute::writeXMLDefinition().

Here is the caller graph for this function:

◆ useAttribute()

bool OutputDevice::useAttribute ( const SumoXMLAttr  attr,
SumoXMLAttrMask  attributeMask 
) const
inlineinherited

Definition at line 259 of file OutputDevice.h.

Referenced by MSFCDExport::write(), OutputDevice::writeOptionalAttr(), and OutputDevice::writeOptionalAttr().

Here is the caller graph for this function:

◆ writeAttr() [1/2]

template<typename T >
OutputDevice & OutputDevice::writeAttr ( const std::string &  attr,
const T &  val 
)
inlineinherited

writes an arbitrary attribute

Parameters
[in]attrThe attribute (name)
[in]valThe attribute value
Returns
The OutputDevice for further processing

Definition at line 295 of file OutputDevice.h.

References OutputDevice::getOStream(), and PlainXMLFormatter::writeAttr().

◆ writeAttr() [2/2]

template<typename T >
OutputDevice & OutputDevice::writeAttr ( const SumoXMLAttr  attr,
const T &  val 
)
inlineinherited

writes a named attribute

Parameters
[in]attrThe attribute (name)
[in]valThe attribute value
Returns
The OutputDevice for further processing

Definition at line 254 of file OutputDevice.h.

References OutputDevice::getOStream(), and PlainXMLFormatter::writeAttr().

Referenced by MSDriveWay::_saveState(), MSRoutingEngine::adaptEdgeEfforts(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), computeRoutes(), MSRoute::dict_saveState(), MSDispatch_GreedyShared::dispatch(), MSDispatch_RouteExtension::dispatch(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), MSVTypeProbe::execute(), MSDevice_SSM::flushGlobalMeasures(), MSDevice_ElecHybrid::generateOutput(), MSDevice_Emissions::generateOutput(), MSDevice_Example::generateOutput(), MSDevice_Taxi::generateOutput(), MSDevice_Tripinfo::generateOutput(), MSDevice_Battery::generateOutput(), MSDevice_StationFinder::generateOutput(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSRailSignalControl::haveDeadlock(), MSAbstractLaneChangeModel::laneChangeOutput(), MSDevice_Vehroutes::notifyStopEnded(), GUIDialog_ViewSettings::onCmdExportSetting(), GNEMultipleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNESingleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNEVTypeDistributionsDialog::ParametersOperations::onCmdSaveParameters(), MSMeanData::openInterval(), MSMeanData_Amitran::openInterval(), RONet::openOutput(), GUIVisualizationTextSettings::print(), GUIVisualizationRainbowSettings::print(), GUIVisualizationSizeSettings::print(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageTrip::routeOutput(), MSStageWaiting::routeOutput(), MSStageWalking::routeOutput(), MSTransportable::routeOutput(), RODFDetectorCon::save(), GUIVisualizationSettings::save(), GUIPropertyScheme< T >::save(), RODFRouteCont::save(), RODFDetectorCon::saveAsPOIs(), ROPerson::PersonTrip::saveAsXML(), ROPerson::Ride::saveAsXML(), ROPerson::Walk::saveAsXML(), ROVehicle::saveAsXML(), GUIDialog_ViewSettings::saveDecals(), MSStateHandler::saveRNGs(), MSLane::saveRNGStates(), MSStateHandler::saveState(), MEVehicle::saveState(), MSBaseVehicle::saveState(), MSEdgeControl::saveState(), MSInsertionControl::saveState(), MSLane::saveState(), MSVehicle::saveState(), MSVehicleControl::saveState(), MSVehicleTransfer::saveState(), MSRailSignalConstraint::saveState(), MSRailSignalConstraint_Predecessor::PassedTracker::saveState(), MSTransportable::saveState(), MSTransportableControl::saveState(), MESegment::saveState(), MSDevice_Routing::saveState(), MSDevice_Transportable::saveState(), MSDevice_Tripinfo::saveState(), MSDevice_Vehroutes::saveState(), MSTransportableDevice_Routing::saveState(), MSAbstractLaneChangeModel::saveState(), MSDevice_Battery::saveState(), MSDevice_StationFinder::saveState(), MSSimpleTrafficLightLogic::saveState(), GNEViewNet::saveVisualizationSettings(), MSStopOut::stopEnded(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSStageWalking::tripInfoOutput(), MSInstantInductLoop::write(), MSStop::write(), SUMOVTypeParameter::write(), SUMOVehicleParameter::Stop::write(), SUMOVehicleParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), NBPTLine::write(), NBPTStop::write(), NBParking::write(), MSElecHybridExport::write(), MSQueueExport::write(), MSFCDExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), MSRailSignalConstraint_Predecessor::write(), ODMatrix::write(), GNEAccess::writeAdditional(), GNEBusStop::writeAdditional(), GNECalibrator::writeAdditional(), GNECalibratorFlow::writeAdditional(), GNEChargingStation::writeAdditional(), GNEClosingLaneReroute::writeAdditional(), GNEClosingReroute::writeAdditional(), GNEContainerStop::writeAdditional(), GNEDestProbReroute::writeAdditional(), GNEEntryExitDetector::writeAdditional(), GNEInductionLoopDetector::writeAdditional(), GNEInstantInductionLoopDetector::writeAdditional(), GNELaneAreaDetector::writeAdditional(), GNEMultiEntryExitDetector::writeAdditional(), GNEOverheadWire::writeAdditional(), GNEParkingArea::writeAdditional(), GNEParkingAreaReroute::writeAdditional(), GNEParkingSpace::writeAdditional(), GNERerouter::writeAdditional(), GNERerouterInterval::writeAdditional(), GNERouteProbe::writeAdditional(), GNERouteProbReroute::writeAdditional(), GNETAZ::writeAdditional(), GNETAZSourceSink::writeAdditional(), GNETractionSubstation::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSign::writeAdditional(), GNEVariableSpeedSignStep::writeAdditional(), MSMeanData::writeAggregated(), MSElecHybridExport::writeAggregated(), MSChargingStation::writeAggregatedChargingStationOutput(), MSLink::writeApproaching(), NBSign::writeAsPOI(), MSDriveWay::writeBlocks(), MSRailSignal::writeBlocks(), MSDriveWay::writeBlockVehicles(), MSChargingStation::writeChargingStationOutput(), MSNet::writeCollisions(), NWWriter_SUMO::writeConnection(), Command_SaveTLSProgram::writeCurrent(), GNEDataSet::writeDataSet(), ODMatrix::writeDefaultAttrs(), GNEPersonTrip::writeDemandElement(), GNERide::writeDemandElement(), GNERoute::writeDemandElement(), GNERouteDistribution::writeDemandElement(), GNEStop::writeDemandElement(), GNEStopPlan::writeDemandElement(), GNETranship::writeDemandElement(), GNETransport::writeDemandElement(), GNEVehicle::writeDemandElement(), GNEVTypeDistribution::writeDemandElement(), GNEWalk::writeDemandElement(), MSDriveWay::writeDepatureBlocks(), GNEDetector::writeDetectorValues(), NWWriter_SUMO::writeDistrict(), MSMeanData::writeEdge(), NWWriter_SUMO::writeEdge(), MSFullExport::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NBTypeCont::writeEdgeTypes(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), GNEDemandElementFlow::writeFlowAttributes(), ODMatrix::writeFlows(), GNEEdgeData::writeGenericData(), GNEEdgeRelData::writeGenericData(), GNETAZRelData::writeGenericData(), NWWriter_OpenDrive::writeGeomLines(), NWWriter_OpenDrive::writeGeomPP3(), RONet::writeIntermodal(), NWWriter_SUMO::writeInternalConnection(), NWWriter_OpenDrive::writeInternalEdge(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writeInternalNodes(), ROMAAssignments::writeInterval(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), NWWriter_SUMO::writeLane(), MSFullExport::writeLane(), MSQueueExport::writeLane(), MSXMLRawOut::writeLane(), GeoConvHelper::writeLocation(), GNEDemandElementPlan::writeLocationAttributes(), NBRequest::writeLogic(), GNEMeanData::writeMeanData(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), IntermodalRouter< E, L, N, V >::writeNetwork(), NWWriter_XML::writeNodes(), OutputDevice::writeNonEmptyAttr(), NWWriter_OpenDrive::writeNormalEdge(), GNEDemandElementPlan::writeOriginStop(), MSDevice_SSM::writeOutConflict(), MSDevice_ToC::writeOutput(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), MSOverheadWire::writeOverheadWireSegmentOutput(), Parameterised::writeParams(), writePermissions(), NWFrame::writePositionLong(), writePreferences(), MSMeanData::writePrefix(), MSMeanData_Amitran::writePrefix(), NWWriter_SUMO::writeProhibitions(), MSDevice_Tripinfo::writeRideStatistics(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), NWWriter_SUMO::writeRoundabout(), NWWriter_XML::writeShape(), NWWriter_OpenDrive::writeSignals(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), MSNet::writeStatistics(), MSDevice_Tripinfo::writeStatistics(), NWWriter_SUMO::writeStopOffsets(), MSNet::writeSummaryOutput(), MSFullExport::writeTLS(), MSTractionSubstation::writeTractionSubstationOutput(), NWWriter_SUMO::writeTrafficLight(), MSFCDExport::writeTransportable(), MSXMLRawOut::writeTransportable(), RODFDetectorCon::writeValidationDetectors(), MSXMLRawOut::writeVehicle(), MSAmitranTrajectories::writeVehicle(), MSChargingStation::writeVehicle(), MSOverheadWire::writeVehicle(), MSFullExport::writeVehicles(), IntermodalRouter< E, L, N, V >::writeWeights(), GUIDialog_EditViewport::writeXML(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), RORouteDef::writeXMLDefinition(), RORoute::writeXMLDefinition(), TrajectoriesHandler::writeXMLEmissions(), MEInductLoop::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSCalibrator::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

◆ writeHeader()

template<typename E >
bool OutputDevice::writeHeader ( const SumoXMLTag rootElement)
inlineinherited

Definition at line 199 of file OutputDevice.h.

References OutputDevice::getOStream(), OutputDevice::myFormatter, and OutputDevice::writeHeader().

Referenced by RONet::openOutput(), MSStateHandler::saveState(), and OutputDevice::writeHeader().

Here is the caller graph for this function:

◆ writeNonEmptyAttr()

OutputDevice & OutputDevice::writeNonEmptyAttr ( const SumoXMLAttr  attr,
const std::string &  val 
)
inlineinherited

writes a string attribute only if it is not the empty string and not the string "default"

Parameters
[in]attrThe attribute (name)
[in]valThe attribute value
Returns
The OutputDevice for further processing

Definition at line 306 of file OutputDevice.h.

References OutputDevice::writeAttr().

Referenced by SUMOVehicleParameter::write(), and RODFDetector::writeEmitterDefinition().

Here is the caller graph for this function:

◆ writeOptionalAttr() [1/2]

template<typename T >
OutputDevice & OutputDevice::writeOptionalAttr ( const SumoXMLAttr  attr,
const T &  val,
long long int  attributeMask 
)
inlineinherited

writes a named attribute unless filtered

Parameters
[in]attrThe attribute (name)
[in]valThe attribute value
[in]attributeMaskThe filter that specifies whether the attribute shall be written
Returns
The OutputDevice for further processing

Definition at line 271 of file OutputDevice.h.

References OutputDevice::getOStream(), OutputDevice::useAttribute(), and PlainXMLFormatter::writeAttr().

Referenced by MSMeanData_Amitran::MSLaneMeanDataValues::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), MSFCDExport::write(), MSEmissionExport::write(), MSMeanData::writePrefix(), and MSFCDExport::writeTransportable().

Here is the caller graph for this function:

◆ writeOptionalAttr() [2/2]

template<typename T >
OutputDevice & OutputDevice::writeOptionalAttr ( const SumoXMLAttr  attr,
const T &  val,
SumoXMLAttrMask  attributeMask 
)
inlineinherited

◆ writePadding()

OutputDevice & OutputDevice::writePadding ( const std::string &  val)
inlineinherited

writes padding (ignored for binary output)

Definition at line 325 of file OutputDevice.h.

References OutputDevice::getOStream(), OutputDevice::myFormatter, and OutputFormatter::writePadding().

Referenced by Command_SaveTLSProgram::writeCurrent(), NBRequest::writeLogic(), and NWWriter_SUMO::writeTrafficLight().

Here is the caller graph for this function:

◆ writePreformattedTag()

OutputDevice & OutputDevice::writePreformattedTag ( const std::string &  val)
inlineinherited

writes a preformatted tag to the device but ensures that any pending tags are closed

Parameters
[in]valThe preformatted data
Returns
The OutputDevice for further processing

Definition at line 319 of file OutputDevice.h.

References OutputDevice::getOStream(), OutputDevice::myFormatter, and OutputFormatter::writePreformattedTag().

Referenced by computeRoutes(), RONet::saveAndRemoveRoutesUntil(), and NWWriter_OpenDrive::writeNetwork().

Here is the caller graph for this function:

◆ writeXMLHeader()

bool OutputDevice::writeXMLHeader ( const std::string &  rootElement,
const std::string &  schemaFile,
std::map< SumoXMLAttr, std::string >  attrs = std::map<SumoXMLAttr, std::string>(),
bool  includeConfig = true 
)
inherited

Writes an XML header with optional configuration.

If something has been written (myXMLStack is not empty), nothing is written and false returned.

Parameters
[in]rootElementThe root element to use
[in]schemaFileThe basename of the schema file to use
[in]attrsAdditional attributes to save within the rootElement
Returns
Whether the header could be written (stack was empty)
Todo:
Describe what is saved

Definition at line 254 of file OutputDevice.cpp.

References OutputDevice::getOStream(), OutputDevice::myFormatter, SUMO_ATTR_SCHEMA_LOCATION, SUMO_ATTR_XMLNS, and OutputFormatter::writeXMLHeader().

Referenced by Command_SaveTLSProgram::Command_SaveTLSProgram(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), OutputDevice::createDeviceByOption(), MSDispatch_RouteExtension::dispatch(), Command_SaveTLSState::execute(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSDevice_SSM::MSDevice_SSM(), MSDevice_ToC::MSDevice_ToC(), MSVTypeProbe::MSVTypeProbe(), GNEMultipleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNESingleParametersDialog::ParametersOperations::onCmdSaveParameters(), GNEVTypeDistributionsDialog::ParametersOperations::onCmdSaveParameters(), GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(), RODFDetectorCon::save(), PCPolyContainer::save(), GNENet::saveAdditionalsConfirmed(), RODFDetectorCon::saveAsPOIs(), GNENet::saveDataElementsConfirmed(), GNENet::saveDemandElementsConfirmed(), GNENet::saveJuPedSimElements(), GNENet::saveMeanDatasConfirmed(), RODFDetectorCon::saveRoutes(), NWWriter_XML::writeDistricts(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), MSNet::writeOutput(), NWWriter_XML::writeParkingAreas(), NWWriter_XML::writePTLines(), NWWriter_XML::writePTStops(), NIImporter_OpenDrive::writeRoadObjects(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_XML::writeStreetSigns(), NWWriter_XML::writeTrafficLights(), NWWriter_XML::writeTypes(), RODFDetectorCon::writeValidationDetectors(), MEInductLoop::writeXMLDetectorProlog(), MSE2Collector::writeXMLDetectorProlog(), MSE3Collector::writeXMLDetectorProlog(), MSInductLoop::writeXMLDetectorProlog(), MSInstantInductLoop::writeXMLDetectorProlog(), MSMeanData::writeXMLDetectorProlog(), MSMeanData_Amitran::writeXMLDetectorProlog(), MSCalibrator::writeXMLDetectorProlog(), and MSRouteProbe::writeXMLDetectorProlog().

◆ wroteHeader()

bool OutputDevice::wroteHeader ( ) const
inlineinherited

Definition at line 353 of file OutputDevice.h.

References OutputDevice::myFormatter, and OutputFormatter::wroteHeader().

Referenced by Command_SaveTLSState::execute().

Here is the caller graph for this function:

Field Documentation

◆ myAmNull

bool OutputDevice_File::myAmNull = false
private

am I redirecting to /dev/null

Definition at line 75 of file OutputDevice_File.h.

Referenced by isNull(), and OutputDevice_File().

◆ myFilename

const std::string OutputDevice::myFilename
protectedinherited

Definition at line 377 of file OutputDevice.h.

Referenced by OutputDevice::getFilename().

◆ myFileStream

std::ostream* OutputDevice_File::myFileStream = nullptr
private

The wrapped ofstream.

Definition at line 72 of file OutputDevice_File.h.

Referenced by getOStream(), OutputDevice_File(), and ~OutputDevice_File().

◆ myFormatter

◆ myOutputDevices

std::map< std::string, OutputDevice * > OutputDevice::myOutputDevices
staticprivateinherited

◆ myPrevConsoleCP

int OutputDevice::myPrevConsoleCP = -1
staticprivateinherited

old console code page to restore after ending

Definition at line 374 of file OutputDevice.h.

Referenced by OutputDevice::closeAll(), and OutputDevice::getDevice().


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