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-2018 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 /****************************************************************************/
15 // A container for distributions
16 /****************************************************************************/
17 #ifndef DistributionCont_h
18 #define DistributionCont_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <map>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 public:
41  static bool dictionary(const std::string& type, const std::string& id,
42  Distribution* d);
43 
45  static Distribution* dictionary(const std::string& type,
46  const std::string& id);
47 
49  static void clear();
50 
51 private:
53  typedef std::map<std::string, Distribution*> DistDict;
54 
56  typedef std::map<std::string, DistDict> TypedDistDict;
57 
59  static TypedDistDict myDict;
60 
61 };
62 
63 
64 #endif
65 
66 /****************************************************************************/
67 
static void clear()
delete all stored distributions
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.
static TypedDistDict myDict
Map from distribution types to distribution ids to distributions.
std::map< std::string, Distribution * > DistDict
Definition of a map from distribution ids to distributions.
std::map< std::string, DistDict > TypedDistDict
Definition of a map from distribution types to distribution ids to distributions. ...