Eclipse SUMO - Simulation of Urban MObility
ODDistrictCont.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-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 /****************************************************************************/
17 // A container for districts
18 /****************************************************************************/
19 #ifndef ODDistrictCont_h
20 #define ODDistrictCont_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include "ODDistrict.h"
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
42 class ODDistrictCont : public NamedObjectCont<ODDistrict*> {
43 public:
46 
47 
50 
51 
66  std::string getRandomSourceFromDistrict(const std::string& name) const;
67 
68 
83  std::string getRandomSinkFromDistrict(const std::string& name) const;
84 
86  void loadDistricts(std::vector<std::string> files);
87 
89  void makeDistricts(const std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > >& districts);
90 
91 private:
94 
97 
98 
99 };
100 
101 
102 #endif
103 
104 /****************************************************************************/
105 
ODDistrictCont::~ODDistrictCont
~ODDistrictCont()
Destructor.
Definition: ODDistrictCont.cpp:46
ODDistrictCont::getRandomSourceFromDistrict
std::string getRandomSourceFromDistrict(const std::string &name) const
Returns the id of a random source from the named district.
Definition: ODDistrictCont.cpp:50
ODDistrictCont::loadDistricts
void loadDistricts(std::vector< std::string > files)
load districts from files
Definition: ODDistrictCont.cpp:70
NamedObjectCont
A map of named object pointers.
Definition: NamedObjectCont.h:44
ODDistrictCont::getRandomSinkFromDistrict
std::string getRandomSinkFromDistrict(const std::string &name) const
Returns the id of a random sink from the named district.
Definition: ODDistrictCont.cpp:60
ODDistrictCont::ODDistrictCont
ODDistrictCont()
Constructor.
Definition: ODDistrictCont.cpp:43
ODDistrictCont
A container for districts.
Definition: ODDistrictCont.h:42
NamedObjectCont.h
ODDistrictCont::operator=
ODDistrictCont & operator=(const ODDistrictCont &s)
invalidated assignment operator
config.h
ODDistrict.h
ODDistrictCont::makeDistricts
void makeDistricts(const std::map< std::string, std::pair< std::vector< std::string >, std::vector< std::string > > > &districts)
create districts from description
Definition: ODDistrictCont.cpp:89