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
41
MSTrigger::~MSTrigger
() {
42
myInstances
.erase(
this
);
43
}
44
45
46
void
MSTrigger::cleanup
() {
47
while
(!
myInstances
.empty()) {
48
delete
*
myInstances
.begin();
49
}
50
}
MSTrigger::MSTrigger
MSTrigger(const std::string &id)
Constructor.
Definition:
MSTrigger.cpp:35
MSTrigger::~MSTrigger
virtual ~MSTrigger()
Destructor.
Definition:
MSTrigger.cpp:41
MSTrigger.h
MSTrigger::myInstances
static std::set< MSTrigger * > myInstances
Definition:
MSTrigger.h:68
MSTrigger::cleanup
static void cleanup()
properly deletes all trigger instances
Definition:
MSTrigger.cpp:46
Named
Base class for objects which have an id.
Definition:
Named.h:45
src
microsim
trigger
MSTrigger.cpp
Generated on Fri Jun 29 2018 13:14:36 for SUMO - Simulation of Urban MObility by
1.8.13