diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-02 21:19:51 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-02 21:19:51 +0100 |
commit | 009c003f4235db50002ee732309dff175ac8f969 (patch) | |
tree | 596d7d66e6786ef3853283834d1093c9a74ba3e8 /p2pvr/daemon | |
parent | Update to work with system dbpp (diff) | |
download | p2pvr-009c003f4235db50002ee732309dff175ac8f969.tar.bz2 p2pvr-009c003f4235db50002ee732309dff175ac8f969.tar.xz p2pvr-009c003f4235db50002ee732309dff175ac8f969.zip |
Swtich everything to new libs/interfaces
Diffstat (limited to 'p2pvr/daemon')
-rw-r--r-- | p2pvr/daemon/daemon.cpp | 2 | ||||
-rw-r--r-- | p2pvr/daemon/schedulers/bitDumbScheduler.cpp | 2 | ||||
-rw-r--r-- | p2pvr/daemon/schedules.cpp | 6 | ||||
-rw-r--r-- | p2pvr/daemon/schedules.h | 4 | ||||
-rw-r--r-- | p2pvr/daemon/unittests/testp2ice.cpp | 14 |
5 files changed, 15 insertions, 13 deletions
diff --git a/p2pvr/daemon/daemon.cpp b/p2pvr/daemon/daemon.cpp index 374a8b4..874ea3b 100644 --- a/p2pvr/daemon/daemon.cpp +++ b/p2pvr/daemon/daemon.cpp @@ -49,5 +49,5 @@ class P2PvrDaemon : public DaemonBase { } }; -DECLARE_GENERIC_LOADER("p2pvrdaemon", DaemonLoader, P2PvrDaemon); +NAMEDFACTORY("p2pvrdaemon", P2PvrDaemon, DaemonFactory); diff --git a/p2pvr/daemon/schedulers/bitDumbScheduler.cpp b/p2pvr/daemon/schedulers/bitDumbScheduler.cpp index eb40431..1681103 100644 --- a/p2pvr/daemon/schedulers/bitDumbScheduler.cpp +++ b/p2pvr/daemon/schedulers/bitDumbScheduler.cpp @@ -51,5 +51,5 @@ class TheBitDumbScheduler : public EpisodeGroup { const Episodes episodes; }; -DECLARE_GENERIC_LOADER("BitDumb", EpisodeGroupLoader, TheBitDumbScheduler); +NAMEDFACTORY("BitDumb", TheBitDumbScheduler, EpisodeGroupFactory); diff --git a/p2pvr/daemon/schedules.cpp b/p2pvr/daemon/schedules.cpp index 5e3881d..40d7863 100644 --- a/p2pvr/daemon/schedules.cpp +++ b/p2pvr/daemon/schedules.cpp @@ -10,7 +10,7 @@ #include "containerIterator.h" #include "resources.h" #include <boost/date_time/posix_time/posix_time.hpp> -#include <instanceStore.impl.h> +#include <factory.impl.h> #include "sqlSelectDeserializer.h" #include <slicer/slicer.h> #include <p2pvr-int.h> @@ -246,7 +246,7 @@ Schedules::DoReschedule(const Ice::Current & ice) } Logger()->messagebf(LOG_DEBUG, "group complexity of %d options", total); - EpisodeGroupPtr sched = EpisodeGroupPtr(EpisodeGroupLoader::createNew(SchedulerAlgorithm, group)); + EpisodeGroupPtr sched = EpisodeGroupPtr(EpisodeGroupFactory::createNew(SchedulerAlgorithm, group)); sched->tuners = tunerCount; std::set<ShowingPtr> selected; for (const auto & s : sched->Solve()) { @@ -346,5 +346,5 @@ Schedules::UpdateSchedule(const P2PVR::SchedulePtr & s, const Ice::Current & ice return s->ScheduleId; } -INSTANTIATESTORE(std::string, EpisodeGroupLoader); +INSTANTIATEFACTORY(EpisodeGroup, const Episodes &); diff --git a/p2pvr/daemon/schedules.h b/p2pvr/daemon/schedules.h index 2ff9e0f..07f2c23 100644 --- a/p2pvr/daemon/schedules.h +++ b/p2pvr/daemon/schedules.h @@ -4,7 +4,7 @@ #include <p2pvr.h> #include <options.h> #include "dbClient.h" -#include <genLoader.h> +#include <factory.h> typedef boost::posix_time::ptime datetime; class Episode; @@ -77,7 +77,7 @@ class Schedules : public P2PVR::Schedules, public DatabaseClient { static std::string SchedulerAlgorithm; }; -typedef GenLoader<EpisodeGroup, std::string, const Episodes &> EpisodeGroupLoader; +typedef AdHoc::Factory<EpisodeGroup, const Episodes &> EpisodeGroupFactory; typedef boost::shared_ptr<EpisodeGroup> EpisodeGroupPtr; #endif diff --git a/p2pvr/daemon/unittests/testp2ice.cpp b/p2pvr/daemon/unittests/testp2ice.cpp index 8229bf5..dc584b6 100644 --- a/p2pvr/daemon/unittests/testp2ice.cpp +++ b/p2pvr/daemon/unittests/testp2ice.cpp @@ -5,6 +5,8 @@ #include <definedDirs.h> #include <sourceObject.h> #include <testAppInstance.h> +#include <stream.h> +#include <rowSet.h> const boost::filesystem::path variant = binDir.leaf(); const boost::filesystem::path compiler = binDir.parent_path().leaf(); @@ -15,19 +17,19 @@ static void commonTests() { - BOOST_REQUIRE(ElementLoader::getFor("p2pvrrecordingstream")); - BOOST_REQUIRE(ElementLoader::getFor("p2pvrservicestream")); - BOOST_REQUIRE(ElementLoader::getFor("P2PVR-SI-GetEvent")); + BOOST_REQUIRE(StreamFactory::get("p2pvrrecordingstream")); + BOOST_REQUIRE(StreamFactory::get("p2pvrservicestream")); + BOOST_REQUIRE(RowSetFactory::get("P2PVR-SI-GetEvent")); } static void unloadTests() { - BOOST_REQUIRE_THROW(ElementLoader::getFor("P2PVR-SI-GetEvent"), NotSupported); + BOOST_REQUIRE_THROW(RowSetFactory::get("P2PVR-SI-GetEvent"), AdHoc::NoSuchPluginException); // Known issue, these *should* unload, but for some reason, don't. - BOOST_WARN_THROW(ElementLoader::getFor("p2pvrrecordingstream"), NotSupported); - BOOST_WARN_THROW(ElementLoader::getFor("p2pvrservicestream"), NotSupported); + BOOST_WARN_THROW(StreamFactory::get("p2pvrrecordingstream"), AdHoc::NoSuchPluginException); + BOOST_WARN_THROW(StreamFactory::get("p2pvrservicestream"), AdHoc::NoSuchPluginException); } BOOST_GLOBAL_FIXTURE( TestAppInstance ); |