regions Namespace Reference

CPP API: mio::regions Namespace Reference
mio::regions Namespace Reference

Contains utilities that depend on geographical regions. More...

Classes

struct  Region
 Index for enumerating subregions (cities, counties, etc.) of the modelled area. More...
 

Functions

 DECL_TYPESAFE (int, CountyId)
 Id of a county. More...
 
 DECL_TYPESAFE (int, DistrictId)
 
 DECL_TYPESAFE (int, StateId)
 Id of a state. More...
 
Range< std::vector< std::pair< Date, Date > >::const_iterator > get_holidays (StateId state)
 get the holidays in a german state. More...
 
Range< std::vector< std::pair< Date, Date > >::const_iterator > get_holidays (StateId state, Date start_date, Date end_date)
 get the holidays in a german state in a given time period. More...
 
StateId get_state_id (int county)
 get the id of the state that the specified county is in. More...
 

Detailed Description

Contains utilities that depend on geographical regions.

Function Documentation

◆ DECL_TYPESAFE() [1/3]

mio::regions::DECL_TYPESAFE ( int  ,
CountyId   
)

Id of a county.

Format ssxxx where ss is the id of the state that the county is in (first s may be 0) and xxx are other digits. Ids are generally not consecutive, even within one state.

◆ DECL_TYPESAFE() [2/3]

mio::regions::DECL_TYPESAFE ( int  ,
DistrictId   
)

◆ DECL_TYPESAFE() [3/3]

mio::regions::DECL_TYPESAFE ( int  ,
StateId   
)

Id of a state.

For Germany the Ids are: 1 = Schleswig-Holstein 2 = Hamburg 3 = Niedersachsen 4 = Bremen 5 = Nordrhein-Westfalen 6 = Hessen 7 = Rheinland-Pfalz 8 = Baden-Württemberg 9 = Bayern 10 = Saarland 11 = Berlin 12 = Brandenburg 13 = Mecklenburg-Vorpommern 14 = Sachsen 15 = Sachsen-Anhalt 16 = Thüringen

◆ get_holidays() [1/2]

Range< std::vector< std::pair< Date, Date > >::const_iterator > mio::regions::get_holidays ( StateId  state)

get the holidays in a german state.

Parameters
[in]stateid of the state.
Returns
range of pairs of start and end dates of holiday periods, sorted by start date.

◆ get_holidays() [2/2]

Range< std::vector< std::pair< Date, Date > >::const_iterator > mio::regions::get_holidays ( StateId  state,
Date  start_date,
Date  end_date 
)

get the holidays in a german state in a given time period.

The returned periods may not be completely included in the queried period, they may only partially overlap.

Parameters
[in]stateid of the state.
[in]start_datestart of the queried period.
[in]end_dateend of the queried period.
Returns
range of pairs of start and end dates of holiday periods, sorted by start date.

◆ get_state_id()

StateId mio::regions::get_state_id ( int  county)

get the id of the state that the specified county is in.

Parameters
[in,out]countya county id.