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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // An output device that encapsulates cout
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <iostream>
32 #include "OutputDevice_COUT.h"
33 
34 
35 // ===========================================================================
36 // static member definitions
37 // ===========================================================================
39 
40 
41 // ===========================================================================
42 // static method definitions
43 // ===========================================================================
46  // check whether the device has already been aqcuired
47  if (myInstance == 0) {
49  }
50  return myInstance;
51 }
52 
53 
54 // ===========================================================================
55 // method definitions
56 // ===========================================================================
58 
59 
61  myInstance = 0;
62 }
63 
64 
65 std::ostream&
67  return std::cout;
68 }
69 
70 
71 void
73  std::cout.flush();
74 }
75 
76 
77 /****************************************************************************/
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.
OutputDevice_COUT()
Constructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
static OutputDevice * myInstance
my singular instance