Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
OutputDevice Class Referenceabstract

Static storage of an output device and its base (abstract) implementation. More...

#include <OutputDevice.h>

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

Data Structures

struct  Settings
 values of the output related options, handed over by SystemFrame so that this class does not depend on the options subsystem More...
 

Static Public Member Functions

static access methods to OutputDevices
static OutputDevice & getDevice (const std::string &name, bool usePrefix=true)
 Returns the described OutputDevice.
 
static bool deviceExists (const std::string &name)
 Returns whether a device with the given name has already been created.
 
static void flushAll ()
 
static void closeAll (bool keepErrorRetrievers=false)
 

Static Public Attributes

static Settings mySettings
 the output related option values, set by SystemFrame so that this class does not depend on the options subsystem
 

OutputDevice member methods

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
 
OutputFormatter * myFormatter
 The formatter for XML, CSV or Parquet.
 
 OutputDevice (const int defaultIndentation=0, const std::string &filename="")
 Constructor.
 
virtual ~OutputDevice ()
 Destructor.
 
virtual bool ok ()
 returns the information whether one can write into the device
 
virtual bool isNull ()
 returns the information whether the device will discard all output
 
const std::string & getFilename ()
 get filename or suitable description of this device
 
void close ()
 Closes the device and removes it from the dictionary.
 
bool isXML () const
 
void setFormatter (OutputFormatter *formatter)
 
void setPrecision (int precision=gPrecision)
 Sets the precision or resets it to default.
 
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.
 
OutputDevice & openTag (const std::string &xmlElement)
 Opens an XML tag.
 
