SUMO - Simulation of Urban MObility
OutputDevice_COUT.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-2018 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 /****************************************************************************/
16 // An output device that encapsulates cout
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <iostream>
26 #include "OutputDevice_COUT.h"
27 
28 
29 // ===========================================================================
30 // static member definitions
31 // ===========================================================================
33 
34 
35 // ===========================================================================
36 // static method definitions
37 // ===========================================================================
40  // check whether the device has already been aqcuired
41  if (myInstance == nullptr) {
43  }
44  return myInstance;
45 }
46 
47 
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
52  myFilename = "COUT";
53 }
54 
55 
57  myInstance = nullptr;
58 }
59 
60 
61 std::ostream&
63  return std::cout;
64 }
65 
66 
67 void
69  std::cout.flush();
70 }
71 
72 
73 /****************************************************************************/
virtual void postWriteHook()
Called after every write access.
static OutputDevice * getDevice()
Returns the single cout instance.
~OutputDevice_COUT()
Destructor.
std::ostream & getOStream()
Returns the associated ostream.
std::string myFilename
Definition: OutputDevice.h:360
OutputDevice_COUT()
Constructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
static OutputDevice * myInstance
my singular instance