diff options
Diffstat (limited to 'p2pvr/daemon/schedules.cpp')
-rw-r--r-- | p2pvr/daemon/schedules.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/p2pvr/daemon/schedules.cpp b/p2pvr/daemon/schedules.cpp index abb3b46..f70d44d 100644 --- a/p2pvr/daemon/schedules.cpp +++ b/p2pvr/daemon/schedules.cpp @@ -9,7 +9,7 @@ #include "p2Helpers.h" #include "containerIterator.h" #include "resources.h" -#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include <instanceStore.impl.h> ResourceString(Schedules_getCandidates, sql_Schedules_getCandidates); @@ -193,14 +193,14 @@ EpisodeGroup::IsShowingListValid(const Showings & showings) const Periods periods; Usage usage; - BOOST_FOREACH(const auto & s, showings) { + for (const auto & s : showings) { if (s) { periods.insert(Periods::value_type(s->startTime, {s->transportStreamId, 1})); periods.insert(Periods::value_type(s->stopTime, {s->transportStreamId, -1})); } } bool result = true; - BOOST_FOREACH(const auto & p, periods) { + for (const auto & p : periods) { auto & u = usage[p.second.trans]; u += p.second.offset; if (std::count_if(usage.begin(), usage.end(), [](const Usage::value_type & uv) { return uv.second > 0;}) > tuners) { @@ -292,9 +292,9 @@ Schedules::GetEpisodeIntersects(Episodes & all, Episodes & grouped) { for (Episodes::iterator aei = all.begin(); aei != all.end(); aei++) { const auto & ae = *aei; - BOOST_FOREACH(const auto & ge, grouped) { - BOOST_FOREACH(const auto & gs, ge->showings) { - BOOST_FOREACH(const auto & as, ae->showings) { + for (const auto & ge : grouped) { + for (const auto & gs : ge->showings) { + for (const auto & as : ae->showings) { if (gs->period.intersects(as->period)) { Logger()->messagebf(LOG_DEBUG, " added %s", ae->what); grouped.push_back(ae); @@ -324,7 +324,7 @@ Schedules::DoReschedule(const Ice::Current & ice) Showings allShowings; EpisodePtr cur; int minPriority = 0; - BOOST_FOREACH(const auto & c, episodes) { + for (const auto & c : episodes) { if (!cur || cur->what != c->What) { cur = new Episode(c->What); scheduleList.push_back(cur); @@ -336,9 +336,9 @@ Schedules::DoReschedule(const Ice::Current & ice) allShowings.push_back(s); } Logger()->messagebf(LOG_DEBUG, "%d episodes created, %s showings", scheduleList.size(), allShowings.size()); - BOOST_FOREACH(const auto & e, scheduleList) { + for (const auto & e : scheduleList) { Logger()->messagebf(LOG_DEBUG, " %s", e->what); - BOOST_FOREACH(const auto & s, e->showings) { + for (const auto & s : e->showings) { s->priority += 1 - minPriority; e->priority += s->priority; } @@ -363,7 +363,7 @@ Schedules::DoReschedule(const Ice::Current & ice) Logger()->messagebf(LOG_DEBUG, "group created with %d episodes", group.size()); double total = 1; // Measure and add the optional to not record - BOOST_FOREACH(const auto & e, group) { + for (const auto & e : group) { Logger()->messagebf(LOG_DEBUG, " %d * %d:%s", e->showings.size(), e->priority, e->what); e->showings.push_back(NULL); total *= e->showings.size(); @@ -373,13 +373,13 @@ Schedules::DoReschedule(const Ice::Current & ice) EpisodeGroupPtr sched = EpisodeGroupPtr(EpisodeGroupLoader::createNew(SchedulerAlgorithm, group)); sched->tuners = tunerCount; std::set<ShowingPtr> selected; - BOOST_FOREACH(const auto & s, sched->Solve()) { + for (const auto & s : sched->Solve()) { if (s) selected.insert(s); } - BOOST_FOREACH(const auto & c, group) { + for (const auto & c : group) { Logger()->messagebf(LOG_DEBUG, "Episode %s, %d options", c->what, c->showings.size()); - BOOST_FOREACH(const auto & i, c->showings) { + for (const auto & i : c->showings) { if (selected.find(i) != selected.end()) { Logger()->messagebf(LOG_DEBUG, " %s - %s (%d) <-", i->startTime, i->stopTime, i->transportStreamId); } @@ -389,15 +389,15 @@ Schedules::DoReschedule(const Ice::Current & ice) } } Logger()->message(LOG_DEBUG, "----------"); - BOOST_FOREACH(const auto & c, group) { + for (const auto & c : group) { bool found = false; - BOOST_FOREACH(const auto & i, c->showings) { + for (const auto & i : c->showings) { if (i && selected.find(i) != selected.end()) { found = true; break; } } - BOOST_FOREACH(const auto & i, c->showings) { + for (const auto & i : c->showings) { if (i) { records.push_back(RecordPtr(new Record(i->eventUid, found ? |