Path: blob/main/src/utils/iodevices/OutputDevice_CERR.cpp
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2004-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file OutputDevice_CERR.cpp14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date 200417///18// An output device that encapsulates cout19/****************************************************************************/20#include <config.h>2122#include <iostream>23#include "OutputDevice_CERR.h"242526// ===========================================================================27// static member definitions28// ===========================================================================29OutputDevice* OutputDevice_CERR::myInstance = nullptr;303132// ===========================================================================33// static method definitions34// ===========================================================================35OutputDevice*36OutputDevice_CERR::getDevice() {37// check whether the device has already been aqcuired38if (myInstance == nullptr) {39myInstance = new OutputDevice_CERR();40}41return myInstance;42}434445// ===========================================================================46// method definitions47// ===========================================================================48OutputDevice_CERR::OutputDevice_CERR() : OutputDevice(0, "CERR") {49}505152OutputDevice_CERR::~OutputDevice_CERR() {53myInstance = nullptr;54}555657std::ostream&58OutputDevice_CERR::getOStream() {59return std::cerr;60}616263void64OutputDevice_CERR::postWriteHook() {65std::cerr.flush();66}676869/****************************************************************************/707172