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 /****************************************************************************/
16 // A container for districts
17 /****************************************************************************/
18 #ifndef ODDistrictCont_h
19 #define ODDistrictCont_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "ODDistrict.h"
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
41 class ODDistrictCont : public NamedObjectCont<ODDistrict*> {
42 public:
45 
46 
49 
50 
65  std::string getRandomSourceFromDistrict(const std::string& name) const;
66 
67 
82  std::string getRandomSinkFromDistrict(const std::string& name) const;
83 
85  void loadDistricts(std::vector<std::string> files);
86 
88  void makeDistricts(const std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > >& districts);
89 
90 private:
93 
96 
97 
98 };
99 
100 
101 #endif
102 
103 /****************************************************************************/
104 
ODDistrictCont::~ODDistrictCont
~ODDistrictCont()
Destructor.
Definition: ODDistrictCont.cpp:45
ODDistrictCont::getRandomSourceFromDistrict
std::string getRandomSourceFromDistrict(const std::string &name) const
Returns the id of a random source from the named district.
Definition: ODDistrictCont.cpp:49
ODDistrictCont::loadDistricts
void loadDistricts(std::vector< std::string > files)
load districts from files
Definition: ODDistrictCont.cpp:69
NamedObjectCont
A map of named object pointers.
Definition: NamedObjectCont.h:43
ODDistrictCont::getRandomSinkFromDistrict
std::string getRandomSinkFromDistrict(const std::string &name) const
Returns the id of a random sink from the named district.
Definition: ODDistrictCont.cpp:59
ODDistrictCont::ODDistrictCont
ODDistrictCont()
Constructor.
Definition: ODDistrictCont.cpp:42
ODDistrictCont
A container for districts.
Definition: ODDistrictCont.h:41
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:88