Eclipse SUMO - Simulation of Urban MObility
OutputDevice_CERR.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2004-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // An output device that encapsulates cout
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <iostream>
25 #include "OutputDevice_CERR.h"
26 
27 
28 // ===========================================================================
29 // static member definitions
30 // ===========================================================================
32 
33 
34 // ===========================================================================
35 // static method definitions
36 // ===========================================================================
39  // check whether the device has already been aqcuired
40  if (myInstance == nullptr) {
42  }
43  return myInstance;
44 }
45 
46 
47 // ===========================================================================
48 // method definitions
49 // ===========================================================================
51  myFilename = "CERR";
52 }
53 
54 
56  myInstance = nullptr;
57 }
58 
59 
60 std::ostream&
62  return std::cerr;
63 }
64 
65 
66 void
68  std::cerr.flush();
69 }
70 
71 
72 /****************************************************************************/
OutputDevice_CERR::myInstance
static OutputDevice * myInstance
my singular instance
Definition: OutputDevice_CERR.h:76
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
OutputDevice_CERR::~OutputDevice_CERR
~OutputDevice_CERR()
Destructor.
Definition: OutputDevice_CERR.cpp:55
OutputDevice_CERR::OutputDevice_CERR
OutputDevice_CERR()
Constructor.
Definition: OutputDevice_CERR.cpp:50
OutputDevice::myFilename
std::string myFilename
Definition: OutputDevice.h:359
OutputDevice_CERR.h
OutputDevice_CERR::getOStream
std::ostream & getOStream()
Returns the associated ostream.
Definition: OutputDevice_CERR.cpp:61
config.h
OutputDevice_CERR::getDevice
static OutputDevice * getDevice()
Returns the single cerr instance.
Definition: OutputDevice_CERR.cpp:38
OutputDevice_CERR::postWriteHook
virtual void postWriteHook()
Called after every write access.
Definition: OutputDevice_CERR.cpp:67