Eclipse SUMO - Simulation of Urban MObility
DistributionCont.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // A container for distributions
15 /****************************************************************************/
16 #ifndef DistributionCont_h
17 #define DistributionCont_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <map>
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
38 public:
40  static bool dictionary(const std::string& type, const std::string& id,
41  Distribution* d);
42 
44  static Distribution* dictionary(const std::string& type,
45  const std::string& id);
46 
48  static void clear();
49 
50 private:
52  typedef std::map<std::string, Distribution*> DistDict;
53 
55  typedef std::map<std::string, DistDict> TypedDistDict;
56 
59 
60 };
61 
62 
63 #endif
64 
65 /****************************************************************************/
66 
DistributionCont::clear
static void clear()
delete all stored distributions
Definition: DistributionCont.cpp:69
Distribution.h
Distribution
Definition: Distribution.h:37
DistributionCont::dictionary
static bool dictionary(const std::string &type, const std::string &id, Distribution *d)
Adds a distribution of the given type and name to the container.
Definition: DistributionCont.cpp:34
DistributionCont::DistDict
std::map< std::string, Distribution * > DistDict
Definition of a map from distribution ids to distributions.
Definition: DistributionCont.h:52
DistributionCont::myDict
static TypedDistDict myDict
Map from distribution types to distribution ids to distributions.
Definition: DistributionCont.h:58
DistributionCont
Definition: DistributionCont.h:37
config.h
DistributionCont::TypedDistDict
std::map< std::string, DistDict > TypedDistDict
Definition of a map from distribution types to distribution ids to distributions.
Definition: DistributionCont.h:55