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-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 /****************************************************************************/
17 // A container for distributions
18 /****************************************************************************/
19 #ifndef DistributionCont_h
20 #define DistributionCont_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <map>
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
45 public:
47  static bool dictionary(const std::string& type, const std::string& id,
48  Distribution* d);
49 
51  static Distribution* dictionary(const std::string& type,
52  const std::string& id);
53 
55  static void clear();
56 
57 private:
59  typedef std::map<std::string, Distribution*> DistDict;
60 
62  typedef std::map<std::string, DistDict> TypedDistDict;
63 
65  static TypedDistDict myDict;
66 
67 };
68 
69 
70 #endif
71 
72 /****************************************************************************/
73 
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. ...