SUMO - Simulation of Urban MObility
MSTrigger.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-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 abstract device that changes the state of the micro simulation
19 /****************************************************************************/
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include "MSTrigger.h"
24 
25 
26 // ===========================================================================
27 // static member definitions
28 // ===========================================================================
29 std::set<MSTrigger*> MSTrigger::myInstances;
30 
31 
32 // ===========================================================================
33 // method definitions
34 // ===========================================================================
35 MSTrigger::MSTrigger(const std::string& id) :
36  Named(id) {
37  myInstances.insert(this);
38 }
39 
40 
42  myInstances.erase(this);
43 }
44 
45 
47  while (!myInstances.empty()) {
48  delete *myInstances.begin();
49  }
50 }
MSTrigger(const std::string &id)
Constructor.
Definition: MSTrigger.cpp:35
virtual ~MSTrigger()
Destructor.
Definition: MSTrigger.cpp:41
static std::set< MSTrigger * > myInstances
Definition: MSTrigger.h:68
static void cleanup()
properly deletes all trigger instances
Definition: MSTrigger.cpp:46
Base class for objects which have an id.
Definition: Named.h:45