regions.h Source File

CPP API: regions.h Source File
regions.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020-2026 MEmilio
3 *
4 * Authors: Daniel Abele
5 *
6 * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 #ifndef MIO_GEOGRAPHY_REGIONS_H
21 #define MIO_GEOGRAPHY_REGIONS_H
22 
23 #include "memilio/utils/date.h"
24 #include "memilio/utils/stl_util.h"
26 #include "memilio/utils/index.h"
27 
28 namespace mio
29 {
33 namespace regions
34 {
35 
37 struct Region : public mio::Index<Region> {
38  Region(const size_t num_regions)
39  : mio::Index<Region>(num_regions)
40  {
41  }
42 };
43 
64 DECL_TYPESAFE(int, StateId);
65 
71 DECL_TYPESAFE(int, CountyId);
72 
73 DECL_TYPESAFE(int, DistrictId);
74 
79 StateId get_state_id(int county);
80 
86 Range<std::vector<std::pair<Date, Date>>::const_iterator> get_holidays(StateId state);
87 
97 Range<std::vector<std::pair<Date, Date>>::const_iterator> get_holidays(StateId state, Date start_date, Date end_date);
98 
99 } // namespace regions
100 } // namespace mio
101 
102 #endif // MIO_GEOGRAPHY_REGIONS_H
An Index with more than one template parameter combines several Index objects.
Definition: index.h:181
A range of items defined by two iterators.
Definition: stl_util.h:99
Range< std::vector< std::pair< Date, Date > >::const_iterator > get_holidays(StateId state)
get the holidays in a german state.
Definition: regions.cpp:37
StateId get_state_id(int county)
get the id of the state that the specified county is in.
Definition: regions.cpp:32
DECL_TYPESAFE(int, StateId)
Id of a state.
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
Simple date representation as year, month, and day.
Definition: date.h:50
Index for enumerating subregions (cities, counties, etc.) of the modelled area.
Definition: regions.h:37
Region(const size_t num_regions)
Definition: regions.h:38