summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-01-29 03:28:00 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-06-13 17:29:49 +0100
commit0e3716ee8c8f95c9e0776d168095e49ec102b892 (patch)
tree37c3e5fa30ec4c38278292455212447532fef41c
parentExplicitly exclude bin dir to stop glob-tree finding cpp files from the previ... (diff)
downloadp2pvr-0e3716ee8c8f95c9e0776d168095e49ec102b892.tar.bz2
p2pvr-0e3716ee8c8f95c9e0776d168095e49ec102b892.tar.xz
p2pvr-0e3716ee8c8f95c9e0776d168095e49ec102b892.zip
Remove unused tuner type parameter from many places
-rw-r--r--p2pvr/daemon/globalDevices.cpp4
-rw-r--r--p2pvr/daemon/globalDevices.h2
-rw-r--r--p2pvr/daemon/maintenance.cpp8
-rw-r--r--p2pvr/daemon/maintenance.h4
-rw-r--r--p2pvr/daemon/maintenance/events.cpp10
-rw-r--r--p2pvr/daemon/maintenance/network.cpp2
-rw-r--r--p2pvr/daemon/maintenance/services.cpp4
-rw-r--r--p2pvr/daemon/unittests/mockDevices.cpp2
-rw-r--r--p2pvr/daemon/unittests/mockDevices.h2
-rw-r--r--p2pvr/daemon/unittests/testErrorHandling.cpp8
-rw-r--r--p2pvr/daemon/unittests/testMaint.cpp6
-rw-r--r--p2pvr/devices/localDevices.cpp2
-rw-r--r--p2pvr/devices/localDevices.h2
-rw-r--r--p2pvr/dvb/unittests/createSamples.cpp2
-rw-r--r--p2pvr/ice/dvb.ice2
-rw-r--r--p2pvr/ice/p2pvr.ice4
16 files changed, 31 insertions, 33 deletions
diff --git a/p2pvr/daemon/globalDevices.cpp b/p2pvr/daemon/globalDevices.cpp
index 79fa36a..3f0c485 100644
--- a/p2pvr/daemon/globalDevices.cpp
+++ b/p2pvr/daemon/globalDevices.cpp
@@ -28,13 +28,13 @@ GlobalDevices::GetTunerSpecific(const DVBSI::DeliveryPtr & delivery, const Ice::
}
P2PVR::TunerPrx
-GlobalDevices::GetTunerAny(short type, const DVBSI::DeliveryPtr & delivery, const Ice::Current & ice)
+GlobalDevices::GetTunerAny(const DVBSI::DeliveryPtr & delivery, const Ice::Current & ice)
{
auto ic = ice.adapter->getCommunicator();
for (const auto & pool : Devices) {
try {
auto poolprx = P2PVR::DevicesPrx::checkedCast(ic->stringToProxy(pool));
- return poolprx->GetTunerAny(type, delivery);
+ return poolprx->GetTunerAny(delivery);
}
catch (...) {
}
diff --git a/p2pvr/daemon/globalDevices.h b/p2pvr/daemon/globalDevices.h
index da27c95..33f6231 100644
--- a/p2pvr/daemon/globalDevices.h
+++ b/p2pvr/daemon/globalDevices.h
@@ -10,7 +10,7 @@
class GlobalDevices : public P2PVR::Devices {
public:
P2PVR::TunerPrx GetTunerSpecific(const DVBSI::DeliveryPtr &, const Ice::Current &);
- P2PVR::TunerPrx GetTunerAny(short type, const DVBSI::DeliveryPtr &, const Ice::Current &);
+ P2PVR::TunerPrx GetTunerAny(const DVBSI::DeliveryPtr &, const Ice::Current &);
P2PVR::PrivateTunerPrx GetPrivateTuner(short type, const Ice::Current &);
void ReleaseTuner(const P2PVR::TunerPrx &, const Ice::Current &);
int TunerCount(const Ice::Current &);
diff --git a/p2pvr/daemon/maintenance.cpp b/p2pvr/daemon/maintenance.cpp
index 05c4094..928e8d9 100644
--- a/p2pvr/daemon/maintenance.cpp
+++ b/p2pvr/daemon/maintenance.cpp
@@ -50,8 +50,8 @@ void
Maintenance::UpdateAll(short type, const Ice::Current & ice)
{
UpdateNetwork(type, ice);
- UpdateServices(type, ice);
- UpdateEvents(type, ice);
+ UpdateServices(ice);
+ UpdateEvents(ice);
}
void
@@ -72,12 +72,12 @@ Maintenance::ScheduledUpdate()
}
if (lastUpdateServices < now - periodUpdateServices) {
Logger()->messagebf(LOG_INFO, "%s: updating services", __PRETTY_FUNCTION__);
- si->UpdateServices(FE_OFDM);
+ si->UpdateServices();
time(&lastUpdateServices);
}
if (lastUpdateEvents < now - periodUpdateEvents) {
Logger()->messagebf(LOG_INFO, "%s: updating events", __PRETTY_FUNCTION__);
- si->UpdateEvents(FE_OFDM);
+ si->UpdateEvents();
time(&lastUpdateEvents);
}
Logger()->messagebf(LOG_DEBUG, "%s: completed", __PRETTY_FUNCTION__);
diff --git a/p2pvr/daemon/maintenance.h b/p2pvr/daemon/maintenance.h
index 9859c83..5b663eb 100644
--- a/p2pvr/daemon/maintenance.h
+++ b/p2pvr/daemon/maintenance.h
@@ -11,8 +11,8 @@ class Maintenance : public P2PVR::Maintenance, public DatabaseClient {
void UpdateAll(const Ice::Current &);
void UpdateAll(short type, const Ice::Current &);
void UpdateNetwork(short type, const Ice::Current &);
- void UpdateServices(short type, const Ice::Current &);
- void UpdateEvents(short type, const Ice::Current &);
+ void UpdateServices(const Ice::Current &);
+ void UpdateEvents(const Ice::Current &);
INITOPTIONS;
diff --git a/p2pvr/daemon/maintenance/events.cpp b/p2pvr/daemon/maintenance/events.cpp
index e9c6be7..4ac92e8 100644
--- a/p2pvr/daemon/maintenance/events.cpp
+++ b/p2pvr/daemon/maintenance/events.cpp
@@ -34,10 +34,9 @@ class SiEventsHandler : public SiEpgParser {
class SiEventsMerger : public IHaveSubTasks {
public:
- SiEventsMerger(short t, const Ice::Current & i, const SelectedColumns & sc) :
+ SiEventsMerger(const Ice::Current & i, const SelectedColumns & sc) :
SourceObject(__PRETTY_FUNCTION__),
IHaveSubTasks(NULL),
- type(t),
ecs(sc),
ice(i) { }
@@ -60,14 +59,13 @@ class SiEventsMerger : public IHaveSubTasks {
}
Logger()->messagebf(LOG_DEBUG, "%s: Getting a tuner", __PRETTY_FUNCTION__);
- auto tuner = devs->GetTunerAny(type, delivery);
+ auto tuner = devs->GetTunerAny(delivery);
Logger()->messagebf(LOG_DEBUG, "%s: Fetching events", __PRETTY_FUNCTION__);
tuner->SendEventInformation(parser);
devs->ReleaseTuner(tuner);
}
private:
- const short type;
const SelectedColumns & ecs;
const Ice::Current & ice;
@@ -80,12 +78,12 @@ class SiEventsMerger : public IHaveSubTasks {
};
void
-Maintenance::UpdateEvents(short type, const Ice::Current & ice)
+Maintenance::UpdateEvents(const Ice::Current & ice)
{
TxHelper tx(this);
SqlMergeTask mergeEvents("postgres", "events");
auto ecs = CreateColumns<DVBSI::EventPtr>(boost::bind(SqlMergeColumnsInserter, &mergeEvents, _1, _2));
- mergeEvents.sources.insert(new SiEventsMerger(type, ice, ecs));
+ mergeEvents.sources.insert(new SiEventsMerger(ice, ecs));
mergeEvents.insteadOfDelete = new DynamicSql::SqlText("SET current = false");
mergeEvents.updateWhere = new DynamicSql::SqlText("a.current");
mergeEvents.loadComplete(this);
diff --git a/p2pvr/daemon/maintenance/network.cpp b/p2pvr/daemon/maintenance/network.cpp
index 97598ad..815b488 100644
--- a/p2pvr/daemon/maintenance/network.cpp
+++ b/p2pvr/daemon/maintenance/network.cpp
@@ -86,7 +86,7 @@ Maintenance::UpdateNetwork(short type, const Ice::Current & ice)
if (transport) {
P2PVR::TunerPrx tuner;
try {
- tuner = devs->GetTunerAny(type, transport);
+ tuner = devs->GetTunerAny(transport);
tuner->SendNetworkInformation(parser);
devs->ReleaseTuner(tuner);
return;
diff --git a/p2pvr/daemon/maintenance/services.cpp b/p2pvr/daemon/maintenance/services.cpp
index afa8084..0ab962c 100644
--- a/p2pvr/daemon/maintenance/services.cpp
+++ b/p2pvr/daemon/maintenance/services.cpp
@@ -38,7 +38,7 @@ class SiServicesMerger : public SiServicesParser {
};
void
-Maintenance::UpdateServices(short type, const Ice::Current & ice)
+Maintenance::UpdateServices(const Ice::Current & ice)
{
auto ic = ice.adapter->getCommunicator();
auto devs = P2PVR::DevicesPrx::checkedCast(ice.adapter->createProxy(ic->stringToIdentity("GlobalDevices")));
@@ -57,7 +57,7 @@ Maintenance::UpdateServices(short type, const Ice::Current & ice)
}
Logger()->messagebf(LOG_DEBUG, "%s: Getting a tuner", __PRETTY_FUNCTION__);
- auto tuner = devs->GetTunerAny(type, delivery);
+ auto tuner = devs->GetTunerAny(delivery);
Logger()->messagebf(LOG_DEBUG, "%s: Fetching service list", __PRETTY_FUNCTION__);
tuner->SendServiceDescriptions(parser);
Logger()->messagebf(LOG_INFO, "%s: Updated service list", __PRETTY_FUNCTION__);
diff --git a/p2pvr/daemon/unittests/mockDevices.cpp b/p2pvr/daemon/unittests/mockDevices.cpp
index 7c3dc2c..777d5d3 100644
--- a/p2pvr/daemon/unittests/mockDevices.cpp
+++ b/p2pvr/daemon/unittests/mockDevices.cpp
@@ -7,7 +7,7 @@ P2PVR::TunerPrx MockDevices::GetTunerSpecific(const DVBSI::DeliveryPtr&, const I
return P2PVR::PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
}
-P2PVR::TunerPrx MockDevices::GetTunerAny(Ice::Short, const DVBSI::DeliveryPtr&, const Ice::Current & ice)
+P2PVR::TunerPrx MockDevices::GetTunerAny(const DVBSI::DeliveryPtr&, const Ice::Current & ice)
{
return P2PVR::PrivateTunerPrx::checkedCast(ice.adapter->addWithUUID(new MockTuner()));
}
diff --git a/p2pvr/daemon/unittests/mockDevices.h b/p2pvr/daemon/unittests/mockDevices.h
index 59d1b50..195867e 100644
--- a/p2pvr/daemon/unittests/mockDevices.h
+++ b/p2pvr/daemon/unittests/mockDevices.h
@@ -6,7 +6,7 @@
class MockDevices : public P2PVR::Devices {
public:
P2PVR::TunerPrx GetTunerSpecific(const DVBSI::DeliveryPtr&, const Ice::Current & ice) override;
- P2PVR::TunerPrx GetTunerAny(Ice::Short, const DVBSI::DeliveryPtr&, const Ice::Current & ice) override;
+ P2PVR::TunerPrx GetTunerAny(const DVBSI::DeliveryPtr&, const Ice::Current & ice) override;
P2PVR::PrivateTunerPrx GetPrivateTuner(Ice::Short, const Ice::Current & ice) override;
void ReleaseTuner(const P2PVR::TunerPrx & tuner, const Ice::Current & ice) override;
Ice::Int TunerCount(const Ice::Current&) override;
diff --git a/p2pvr/daemon/unittests/testErrorHandling.cpp b/p2pvr/daemon/unittests/testErrorHandling.cpp
index c0717da..91942b0 100644
--- a/p2pvr/daemon/unittests/testErrorHandling.cpp
+++ b/p2pvr/daemon/unittests/testErrorHandling.cpp
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(TestRawDataClient)
{
BOOST_CHECKPOINT("Setup");
auto del = s->GetDeliveryForSi();
- auto gd = d->GetTunerAny(FE_OFDM, del);
+ auto gd = d->GetTunerAny(del);
TemporarayIceAdapterObject<P2PVR::RawDataClient> a(adapter, new TestClient());
BOOST_CHECKPOINT("Make successful call");
gd->SendNetworkInformation(a);
@@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE(TestParser)
{
BOOST_CHECKPOINT("Setup");
auto del = s->GetDeliveryForSi();
- auto gd = d->GetTunerAny(FE_OFDM, del);
+ auto gd = d->GetTunerAny(del);
TemporarayIceAdapterObject<P2PVR::RawDataClient> a(adapter, new TestNetworkParser());
BOOST_CHECKPOINT("Make successful call");
gd->SendNetworkInformation(a);
@@ -114,7 +114,7 @@ BOOST_AUTO_TEST_CASE(TestRawDataClientWithError)
{
BOOST_CHECKPOINT("Setup");
auto del = s->GetDeliveryForSi();
- auto gd = d->GetTunerAny(FE_OFDM, del);
+ auto gd = d->GetTunerAny(del);
TemporarayIceAdapterObject<P2PVR::RawDataClient> a(adapter, new FailingTestClient());
BOOST_CHECKPOINT("Make failing call");
BOOST_REQUIRE_THROW(gd->SendNetworkInformation(a), P2PVR::DataHandlingException);
@@ -124,7 +124,7 @@ BOOST_AUTO_TEST_CASE(TestParserWithError)
{
BOOST_CHECKPOINT("Setup");
auto del = s->GetDeliveryForSi();
- auto gd = d->GetTunerAny(FE_OFDM, del);
+ auto gd = d->GetTunerAny(del);
TemporarayIceAdapterObject<P2PVR::RawDataClient> a(adapter, new FailingTestNetworkParser());
BOOST_CHECKPOINT("Make failing call");
BOOST_REQUIRE_THROW(gd->SendNetworkInformation(a), P2PVR::DataHandlingException);
diff --git a/p2pvr/daemon/unittests/testMaint.cpp b/p2pvr/daemon/unittests/testMaint.cpp
index 75f3a76..f8340af 100644
--- a/p2pvr/daemon/unittests/testMaint.cpp
+++ b/p2pvr/daemon/unittests/testMaint.cpp
@@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE( UpdateNetwork_prepopulated )
//
BOOST_AUTO_TEST_CASE( update_services )
{
- m->UpdateServices(FE_OFDM);
+ m->UpdateServices();
}
BOOST_AUTO_TEST_CASE( GetServices )
@@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE( update_events )
BOOST_CHECKPOINT("Write first events");
MockTuner::SetEventsSet(0);
- m->UpdateEvents(FE_OFDM);
+ m->UpdateEvents();
auto dayOneEvents = s->EventSearch(IceUtil::Optional<std::string>(), IceUtil::Optional<int>(),
Common::DateTime {2014, 12, 18, 3, 0}, Common::DateTime {2014, 12, 19, 3, 0});
BOOST_REQUIRE_EQUAL(dayOneEvents.size(), 3345);
@@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE( update_events )
BOOST_CHECKPOINT("Write second events");
MockTuner::SetEventsSet(1);
- m->UpdateEvents(FE_OFDM);
+ m->UpdateEvents();
BOOST_REQUIRE_THROW(s->GetEvent(14448, 27052), P2PVR::NotFound);
BOOST_REQUIRE(s->GetEvent(15856, 3591));
diff --git a/p2pvr/devices/localDevices.cpp b/p2pvr/devices/localDevices.cpp
index 4f270dd..00ec395 100644
--- a/p2pvr/devices/localDevices.cpp
+++ b/p2pvr/devices/localDevices.cpp
@@ -79,7 +79,7 @@ LocalDevices::GetTunerSpecific(const DVBSI::DeliveryPtr & delivery, const Ice::C
}
P2PVR::TunerPrx
-LocalDevices::GetTunerAny(short , const DVBSI::DeliveryPtr & delivery, const Ice::Current & ice)
+LocalDevices::GetTunerAny(const DVBSI::DeliveryPtr & delivery, const Ice::Current & ice)
{
std::lock_guard<std::mutex> g(lock);
Logger()->messagebf(LOG_DEBUG, "%s: Searching for an open sharable tuner any frequency", __PRETTY_FUNCTION__);
diff --git a/p2pvr/devices/localDevices.h b/p2pvr/devices/localDevices.h
index 5521f8d..3c3d51b 100644
--- a/p2pvr/devices/localDevices.h
+++ b/p2pvr/devices/localDevices.h
@@ -14,7 +14,7 @@ class LocalDevices : public P2PVR::LocalDevices {
~LocalDevices();
P2PVR::TunerPrx GetTunerSpecific(const DVBSI::DeliveryPtr &, const Ice::Current &);
- P2PVR::TunerPrx GetTunerAny(short type, const DVBSI::DeliveryPtr &, const Ice::Current &);
+ P2PVR::TunerPrx GetTunerAny(const DVBSI::DeliveryPtr &, const Ice::Current &);
P2PVR::PrivateTunerPrx GetPrivateTuner(short type, const Ice::Current &);
void ReleaseTuner(const P2PVR::TunerPrx &, const Ice::Current &);
int TunerCount(const Ice::Current &);
diff --git a/p2pvr/dvb/unittests/createSamples.cpp b/p2pvr/dvb/unittests/createSamples.cpp
index d2f7e23..1bb8f92 100644
--- a/p2pvr/dvb/unittests/createSamples.cpp
+++ b/p2pvr/dvb/unittests/createSamples.cpp
@@ -86,7 +86,7 @@ CaptureAndSave(const boost::filesystem::path & fileName, const boost::function<v
BOOST_REQUIRE_EQUAL(transport->TransmissionMode, 1);
BOOST_CHECKPOINT("Acquire device");
- P2PVR::TunerPrx tuner = devs->GetTunerAny(FE_OFDM, transport);
+ P2PVR::TunerPrx tuner = devs->GetTunerAny(transport);
BOOST_REQUIRE(tuner);
tuner->ice_ping();
diff --git a/p2pvr/ice/dvb.ice b/p2pvr/ice/dvb.ice
index 6b88720..7565d33 100644
--- a/p2pvr/ice/dvb.ice
+++ b/p2pvr/ice/dvb.ice
@@ -48,7 +48,7 @@ module P2PVR {
// Get a tuner that is tuned to <del>, acquire and tune to <del> if required.
Tuner * GetTunerSpecific(DVBSI::Delivery del);
// Get any tuner that is tuned, acquire and tune to <del> if required.
- Tuner * GetTunerAny(short type, DVBSI::Delivery del);
+ Tuner * GetTunerAny(DVBSI::Delivery del);
// Get a private tuner, not shared or sharable
PrivateTuner * GetPrivateTuner(short type);
// Release a tuner when no longer required.
diff --git a/p2pvr/ice/p2pvr.ice b/p2pvr/ice/p2pvr.ice
index 701bfb8..8f746d1 100644
--- a/p2pvr/ice/p2pvr.ice
+++ b/p2pvr/ice/p2pvr.ice
@@ -61,8 +61,8 @@ module P2PVR {
interface Maintenance {
idempotent void UpdateAll();
idempotent void UpdateNetwork(short type);
- idempotent void UpdateServices(short type);
- idempotent void UpdateEvents(short type);
+ idempotent void UpdateServices();
+ idempotent void UpdateEvents();
};
["project2:type"]