MCPcopy Create free account
hub / github.com/comaps/comaps / SplitExtendedHours

Function SplitExtendedHours

3party/opening_hours/rules_evaluation.cpp:131–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131osmoh::TTimespans SplitExtendedHours(osmoh::Timespan span)
132{
133 osmoh::TTimespans result;
134 NormalizeExtendedEnd(span);
135
136 auto spanToBeSplit = span;
137 if (spanToBeSplit.HasExtendedHours())
138 {
139 osmoh::Timespan normalSpan;
140 normalSpan.SetStart(spanToBeSplit.GetStart());
141 normalSpan.SetEnd(osmoh::HourMinutes(24_h));
142 result.push_back(normalSpan);
143
144 spanToBeSplit.SetStart(osmoh::HourMinutes(0_h));
145 spanToBeSplit.GetEnd().AddDuration(-24_h);
146 }
147 result.push_back(spanToBeSplit);
148
149 return result;
150}
151
152// Spans can be of three different types:
153// 1. Normal span - start time is less then end time and end time is less then 24h. Spans of this

Callers 1

IsActiveImplFunction · 0.85

Calls 13

NormalizeExtendedEndFunction · 0.85
HourMinutesClass · 0.85
HasExtendedHoursMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
SetStartMethod · 0.45
GetStartMethod · 0.45
SetEndMethod · 0.45
push_backMethod · 0.45
AddDurationMethod · 0.45
GetEndMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected