SUMO - Simulation of Urban MObility
MSJunctionControl.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Container for junctions; performs operations on all stored junctions
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSJunctionControl.h"
34 #include "MSJunction.h"
35 #include "MSInternalJunction.h"
36 #include <algorithm>
37 
38 #ifdef CHECK_MEMORY_LEAKS
39 #include <foreign/nvwa/debug_new.h>
40 #endif // CHECK_MEMORY_LEAKS
41 
42 
43 // ===========================================================================
44 // member method definitions
45 // ===========================================================================
47 }
48 
49 
51 }
52 
53 
54 void
56  const std::vector<MSJunction*>& junctions = buildAndGetStaticVector();
57 #ifdef HAVE_INTERNAL_LANES
58  // initialize normal junctions before internal junctions
59  // (to allow calling getIndex() during initialization of internal junction links)
60  for (std::vector<MSJunction*>::const_iterator i = junctions.begin(); i != junctions.end(); ++i) {
61  if (dynamic_cast<MSInternalJunction*>(*i) == 0) {
62  (*i)->postloadInit();
63  }
64  }
65  for (std::vector<MSJunction*>::const_iterator i = junctions.begin(); i != junctions.end(); ++i) {
66  if (dynamic_cast<MSInternalJunction*>(*i) != 0) {
67  (*i)->postloadInit();
68  }
69  }
70 #else
71  for (std::vector<MSJunction*>::const_iterator i = junctions.begin(); i != junctions.end(); ++i) {
72  (*i)->postloadInit();
73  }
74 #endif
75 }
76 
77 
78 /****************************************************************************/
79 
~MSJunctionControl()
Destructor.
MSJunctionControl()
Constructor.
void postloadInitContainer()
Closes building of junctions.
const std::vector< MSJunction * > & buildAndGetStaticVector() const