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

Method GetStatus

libs/transit/transit_schedule.cpp:357–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357Status Schedule::GetStatus(time_t const & time) const
358{
359 auto const & [date, wdIndex] = GetDateAndWeekIndex(time);
360
361 for (auto const & [dateException, freq] : m_serviceExceptions)
362 {
363 Status const & status = dateException.GetExceptionStatus(date);
364
365 if (status != Status::Unknown)
366 return status;
367 }
368
369 Status res = Status::Unknown;
370
371 for (auto const & [datesInterval, freq] : m_serviceIntervals)
372 {
373 Status const & status = datesInterval.GetStatusInInterval(date, wdIndex);
374
375 if (status != Status::Unknown)
376 res = status;
377
378 if (res == Status::Open)
379 return res;
380 }
381
382 return res;
383}
384
385Frequency Schedule::GetFrequency(time_t const & time) const
386{

Callers 1

UNIT_TESTFunction · 0.45

Calls 2

GetExceptionStatusMethod · 0.80
GetStatusInIntervalMethod · 0.80

Tested by 1

UNIT_TESTFunction · 0.36