SUMO - Simulation of Urban MObility
OutputDevice_COUT.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 // An output device that encapsulates cout
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2004-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <iostream>
33 #include "OutputDevice_COUT.h"
34 
35 
36 // ===========================================================================
37 // static member definitions
38 // ===========================================================================
40 
41 
42 // ===========================================================================
43 // static method definitions
44 // ===========================================================================
47  // check whether the device has already been aqcuired
48  if (myInstance == 0) {
50  }
51  return myInstance;
52 }
53 
54 
55 // ===========================================================================
56 // method definitions
57 // ===========================================================================
59 
60 
62  myInstance = 0;
63 }
64 
65 
66 std::ostream&
68  return std::cout;
69 }
70 
71 
72 void
74  std::cout.flush();
75 }
76 
77 
78 /****************************************************************************/
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:71
static OutputDevice * myInstance
my singular instance