OutputDevice & openTag (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 , class ATTR_TYPE >
OutputDevice & writeAttr (const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
 writes a named attribute
 
template<typename T >
OutputDevice & writeOptionalAttr (const SumoXMLAttr attr, const T &val, const bool isNull=false, const bool escape=false)
 writes a named attribute unless null
 
template<typename T >
OutputDevice & writeOptionalAttr (const SumoXMLAttr attr, const T &val, const SumoXMLAttrMask &attributeMask, const bool isNull=false, const bool escape=false)
 writes a named attribute unless filtered
 
template<typename Func >
OutputDevice & writeFuncAttr (const SumoXMLAttr attr, const Func &valFunc, const SumoXMLAttrMask &attributeMask, const bool isNull=false, const bool escape=false)
 writes a named attribute with a generating function unless filtered
 
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"
 
OutputDevice & writeTime (const SumoXMLAttr attr, const SUMOTime val)
 
OutputDevice & writePreformattedTag (const std::string &val)
 writes a preformatted tag to the device but ensures that any pending tags are closed
 
OutputDevice & writePadding (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 >
OutputDevice & operator<< (const T &t)
 Abstract output operator.
 
void flush ()
 
bool wroteHeader () const
 
void setExpectedAttributes (const SumoXMLAttrMask &expected, const int depth)
 
virtual std::ostream & getOStream ()=0
 Returns the associated ostream.
 
virtual void postWriteHook ()
 Called after every write access.
 
 OutputDevice (const OutputDevice &)=delete
 Invalidated copy constructor.
 
OutputDevice & operator= (const OutputDevice &)=delete
 Invalidated assignment operator.
 

Detailed Description

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 68 of file OutputDevice.h.

Constructor & Destructor Documentation

◆ OutputDevice() [1/2]

OutputDevice::OutputDevice ( const int  defaultIndentation = 0,
const std::string &  filename = "" 
)

Constructor.

Definition at line 191 of file OutputDevice.cpp.

◆ ~OutputDevice()

OutputDevice::~OutputDevice ( )
virtual

Destructor.

Definition at line 196 of file OutputDevice.cpp.

References myFormatter.

◆ OutputDevice() [2/2]

OutputDevice::OutputDevice ( const OutputDevice &  )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ close()

void OutputDevice::close ( )

Closes the device and removes it from the dictionary.

Definition at line 213 of file OutputDevice.cpp.

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

Referenced by RONet::cleanup(), AStarRouter< E, V, M >::compute(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIDialog_Breakpoints::onCmdSave(), GNESelectorFrame::SelectionOperation::onCmdSave(), GUIParameterTracker::onCmdSave(), GUIDialog_EditViewport::onCmdSave(), GNERunDialog::onCmdSaveLog(), GNERunNetgenerateDialog::onCmdSaveLog(), GNEParametersDialog::ParametersOperations::onCmdSaveParameters(), GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(), GUIDialog_ViewSettings::onCmdSaveXMLDecals(), RODFDetectorCon::save(), PCPolyContainer::save(), GUISelectedStorage::save(), GNENet::saveAdditionals(), RODFDetectorCon::saveAsPOIs(), GNEFixElementsDialog< T >::FixOptions::saveContents(), GNENet::saveDataElements(), GNENet::saveDemandElements(), PCPolyContainer::saveDlrTDP(), GNENet::saveEdgeTypes(), GNENet::saveJuPedSimElements(), GNENet::saveMeanDatas(), 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)
static

Closes all registered devices

Definition at line 152 of file OutputDevice.cpp.

References MsgHandler::getErrorInstance(), MsgHandler::isRetriever(), myOutputDevices, 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 = "")

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 260 of file OutputDevice.cpp.

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

Referenced by MSDriveWay::_saveState(), MSRoutingEngine::adaptEdgeEfforts(), RORouteHandler::addStop(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), MSDevice_SSM::cleanup(), MSDevice_ToC::cleanup(), close(), RORouteHandler::closeContainer(), RORouteHandler::closeContainerFlow(), computeRoutes(), MSInstantInductLoop::detectorUpdate(), 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(), GNEParametersDialog::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(), MSMoveReminder::saveReminderState(), MSStateHandler::saveRNGs(), MSLane::saveRNGStates(), MSStateHandler::saveState(), MEVehicle::saveState(), MSRoutingEngine::saveState(), MSEdgeControl::saveState(), MSInsertionControl::saveState(), MSLane::saveState(), MSVehicle::saveState(), MSVehicleControl::saveState(), MSVehicleTransfer::saveState(), MSRailSignalConstraint::saveState(), MSRailSignalConstraint_Predecessor::PassedTracker::saveState(), MSTLLogicControl::saveState(), MSTransportable::saveState(), MESegment::saveState(), MSDevice_Routing::saveState(), MSDevice_Taxi::saveState(), MSDevice_Transportable::saveState(), MSDevice_Tripinfo::saveState(), MSDevice_Vehroutes::saveState(), MSTransportableDevice_Routing::saveState(), MSDevice_Battery::saveState(), MSDevice_StationFinder::saveState(), MSInductLoop::saveState(), MSSimpleTrafficLightLogic::saveState(), MSCFModel_ACC::ACCVehicleVariables::saveState(), MSCFModel_CACC::CACCVehicleVariables::saveState(), MSCFModel_EIDM::VehicleVariables::saveState(), MSCFModel_IDM::VehicleVariables::saveState(), MSCFModel_Kerner::VehicleVariables::saveState(), MSCFModel_Krauss::VehicleVariables::saveState(), MSCFModel_PWag2009::VehicleVariables::saveState(), MSCFModel_Rail::RailVehicleVariables::saveState(), MSCFModel_SmartSK::SSKVehicleVariables::saveState(), MSCFModel_Wiedemann::VehicleVariables::saveState(), MSDispatch::saveState(), GNEViewNet::saveVisualizationSettings(), MSStopOut::stopEnded(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSStageWalking::tripInfoOutput(), MSStop::write(), SUMOVTypeParameter::write(), SUMOVehicleParameter::Stop::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), NBPTLine::write(), NBPTStop::write(), NBParking::write(), MSXMLRawOut::write(), MSFCDExport::write(), MSElecHybridExport::write(), MSEmissionExport::write(), MSFullExport::write(), MSQueueExport::write(), MSBatteryExport::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(), GNEPOI::writeAdditional(), GNEPoly::writeAdditional(), GNERerouter::writeAdditional(), GNERerouterInterval::writeAdditional(), GNERouteProbe::writeAdditional(), GNERouteProbReroute::writeAdditional(), GNETAZ::writeAdditional(), GNETractionSubstation::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSign::writeAdditional(), GNEVariableSpeedSignStep::writeAdditional(), MSMeanData::writeAggregated(), MSElecHybridExport::writeAggregated(), MSChargingStation::writeAggregatedChargingStationOutput(), MSMeanData::writeAggregatedTAZ(), 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(), GNERouteRef::writeDemandElement(), GNEStopPlan::writeDemandElement(), GNETranship::writeDemandElement(), GNETransport::writeDemandElement(), GNEVehicle::writeDemandElement(), GNEVTypeDistribution::writeDemandElement(), GNEVTypeRef::writeDemandElement(), GNEWalk::writeDemandElement(), MSDriveWay::writeDepatureBlocks(), NWWriter_SUMO::writeDistrict(), MSMeanData::writeEdge(), NWWriter_SUMO::writeEdge(), MSFullExport::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(), MSQueueExport::writeInterval(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), NWWriter_SUMO::writeLane(), MSFullExport::writeLane(), MSXMLRawOut::writeLane(), MSQueueExport::writeLane(), GeoConvHelper::writeLocation(), NBRequest::writeLogic(), GNEMeanData::writeMeanData(), MSQueueExport::writeMesoQueue(), 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(), XMLHelpers::writeParams(), MSFullExport::writePersons(), NWWriter_DlrNavteq::writeProhibitedManoeuvresAttrs(), 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(), GNETAZSourceSink::writeTAZSourceSink(), 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(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), MSMeanData::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

◆ deviceExists()

static bool OutputDevice::deviceExists ( const std::string &  name)
inlinestatic

Returns whether a device with the given name has already been created.

Definition at line 109 of file OutputDevice.h.

References myOutputDevices.

Referenced by OptionsCont::getDeviceByOption().

Here is the caller graph for this function:

◆ flush()

void OutputDevice::flush ( )
inline

Definition at line 375 of file OutputDevice.h.

References getOStream().

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

Here is the caller graph for this function:

◆ flushAll()

void OutputDevice::flushAll ( )
static

Flushes all registered devices

Definition at line 144 of file OutputDevice.cpp.

References flush(), and myOutputDevices.

Referenced by GUINet::flushOutputsAtEnd().

Here is the caller graph for this function:

◆ getDevice()

OutputDevice & OutputDevice::getDevice ( const std::string &  name,
bool  usePrefix = true 
)
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.

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 58 of file OutputDevice.cpp.

References FileHelpers::appendBeforeExtension(), OutputDevice::Settings::columnHeader, OutputDevice::Settings::columnSeparator, OutputDevice::Settings::compression, OutputDevice::Settings::format, OutputDevice_CERR::getDevice(), OutputDevice_COUT::getDevice(), getOStream(), FileHelpers::isSocket(), OutputDevice::Settings::loadTime, myOutputDevices, myPrevConsoleCP, mySettings, OutputDevice::Settings::prefix, FileHelpers::prependToLastPathComponent(), setFormatter(), setPrecision(), StringUtils::substituteEnvironment(), OutputDevice::Settings::suffix, TL, StringUtils::toInt(), and WRITE_WARNING.

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, M >::compute(), OptionsCont::createDeviceByOption(), NLDetectorBuilder::createInstantInductLoop(), GUIDetectorBuilder::createInstantInductLoop(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), OptionsCont::getDeviceByOption(), SystemFrame::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(), GNERunDialog::onCmdSaveLog(), GNERunNetgenerateDialog::onCmdSaveLog(), GNEParametersDialog::ParametersOperations::onCmdSaveParameters(), GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(), GUIDialog_ViewSettings::onCmdSaveXMLDecals(), RONet::openOutput(), RandHelper::rand(), GUILoadThread::run(), RODFDetectorCon::save(), PCPolyContainer::save(), GUISelectedStorage::save(), GNENet::saveAdditionals(), RODFDetectorCon::saveAsPOIs(), GNEFixElementsDialog< T >::FixOptions::saveContents(), GNENet::saveDataElements(), GNENet::saveDemandElements(), PCPolyContainer::saveDlrTDP(), GNENet::saveEdgeTypes(), GNENet::saveJuPedSimElements(), GNENet::saveMeanDatas(), 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().

◆ getFilename()

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

get filename or suitable description of this device

Definition at line 208 of file OutputDevice.cpp.

References myFilename.

◆ getOStream()

virtual std::ostream & OutputDevice::getOStream ( )
protectedpure virtual

Returns the associated ostream.

Implemented in OutputDevice_CERR, OutputDevice_COUT, OutputDevice_Network, OutputDevice_String, MsgRetrievingFunction< T >, GUIMessageWindow::MsgOutputDevice, and OutputDevice_File.

Referenced by closeTag(), flush(), getDevice(), getPrecision(), inform(), lf(), ok(), openTag(), openTag(), operator<<(), setPrecision(), writeAttr(), writeFuncAttr(), writePadding(), writePreformattedTag(), writeTime(), and writeXMLHeader().

Here is the caller graph for this function:

◆ getPrecision()

int OutputDevice::getPrecision ( )
inline

Returns the precision of the underlying stream.

Definition at line 169 of file OutputDevice.h.

References getOStream().

Referenced by GUIPropertyScheme< T >::save(), MSBaseVehicle::saveState(), and SUMOVehicleParameter::write().

Here is the caller graph for this function:

◆ inform()

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

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 274 of file OutputDevice.cpp.

References getOStream(), and postWriteHook().

◆ isNull()

virtual bool OutputDevice::isNull ( )
inlinevirtual

returns the information whether the device will discard all output

Returns
Whether the device redirects to /dev/null

Reimplemented in OutputDevice_File.

Definition at line 142 of file OutputDevice.h.

Referenced by RONet::openOutput(), MSInstantInductLoop::write(), writeAttr(), writeFuncAttr(), writeOptionalAttr(), writeOptionalAttr(), MSE2Collector::writeXMLOutput(), and MSInductLoop::writeXMLOutput().

Here is the caller graph for this function:

◆ isXML()

bool OutputDevice::isXML ( ) const
inline

Definition at line 153 of file OutputDevice.h.

References OutputFormatter::getType(), myFormatter, and XML.

Referenced by MSDevice_Vehroutes::init(), and MSDevice_Vehroutes::writeOutput().

Here is the caller graph for this function:

◆ lf()

◆ ok()

bool OutputDevice::ok ( )
virtual

returns the information whether one can write into the device

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

Definition at line 202 of file OutputDevice.cpp.

References getOStream().

◆ openTag() [1/2]

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.

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

Definition at line 246 of file OutputDevice.cpp.

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

Referenced by MSDriveWay::_saveState(), MSRoutingEngine::adaptEdgeEfforts(), RORouteHandler::addStop(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), computeRoutes(), MSInstantInductLoop::detectorUpdate(), 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(), GNEParametersDialog::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(), MSMoveReminder::saveReminderState(), MSStateHandler::saveRNGs(), MSLane::saveRNGStates(), MSStateHandler::saveState(), MSRoutingEngine::saveState(), MSEdgeControl::saveState(), MSLane::saveState(), MSVehicleControl::saveState(), MSVehicleTransfer::saveState(), MSRailSignalConstraint::saveState(), MSRailSignalConstraint_Predecessor::PassedTracker::saveState(), MSTLLogicControl::saveState(), MESegment::saveState(), MSDevice_Routing::saveState(), MSDevice_Taxi::saveState(), MSDevice_Transportable::saveState(), MSDevice_Tripinfo::saveState(), MSDevice_Vehroutes::saveState(), MSTransportableDevice_Routing::saveState(), MSDevice_Battery::saveState(), MSDevice_StationFinder::saveState(), MSInductLoop::saveState(), MSSimpleTrafficLightLogic::saveState(), MSCFModel_ACC::ACCVehicleVariables::saveState(), MSCFModel_CACC::CACCVehicleVariables::saveState(), MSCFModel_EIDM::VehicleVariables::saveState(), MSCFModel_IDM::VehicleVariables::saveState(), MSCFModel_Kerner::VehicleVariables::saveState(), MSCFModel_Krauss::VehicleVariables::saveState(), MSCFModel_PWag2009::VehicleVariables::saveState(), MSCFModel_Rail::RailVehicleVariables::saveState(), MSCFModel_SmartSK::SSKVehicleVariables::saveState(), MSCFModel_Wiedemann::VehicleVariables::saveState(), MSDispatch::saveState(), GNENet::saveTLSPrograms(), GNEViewNet::saveVisualizationSettings(), MSStopOut::stopEnded(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSStageWalking::tripInfoOutput(), SUMOVTypeParameter::write(), SUMOVehicleParameter::Stop::write(), SUMOVehicleParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), NBPTLine::write(), NBPTStop::write(), NBParking::write(), MSXMLRawOut::write(), MSFCDExport::write(), MSElecHybridExport::write(), MSEmissionExport::write(), MSFullExport::write(), MSQueueExport::write(), MSBatteryExport::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(), GNEPOI::writeAdditional(), GNEPoly::writeAdditional(), GNERerouter::writeAdditional(), GNERerouterInterval::writeAdditional(), GNERouteProbe::writeAdditional(), GNERouteProbReroute::writeAdditional(), GNETAZ::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(), GNERouteRef::writeDemandElement(), GNEStop::writeDemandElement(), GNEStopPlan::writeDemandElement(), GNETranship::writeDemandElement(), GNETransport::writeDemandElement(), GNEVTypeDistribution::writeDemandElement(), GNEVTypeRef::writeDemandElement(), GNEWalk::writeDemandElement(), MSDriveWay::writeDepatureBlocks(), NWWriter_SUMO::writeDistrict(), MSMeanData::writeEdge(), NWWriter_SUMO::writeEdge(), MSFullExport::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(), MSQueueExport::writeInterval(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), NWWriter_SUMO::writeLane(), MSFullExport::writeLane(), MSXMLRawOut::writeLane(), MSQueueExport::writeLane(), GeoConvHelper::writeLocation(), NBRequest::writeLogic(), GNEMeanData::writeMeanData(), MSQueueExport::writeMesoQueue(), 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(), XMLHelpers::writeParams(), MSFullExport::writePersons(), MSMeanData::writePrefix(), MSMeanData_Amitran::writePrefix(), NWWriter_DlrNavteq::writeProhibitedManoeuvresAttrs(), 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(), GNETAZSourceSink::writeTAZSourceSink(), 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(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

◆ openTag() [2/2]

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

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 253 of file OutputDevice.cpp.

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

◆ operator<<()

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

Abstract output operator.

Returns
The OutputDevice for further processing

Definition at line 369 of file OutputDevice.h.

References getOStream(), and postWriteHook().

◆ operator=()

OutputDevice & OutputDevice::operator= ( const OutputDevice &  )
privatedelete

Invalidated assignment operator.

◆ postWriteHook()

void OutputDevice::postWriteHook ( )
protectedvirtual

Called after every write access.

Default implementation does nothing.

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

Definition at line 270 of file OutputDevice.cpp.

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

Here is the caller graph for this function:

◆ setExpectedAttributes()

void OutputDevice::setExpectedAttributes ( const SumoXMLAttrMask &  expected,
const int  depth 
)
inline

Definition at line 383 of file OutputDevice.h.

References myFormatter, and OutputFormatter::setExpectedAttributes().

Referenced by OptionsCont::createDeviceByOption(), and MSDevice_FCD::initOnce().

Here is the caller graph for this function:

◆ setFormatter()

void OutputDevice::setFormatter ( OutputFormatter *  formatter)
inline

Definition at line 157 of file OutputDevice.h.

References myFormatter.

Referenced by getDevice().

Here is the caller graph for this function:

◆ setPrecision()

void OutputDevice::setPrecision ( int  precision = gPrecision)

Sets the precision or resets it to default.

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

Definition at line 227 of file OutputDevice.cpp.

References getOStream().

Referenced by MSVTypeProbe::execute(), MSDevice_Emissions::generateOutput(), getDevice(), MSPModel_JuPedSim_legacy::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(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSXMLRawOut::write(), MSFCDExport::write(), MSElecHybridExport::write(), MSEmissionExport::write(), MSBatteryExport::write(), GNEPoly::writeAdditional(), MSElecHybridExport::writeAggregated(), MSEmissionExport::writeEmissions(), ODMatrix::writeFlows(), NWWriter_OpenDrive::writeInternalEdge(), GeoConvHelper::writeLocation(), GNEMoveElementView::writeMoveAttributes(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writeNormalEdge(), MSDevice_Vehroutes::writeOutput(), NWWriter_OpenDrive::writeRoadObjects(), NWWriter_SUMO::writeShape(), NWWriter_OpenDrive::writeSignals(), MSDevice_Tripinfo::writeStatistics(), MSNet::writeSubstationOutput(), NWWriter_SUMO::writeTrafficLight(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFCDExport::writeTransportable(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), and RORoute::writeXMLDefinition().

Here is the caller graph for this function:

◆ writeAttr()

template<typename T , class ATTR_TYPE >
OutputDevice & OutputDevice::writeAttr ( const ATTR_TYPE &  attr,
const T &  val,
const bool  isNull = false,
const bool  escape = false 
)
inline

writes a named attribute

The attribute is always written even with XML output. The isNull flag is only for tabular outputs.

Parameters
[in]attrThe attribute (name)
[in]valThe attribute value
[in]isNullWhether the value should be represented as None / null in output formats which support it
[in]escapeWhether the value should be processed by the escaping mechanism to filter invalid characters
Returns
The OutputDevice for further processing

Definition at line 240 of file OutputDevice.h.

References getOStream(), OutputFormatter::getType(), isNull(), myFormatter, writeAttr(), PlainXMLFormatter::writeAttr(), and XML.

Referenced by MSDriveWay::_saveState(), MSRoutingEngine::adaptEdgeEfforts(), AGActivityTripWriter::addTrip(), AGActivityTripWriter::AGActivityTripWriter(), computeRoutes(), MSInstantInductLoop::detectorUpdate(), 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(), GNEParametersDialog::ParametersOperations::onCmdSaveParameters(), MSMeanData::openInterval(), MSMeanData_Amitran::openInterval(), 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(), MSMoveReminder::saveReminderState(), MSStateHandler::saveRNGs(), MSLane::saveRNGStates(), MSStateHandler::saveState(), MEVehicle::saveState(), MSRoutingEngine::saveState(), MSBaseVehicle::saveState(), MSEdgeControl::saveState(), MSInsertionControl::saveState(), MSLane::saveState(), MSVehicle::saveState(), MSVehicleControl::saveState(), MSVehicleTransfer::saveState(), MSRailSignalConstraint::saveState(), MSRailSignalConstraint_Predecessor::PassedTracker::saveState(), MSTLLogicControl::saveState(), MSTransportable::saveState(), MSTransportableControl::saveState(), MESegment::saveState(), MSDevice_Routing::saveState(), MSDevice_Taxi::saveState(), MSDevice_Transportable::saveState(), MSDevice_Tripinfo::saveState(), MSDevice_Vehroutes::saveState(), MSTransportableDevice_Routing::saveState(), MSAbstractLaneChangeModel::saveState(), MSDevice_Battery::saveState(), MSDevice_StationFinder::saveState(), MSLCM_LC2013::saveState(), MSInductLoop::saveState(), MSCFModel_ACC::ACCVehicleVariables::saveState(), MSCFModel_CACC::CACCVehicleVariables::saveState(), MSCFModel_EIDM::VehicleVariables::saveState(), MSCFModel_IDM::VehicleVariables::saveState(), MSCFModel_Kerner::VehicleVariables::saveState(), MSCFModel_Krauss::VehicleVariables::saveState(), MSCFModel_PWag2009::VehicleVariables::saveState(), MSCFModel_Rail::RailVehicleVariables::saveState(), MSCFModel_SmartSK::SSKVehicleVariables::saveState(), MSCFModel_Wiedemann::VehicleVariables::saveState(), MSDispatch::saveState(), MSSimpleTrafficLightLogic::saveStateAttrs(), GNEViewNet::saveVisualizationSettings(), MSStopOut::stopEnded(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSStageWalking::tripInfoOutput(), MSStop::write(), SUMOVTypeParameter::write(), SUMOVehicleParameter::Stop::write(), SUMOVehicleParameter::write(), MSMeanData_Amitran::MSLaneMeanDataValues::write(), NBPTLine::write(), NBPTStop::write(), NBParking::write(), MSFCDExport::write(), MSElecHybridExport::write(), MSEmissionExport::write(), MSQueueExport::write(), MSBatteryExport::write(), MSRailSignalConstraint_Predecessor::write(), ODMatrix::write(), GNEAccess::writeAdditional(), GNEBusStop::writeAdditional(), GNECalibrator::writeAdditional(), GNECalibratorFlow::writeAdditional(), GNEChargingStation::writeAdditional(), GNEClosingLaneReroute::writeAdditional(), GNEClosingReroute::writeAdditional(), GNEContainerStop::writeAdditional(), GNEDestProbReroute::writeAdditional(), GNELaneAreaDetector::writeAdditional(), GNEMultiEntryExitDetector::writeAdditional(), GNEOverheadWire::writeAdditional(), GNEParkingArea::writeAdditional(), GNEParkingAreaReroute::writeAdditional(), GNEParkingSpace::writeAdditional(), GNEPOI::writeAdditional(), GNEPoly::writeAdditional(), GNERerouter::writeAdditional(), GNERerouterInterval::writeAdditional(), GNERouteProbe::writeAdditional(), GNERouteProbReroute::writeAdditional(), GNETAZ::writeAdditional(), GNETractionSubstation::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSign::writeAdditional(), GNEVariableSpeedSignStep::writeAdditional(), GNEAdditional::writeAdditionalAttributes(), MSMeanData::writeAggregated(), MSElecHybridExport::writeAggregated(), MSChargingStation::writeAggregatedChargingStationOutput(), MSMeanData::writeAggregatedTAZ(), MSLink::writeApproaching(), NBSign::writeAsPOI(), writeAttr(), MSDriveWay::writeBlocks(), MSRailSignal::writeBlocks(), MSDriveWay::writeBlockVehicles(), MSChargingStation::writeChargingStationOutput(), MSNet::writeCollisions(), NWWriter_SUMO::writeConnection(), NWWriter_DlrNavteq::writeConnectionAttrs(), Command_SaveTLSProgram::writeCurrent(), GNEDataSet::writeDataSet(), ODMatrix::writeDefaultAttrs(), GNEPersonTrip::writeDemandElement(), GNERide::writeDemandElement(), GNERoute::writeDemandElement(), GNERouteDistribution::writeDemandElement(), GNERouteRef::writeDemandElement(), GNEStop::writeDemandElement(), GNEStopPlan::writeDemandElement(), GNETranship::writeDemandElement(), GNETransport::writeDemandElement(), GNEVehicle::writeDemandElement(), GNEVTypeDistribution::writeDemandElement(), GNEVTypeRef::writeDemandElement(), GNEWalk::writeDemandElement(), MSDriveWay::writeDepatureBlocks(), GNEDetector::writeDetectorValues(), NWWriter_SUMO::writeDistrict(), MSMeanData::writeEdge(), NWWriter_SUMO::writeEdge(), MSFullExport::writeEdge(), NWWriter_DlrNavteq::writeEdgeAttrs(), NWWriter_XML::writeEdgesAndConnections(), NBTypeCont::writeEdgeTypes(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), ODMatrix::writeFlows(), writeFuncAttr(), 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(), MSQueueExport::writeInterval(), NWWriter_XML::writeJoinedJunctions(), NWWriter_SUMO::writeJunction(), NWWriter_SUMO::writeLane(), MSFullExport::writeLane(), MSXMLRawOut::writeLane(), MSQueueExport::writeLane(), GeoConvHelper::writeLocation(), GNEDemandElementPlan::writeLocationAttributes(), NBRequest::writeLogic(), GNEMeanData::writeMeanData(), MSQueueExport::writeMesoQueue(), GNEMoveElementLaneSingle::writeMoveAttributes(), GNEMoveElementView::writeMoveAttributes(), GNEMoveElementLaneDouble::writeMoveAttributes(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), IntermodalRouter< E, L, N, V >::writeNetwork(), NWWriter_XML::writeNodes(), writeNonEmptyAttr(), NWWriter_OpenDrive::writeNormalEdge(), writeOptionalAttr(), GNEDemandElementPlan::writeOriginStop(), MSDevice_SSM::writeOutConflict(), MSDevice_ToC::writeOutput(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), MSDevice_BTreceiver::BTreceiverUpdate::writeOutput(), MSOverheadWire::writeOverheadWireSegmentOutput(), XMLHelpers::writeParams(), XMLHelpers::writePermissions(), MSFullExport::writePersons(), NWFrame::writePositionLong(), MSMeanData::writePrefix(), MSMeanData_Amitran::writePrefix(), NWWriter_DlrNavteq::writeProhibitedManoeuvresAttrs(), NWWriter_SUMO::writeProhibitions(), MSDevice_Tripinfo::writeRideStatistics(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), NWWriter_SUMO::writeRoundabout(), NWWriter_SUMO::writeShape(), Shape::writeShapeAttributes(), NWWriter_OpenDrive::writeSignals(), RODFDetector::writeSingleSpeedTrigger(), RODFDetectorCon::writeSpeedTrigger(), MSNet::writeStatistics(), MSDevice_Tripinfo::writeStatistics(), NWWriter_SUMO::writeStopOffsets(), GNEStoppingPlace::writeStoppingPlaceAttributes(), MSNet::writeSummaryOutput(), GNETAZSourceSink::writeTAZSourceSink(), 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(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

◆ writeFuncAttr()

template<typename Func >
OutputDevice & OutputDevice::writeFuncAttr ( const SumoXMLAttr  attr,
const Func &  valFunc,
const SumoXMLAttrMask &  attributeMask,
const bool  isNull = false,
const bool  escape = false 
)
inline

writes a named attribute with a generating function unless filtered

This function should be used if generating the value needs an expensive function call which will not be executed if the value is filtered anyway.

Parameters
[in]attrThe attribute (name)
[in]valFuncThe function to generate the attribute value
[in]attributeMaskThe filter that specifies whether the attribute shall be written
[in]isNullWhether the value should be represented as None / null in output formats which support it
[in]escapeWhether the value should be processed by the escaping mechanism to filter invalid characters
Returns
The OutputDevice for further processing

Definition at line 303 of file OutputDevice.h.

References getOStream(), OutputFormatter::getType(), isNull(), myFormatter, writeAttr(), PlainXMLFormatter::writeAttr(), and XML.

Referenced by MSFCDExport::write(), and MSEmissionExport::writeEmissions().

Here is the caller graph for this function:

◆ writeNonEmptyAttr()

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

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 328 of file OutputDevice.h.

References 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,
const bool  isNull = false,
const bool  escape = false 
)
inline

writes a named attribute unless null

If isNull is true the attribute is not written with XML output. For tabular outputs the behavior is the same as writeAttr.

Parameters
[in]attrThe attribute (name)
[in]valThe attribute value
[in]isNullWhether the value should be filtered or represented as None / null in output formats which support it
[in]escapeWhether the value should be processed by the escaping mechanism to filter invalid characters
Returns
The OutputDevice for further processing

Definition at line 264 of file OutputDevice.h.

References OutputFormatter::getType(), isNull(), myFormatter, writeAttr(), and XML.

Referenced by MSMeanData_Amitran::MSLaneMeanDataValues::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), MSFCDExport::write(), MSEmissionExport::write(), NWWriter_SUMO::writeConnection(), NWWriter_XML::writeEdgesAndConnections(), NBTypeCont::writeEdgeTypes(), MSEmissionExport::writeEmissions(), NWWriter_XML::writeNodes(), writeOptionalAttr(), XMLHelpers::writePermissions(), XMLHelpers::writePreferences(), MSMeanData::writePrefix(), NWWriter_SUMO::writeShape(), NWWriter_SUMO::writeTrafficLight(), 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,
const SumoXMLAttrMask &  attributeMask,
const bool  isNull = false,
const bool  escape = false 
)
inline

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
[in]isNullWhether the value should be represented as None / null in output formats which support it
[in]escapeWhether the value should be processed by the escaping mechanism to filter invalid characters
Returns
The OutputDevice for further processing

Definition at line 281 of file OutputDevice.h.

References isNull(), and writeOptionalAttr().

◆ writePadding()

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

writes padding (ignored for binary output)

Definition at line 351 of file OutputDevice.h.

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

Referenced by MSMeanData_Emissions::MSLaneMeanDataValues::write(), 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)
inline

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 345 of file OutputDevice.h.

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

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

Here is the caller graph for this function:

◆ writeTime()

OutputDevice & OutputDevice::writeTime ( const SumoXMLAttr  attr,
const SUMOTime  val 
)
inline

Definition at line 335 of file OutputDevice.h.

References getOStream(), myFormatter, and OutputFormatter::writeTime().

Referenced by MSFCDExport::write(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), and MSInductLoop::writeXMLOutput().

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 
)

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 233 of file OutputDevice.cpp.

References getOStream(), 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(), OptionsCont::createDeviceByOption(), MSDispatch_RouteExtension::dispatch(), Command_SaveTLSState::execute(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSDevice_SSM::MSDevice_SSM(), MSDevice_ToC::MSDevice_ToC(), MSVTypeProbe::MSVTypeProbe(), GNEParametersDialog::ParametersOperations::onCmdSaveParameters(), GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(), RONet::openOutput(), RODFDetectorCon::save(), PCPolyContainer::save(), GNENet::saveAdditionals(), RODFDetectorCon::saveAsPOIs(), GNENet::saveDataElements(), GNENet::saveDemandElements(), GNENet::saveJuPedSimElements(), GNENet::saveMeanDatas(), RODFDetectorCon::saveRoutes(), MSStateHandler::saveState(), 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(), MSInstantInductLoop::writeXMLDetectorProlog(), MSMeanData::writeXMLDetectorProlog(), MSMeanData_Amitran::writeXMLDetectorProlog(), MSCalibrator::writeXMLDetectorProlog(), MSInductLoop::writeXMLDetectorProlog(), and MSRouteProbe::writeXMLDetectorProlog().

◆ wroteHeader()

bool OutputDevice::wroteHeader ( ) const
inline

Definition at line 379 of file OutputDevice.h.

References myFormatter, and OutputFormatter::wroteHeader().

Referenced by Command_SaveTLSState::execute().

Here is the caller graph for this function:

Field Documentation

◆ myFilename

const std::string OutputDevice::myFilename
protected

Definition at line 406 of file OutputDevice.h.

Referenced by getFilename().

◆ myFormatter

◆ myOutputDevices

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

map from names to output devices

Definition at line 400 of file OutputDevice.h.

Referenced by close(), closeAll(), deviceExists(), flushAll(), and getDevice().

◆ myPrevConsoleCP

int OutputDevice::myPrevConsoleCP = -1
staticprivate

old console code page to restore after ending

Definition at line 403 of file OutputDevice.h.

Referenced by closeAll(), and getDevice().

◆ mySettings

OutputDevice::Settings OutputDevice::mySettings
static

the output related option values, set by SystemFrame so that this class does not depend on the options subsystem

Definition at line 89 of file OutputDevice.h.

Referenced by getDevice(), and SystemFrame::updateOutputSettings().


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