diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-02 21:25:12 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-02 21:25:12 +0100 |
commit | 42107bb466982e3d6810fb5cb36a97fa8a225042 (patch) | |
tree | 59fb8cb5ab5f934c32031db2a7f383403860dca2 /p2pvr/devices | |
parent | Update to work with system dbpp (diff) | |
parent | Slash the amount of inclusion in pre-compiled headers (diff) | |
download | p2pvr-42107bb466982e3d6810fb5cb36a97fa8a225042.tar.bz2 p2pvr-42107bb466982e3d6810fb5cb36a97fa8a225042.tar.xz p2pvr-42107bb466982e3d6810fb5cb36a97fa8a225042.zip |
Merge branch 'project2-adhoc-plugins'p2pvr-0.1.2
Diffstat (limited to 'p2pvr/devices')
-rw-r--r-- | p2pvr/devices/frontend.cpp | 10 | ||||
-rw-r--r-- | p2pvr/devices/frontend.h | 6 | ||||
-rw-r--r-- | p2pvr/devices/frontends/ofdm.cpp | 2 | ||||
-rw-r--r-- | p2pvr/devices/pch.hpp | 5 | ||||
-rw-r--r-- | p2pvr/devices/tuner.cpp | 11 |
5 files changed, 16 insertions, 18 deletions
diff --git a/p2pvr/devices/frontend.cpp b/p2pvr/devices/frontend.cpp index 54870a1..5b9280b 100644 --- a/p2pvr/devices/frontend.cpp +++ b/p2pvr/devices/frontend.cpp @@ -4,7 +4,7 @@ #include <logger.h> #include <sys/ioctl.h> #include <linux/dvb/frontend.h> -#include <instanceStore.impl.h> +#include <factory.impl.h> Frontend::Frontend(Tuner * t, int fd, const struct dvb_frontend_info & i) : tuner(t), @@ -35,5 +35,11 @@ Frontend::GetStatus() const return status; } -INSTANTIATESTORE(fe_type, FrontendLoader); +std::string +Frontend::FactoryKey(fe_type t) +{ + return stringbf("Frontend:%x", t); +} + +INSTANTIATEFACTORY(Frontend, Tuner *, int, const struct dvb_frontend_info &); diff --git a/p2pvr/devices/frontend.h b/p2pvr/devices/frontend.h index d33353d..b68cdba 100644 --- a/p2pvr/devices/frontend.h +++ b/p2pvr/devices/frontend.h @@ -2,7 +2,7 @@ #define P2PVR_FRONTEND_H #include <linux/dvb/frontend.h> -#include <genLoader.h> +#include <factory.h> #include <dvb.h> class Tuner; @@ -19,13 +19,15 @@ class Frontend { virtual std::string Type() const = 0; const struct dvb_frontend_info & Info() const; + static std::string FactoryKey(fe_type); + protected: const Tuner * tuner; const int frontendFD; const struct dvb_frontend_info fe_info; }; -typedef GenLoader<Frontend, fe_type, Tuner *, int, const struct dvb_frontend_info &> FrontendLoader; +typedef AdHoc::Factory<Frontend, Tuner *, int, const struct dvb_frontend_info &> FrontendFactory; typedef boost::shared_ptr<Frontend> FrontendPtr; #endif diff --git a/p2pvr/devices/frontends/ofdm.cpp b/p2pvr/devices/frontends/ofdm.cpp index 93e0d86..cb174ba 100644 --- a/p2pvr/devices/frontends/ofdm.cpp +++ b/p2pvr/devices/frontends/ofdm.cpp @@ -155,5 +155,5 @@ class Frontend_OFDM : public Frontend { } }; -DECLARE_GENERIC_LOADER(FE_OFDM, FrontendLoader, Frontend_OFDM); +NAMEDFACTORY(Frontend::FactoryKey(FE_OFDM), Frontend_OFDM, FrontendFactory); diff --git a/p2pvr/devices/pch.hpp b/p2pvr/devices/pch.hpp index 435ce48..7a7881c 100644 --- a/p2pvr/devices/pch.hpp +++ b/p2pvr/devices/pch.hpp @@ -4,7 +4,7 @@ #include <Ice/Ice.h> #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <boost/function/function_fwd.hpp> #include <boost/intrusive_ptr.hpp> #include <boost/shared_ptr.hpp> @@ -15,9 +15,6 @@ #include <vector> #include <thread> -#include <options.h> -#include <plugable.h> - #endif #endif diff --git a/p2pvr/devices/tuner.cpp b/p2pvr/devices/tuner.cpp index ea3ccad..f6df896 100644 --- a/p2pvr/devices/tuner.cpp +++ b/p2pvr/devices/tuner.cpp @@ -5,7 +5,7 @@ #include <sys/ioctl.h> #include <poll.h> #include <logger.h> -#include <plugable.h> +#include <factory.h> #include <linux/dvb/frontend.h> #include <linux/dvb/dmx.h> #include <boost/tuple/tuple.hpp> @@ -14,13 +14,6 @@ #include "tunerSendSi.h" #include "tunerSendTs.h" -class FrontendNotSupported : public NotSupported { - public: - FrontendNotSupported(fe_type t) : NotSupported(stringbf("Frontend not supported: %s", t)) - { - } -}; - Tuner::Tuner(const boost::filesystem::path & df) : deviceFrontend(df), deviceRoot(df.branch_path()), @@ -36,7 +29,7 @@ Tuner::Tuner(const boost::filesystem::path & df) : if (ioctl(fd, FE_GET_INFO, &fe_info) < 0) { throw P2PVR::DeviceError(deviceFrontend.string(), strerror(errno), errno); } - frontend = FrontendPtr(FrontendLoader::createNew<FrontendNotSupported>(fe_info.type, this, fd, fe_info)); + frontend = FrontendPtr(FrontendFactory::createNew(Frontend::FactoryKey(fe_info.type), this, fd, fe_info)); } catch (...) { close(fd); |