summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/schedules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/daemon/schedules.cpp')
-rw-r--r--p2pvr/daemon/schedules.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/p2pvr/daemon/schedules.cpp b/p2pvr/daemon/schedules.cpp
index 389a979..4fd2054 100644
--- a/p2pvr/daemon/schedules.cpp
+++ b/p2pvr/daemon/schedules.cpp
@@ -19,14 +19,15 @@
namespace po = boost::program_options;
-IceTray::Logging::LoggerPtr Schedules::logger(LOGMANAGER()->getLogger<Schedules>());
+namespace P2PVR {
+IceTray::Logging::LoggerPtr SchedulesI::logger(LOGMANAGER()->getLogger<SchedulesI>());
-Schedules::Options::Options() :
+SchedulesI::Options::Options() :
IceTray::Options("P2PVR Scheduler options")
{
}
-ICETRAY_OPTIONS(Schedules::Options,
+ICETRAY_OPTIONS(SchedulesI::Options,
("p2pvr.scheduler.algorithm", po::value(&SchedulerAlgorithm)->default_value("BitDumb"),
"Implementation of episode group scheduler problem solver")
)
@@ -163,13 +164,13 @@ EpisodeGroup::SuggestWithFeedback(const Showings & showings)
}
}
-Schedules::Schedules(IceTray::DatabasePoolPtr db) :
+SchedulesI::SchedulesI(IceTray::DatabasePoolPtr db) :
IceTray::AbstractDatabaseClient(db)
{
}
void
-Schedules::GetEpisodeIntersects(Episodes & all, Episodes & grouped)
+SchedulesI::GetEpisodeIntersects(Episodes & all, Episodes & grouped)
{
for (Episodes::iterator aei = all.begin(); aei != all.end(); aei++) {
const auto & ae = *aei;
@@ -190,14 +191,14 @@ Schedules::GetEpisodeIntersects(Episodes & all, Episodes & grouped)
}
void
-Schedules::DoReschedule(const Ice::Current & ice)
+SchedulesI::DoReschedule(const Ice::Current & ice)
{
auto ic = ice.adapter->getCommunicator();
auto devs = P2PVR::DevicesPrx::checkedCast(ice.adapter->createProxy(ic->stringToIdentity("GlobalDevices")));
unsigned int tunerCount = devs->TunerCount();
// Load list from database
- auto episodes = fetch<P2PVR::ScheduleCandidates>(P2PVR::sql::schedules::getCandidates);
+ auto episodes = fetch<ScheduleCandidates>(P2PVR::sql::schedules::getCandidates);
Episodes scheduleList;
Showings allShowings;
@@ -298,7 +299,7 @@ Schedules::DoReschedule(const Ice::Current & ice)
}
void
-Schedules::DeleteSchedule(int id, const Ice::Current & ice)
+SchedulesI::DeleteSchedule(int id, const Ice::Current & ice)
{
auto dbc = db->get();
auto del = P2PVR::sql::schedules::deleteById.modify(dbc.get());
@@ -308,14 +309,14 @@ Schedules::DeleteSchedule(int id, const Ice::Current & ice)
}
P2PVR::ScheduleList
-Schedules::GetSchedules(const Ice::Current &)
+SchedulesI::GetSchedules(const Ice::Current &)
{
logger->message(LOG::DEBUG, __PRETTY_FUNCTION__);
return fetch<P2PVR::ScheduleList>(P2PVR::sql::schedules::selectAll);
}
P2PVR::SchedulePtr
-Schedules::GetSchedule(int id, const Ice::Current &)
+SchedulesI::GetSchedule(int id, const Ice::Current &)
{
logger->messagebf(LOG::DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
auto schedules = fetch<P2PVR::ScheduleList>(P2PVR::sql::schedules::selectById, id);
@@ -324,14 +325,14 @@ Schedules::GetSchedule(int id, const Ice::Current &)
}
P2PVR::ScheduledToRecordList
-Schedules::GetScheduledToRecord(const Ice::Current &)
+SchedulesI::GetScheduledToRecord(const Ice::Current &)
{
logger->message(LOG::DEBUG, __PRETTY_FUNCTION__);
return fetch<P2PVR::ScheduledToRecordList>(P2PVR::sql::schedules::scheduledToRecord);
}
Ice::Int
-Schedules::NewSchedule(const P2PVR::SchedulePtr & s, const Ice::Current & ice)
+SchedulesI::NewSchedule(const P2PVR::SchedulePtr & s, const Ice::Current & ice)
{
auto dbc = db->get();
Slicer::SerializeAny<Slicer::SqlFetchIdInsertSerializer>(s, dbc.get(), "schedules");
@@ -340,12 +341,13 @@ Schedules::NewSchedule(const P2PVR::SchedulePtr & s, const Ice::Current & ice)
}
void
-Schedules::UpdateSchedule(const P2PVR::SchedulePtr & s, const Ice::Current & ice)
+SchedulesI::UpdateSchedule(const P2PVR::SchedulePtr & s, const Ice::Current & ice)
{
auto dbc = db->get();
Slicer::SerializeAny<Slicer::SqlUpdateSerializer>(s, dbc.get(), "schedules");
DoReschedule(ice);
}
+}
-INSTANTIATEFACTORY(EpisodeGroup, const Episodes &);
+INSTANTIATEFACTORY(P2PVR::EpisodeGroup, const P2PVR::Episodes &);