summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-23 21:36:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-23 21:36:36 +0100
commita45927691e40de464bcdcca0f89e3f40ee9be38f (patch)
treef9b06a56fa83f73a8f4e3a68d07266512679204a
parentTidy up and alias glibmm and libxml++ refs (diff)
downloadp2pvr-a45927691e40de464bcdcca0f89e3f40ee9be38f.tar.bz2
p2pvr-a45927691e40de464bcdcca0f89e3f40ee9be38f.tar.xz
p2pvr-a45927691e40de464bcdcca0f89e3f40ee9be38f.zip
Use Slicer-DB to replace our own sqlSelectDeserializer
-rw-r--r--p2pvr/daemon/Jamfile.jam2
-rw-r--r--p2pvr/daemon/recordings.cpp4
-rw-r--r--p2pvr/daemon/schedules.cpp10
-rw-r--r--p2pvr/daemon/si.cpp37
-rw-r--r--p2pvr/daemon/sqlSelectDeserializer.cpp176
-rw-r--r--p2pvr/daemon/sqlSelectDeserializer.h28
-rw-r--r--p2pvr/daemon/unittests/Jamfile.jam1
-rw-r--r--p2pvr/daemon/unittests/testMaint.cpp2
-rw-r--r--p2pvr/daemon/unittests/testRecording.cpp2
-rw-r--r--p2pvr/daemon/unittests/testSqlSelectDeserializer.cpp10
10 files changed, 36 insertions, 236 deletions
diff --git a/p2pvr/daemon/Jamfile.jam b/p2pvr/daemon/Jamfile.jam
index c565234..369e714 100644
--- a/p2pvr/daemon/Jamfile.jam
+++ b/p2pvr/daemon/Jamfile.jam
@@ -1,4 +1,5 @@
lib slicer : : <name>slicer : : <include>/usr/include/slicer ;
+lib slicer-db : : <name>slicer-db : : <include>/usr/include/slicer ;
cpp-pch pch : pch.hpp :
<library>../ice//p2pvrice
@@ -24,6 +25,7 @@ lib p2pvrdaemon :
<library>..//adhocutil
<implicit-dependency>../../libtmdb//tmdb
<library>slicer
+ <library>slicer-db
<slicer>yes
<include>.
: :
diff --git a/p2pvr/daemon/recordings.cpp b/p2pvr/daemon/recordings.cpp
index 9b79d60..4a3e6d2 100644
--- a/p2pvr/daemon/recordings.cpp
+++ b/p2pvr/daemon/recordings.cpp
@@ -4,7 +4,7 @@
#include <Ice/Ice.h>
#include <logger.h>
#include <slicer/slicer.h>
-#include "sqlSelectDeserializer.h"
+#include <slicer/db/sqlSelectDeserializer.h>
ResourceString(Recording_Insert, sql_Recordings_insert);
ResourceString(Recording_InsertNewId, sql_Recordings_insertNewId);
@@ -47,7 +47,7 @@ P2PVR::RecordingList
Recordings::GetRecordings(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::RecordingList>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::RecordingList>(
*Select(Recording_GetAll).second);
}
diff --git a/p2pvr/daemon/schedules.cpp b/p2pvr/daemon/schedules.cpp
index 40d7863..19d277f 100644
--- a/p2pvr/daemon/schedules.cpp
+++ b/p2pvr/daemon/schedules.cpp
@@ -11,7 +11,7 @@
#include "resources.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <factory.impl.h>
-#include "sqlSelectDeserializer.h"
+#include <slicer/db/sqlSelectDeserializer.h>
#include <slicer/slicer.h>
#include <p2pvr-int.h>
#include <privateExecContext.h>
@@ -193,7 +193,7 @@ Schedules::DoReschedule(const Ice::Current & ice)
unsigned int tunerCount = devs->TunerCount();
// Load list from database
- auto episodes = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduleCandidates>(
+ auto episodes = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::ScheduleCandidates>(
*Select(Schedules_getCandidates).second);
Episodes scheduleList;
@@ -309,7 +309,7 @@ P2PVR::ScheduleList
Schedules::GetSchedules(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduleList>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::ScheduleList>(
*Select(Schedules_selectAll).second);
}
@@ -317,7 +317,7 @@ P2PVR::SchedulePtr
Schedules::GetSchedule(int id, const Ice::Current &)
{
Logger()->messagebf(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- auto schedules = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduleList>(
+ auto schedules = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::ScheduleList>(
*Select(Schedules_selectById, id).second);
if (schedules.empty()) throw P2PVR::NotFound();
return schedules.front();
@@ -327,7 +327,7 @@ P2PVR::ScheduledToRecordList
Schedules::GetScheduledToRecord(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::ScheduledToRecordList>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::ScheduledToRecordList>(
*Select(Schedules_scheduledToRecord).second);
}
diff --git a/p2pvr/daemon/si.cpp b/p2pvr/daemon/si.cpp
index 9164a62..d511c47 100644
--- a/p2pvr/daemon/si.cpp
+++ b/p2pvr/daemon/si.cpp
@@ -1,7 +1,8 @@
#include <pch.hpp>
#include "si.h"
#include "resources.h"
-#include "sqlSelectDeserializer.h"
+#include <slicer/db/sqlSelectDeserializer.h>
+#include <slicer/db/exceptions.h>
#include "commonHelpers.h"
#include <slicer/slicer.h>
#include <logger.h>
@@ -25,7 +26,7 @@ DVBSI::Networks
SI::GetNetworks(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::Networks>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::Networks>(
*Select(SI_allNetworks).second);
}
@@ -33,7 +34,7 @@ P2PVR::Deliveries
SI::GetAllDeliveries(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- auto rtn = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Deliveries>(
+ auto rtn = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Deliveries>(
*Select(SI_allDeliveries).second, "delivery_type");
Logger()->messagebf(LOG_DEBUG, "%s: Found %d delivery methods", __PRETTY_FUNCTION__, rtn.size());
return rtn;
@@ -44,10 +45,10 @@ SI::GetDeliveryForTransport(int id, const Ice::Current&)
{
try {
Logger()->messagef(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::DeliveryPtr>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::DeliveryPtr>(
*Select(SI_deliveryForTransport, id).second, "delivery_type");
}
- catch (const NoRowsReturned &) {
+ catch (const Slicer::NoRowsReturned &) {
throw P2PVR::NotFound();
}
}
@@ -57,10 +58,10 @@ SI::GetDeliveryForSi(const Ice::Current&)
{
try {
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::DeliveryPtr>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::DeliveryPtr>(
*Select(SI_serviceNextUsed).second, "delivery_type");
}
- catch (const NoRowsReturned &) {
+ catch (const Slicer::NoRowsReturned &) {
return NULL;
}
}
@@ -70,10 +71,10 @@ SI::GetDeliveryForService(int id, const Ice::Current&)
{
try {
Logger()->messagef(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::DeliveryPtr>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::DeliveryPtr>(
*Select(SI_deliveryForService, id).second, "delivery_type");
}
- catch (const NoRowsReturned &) {
+ catch (const Slicer::NoRowsReturned &) {
throw P2PVR::NotFound();
}
}
@@ -82,7 +83,7 @@ DVBSI::ServiceList
SI::GetServices(const Ice::Current&)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::ServiceList>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::ServiceList>(
*Select(SI_servicesSelectAll).second);
}
@@ -90,7 +91,7 @@ DVBSI::ServicePtr
SI::GetService(int id, const Ice::Current&)
{
Logger()->messagef(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- auto rtn = Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::ServiceList>(
+ auto rtn = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::ServiceList>(
*Select(SI_servicesSelectById, id).second);
if (rtn.empty()) throw P2PVR::NotFound();
return rtn.front();
@@ -102,7 +103,7 @@ SI::GetEvents(const P2PVR::IntSequence & eventUids, const Ice::Current &)
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
P2PVR::Events rtn;
for (const auto & uid : eventUids) {
- auto list = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ auto list = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventByUid, uid).second);
std::copy(list.begin(), list.end(), std::back_inserter(rtn));
}
@@ -114,7 +115,7 @@ P2PVR::EventPtr
SI::GetEvent(int serviceId, int eventId, const Ice::Current &)
{
Logger()->messagef(LOG_DEBUG, "%s(s=%d, e=%d)", __PRETTY_FUNCTION__, serviceId, eventId);
- auto rtn = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ auto rtn = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventById, serviceId, eventId).second);
if (rtn.empty()) throw P2PVR::NotFound();
return rtn.front();
@@ -124,7 +125,7 @@ P2PVR::Events
SI::EventsOnNow(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsOnNow).second);
}
@@ -132,7 +133,7 @@ P2PVR::Events
SI::EventsInRange(const Common::DateTime & from, const Common::DateTime & to, const Ice::Current &)
{
Logger()->messagebf(LOG_DEBUG, "%s([%s]-[%s])", from, to, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsInRange, from, to).second);
}
@@ -141,7 +142,7 @@ SI::EventSearch(const IceUtil::Optional<std::string> & keywords, const IceUtil::
{
Logger()->messagebf(LOG_DEBUG, "%s(keywords=%s,serviceId=%s,from=%s,to=%s)",
keywords, serviceId, from, to, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventSearch, from, to, serviceId, serviceId, keywords, keywords, keywords, keywords).second);
}
@@ -149,7 +150,7 @@ P2PVR::Events
SI::EventsInSchedules(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsInSchedules).second);
}
@@ -157,7 +158,7 @@ P2PVR::Events
SI::EventsInSchedule(int scheduleId, const Ice::Current &)
{
Logger()->messagebf(LOG_DEBUG, "%s(%d)", scheduleId, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsInSchedule, scheduleId).second);
}
diff --git a/p2pvr/daemon/sqlSelectDeserializer.cpp b/p2pvr/daemon/sqlSelectDeserializer.cpp
deleted file mode 100644
index 5a59e3a..0000000
--- a/p2pvr/daemon/sqlSelectDeserializer.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-#include "sqlSelectDeserializer.h"
-#include <sqlHandleAsVariableType.h>
-#include <logger.h>
-#include <boost/algorithm/string/predicate.hpp>
-#include <stdexcept>
-
-VariableType
-operator/(DB::SelectCommand & cmd, unsigned int col)
-{
- HandleAsVariableType vt;
- cmd[col].apply(vt);
- return vt.variable;
-}
-
-class SqlSource : public DB::HandleField, public Slicer::ValueSource,
- public Slicer::TValueSource<boost::posix_time::time_duration>,
- public Slicer::TValueSource<boost::posix_time::ptime> {
- public:
- bool isNull() const
- {
- return vt.isNull();
- }
-
- void interval(const boost::posix_time::time_duration & d) override
- {
- vt = d;
- }
- void null() override
- {
- vt = Null();
- }
- void string(const char * s, size_t l) override
- {
- vt = std::string(s, l);
- }
- void integer(int64_t i) override
- {
- vt = i;
- }
- void floatingpoint(double fp) override
- {
- vt = fp;
- }
- void timestamp(const boost::posix_time::ptime & t)
- {
- vt = t;
- }
- void boolean(bool b) override
- {
- vt = b;
- }
-#define SET(Type) \
- void set(Type & b) const override { \
- b = vt.as<Type>(); \
- }
-#define SETNCONV(Type, CType) \
- void set(Type & b) const override { \
- b = boost::numeric_cast<Type>(vt.as<CType>()); \
- }
- SET(bool);
- SET(std::string);
- SETNCONV(Ice::Byte, int64_t);
- SETNCONV(Ice::Short, int64_t);
- SET(Ice::Int);
- SET(Ice::Long);
- SETNCONV(Ice::Float, double);
- SET(Ice::Double);
- SET(boost::posix_time::ptime);
- SET(boost::posix_time::time_duration);
-
- private:
- VariableType vt;
-};
-typedef IceUtil::Handle<SqlSource> SqlSourcePtr;
-
-SqlSelectDeserializer::SqlSelectDeserializer(DB::SelectCommand & c, IceUtil::Optional<std::string> tc) :
- cmd(c),
- typeIdColName(tc)
-{
-}
-
-void
-SqlSelectDeserializer::Deserialize(Slicer::ModelPartPtr mp)
-{
- cmd.execute();
- columnCount = cmd.columnCount();
- if (typeIdColName) {
- typeIdColIdx = cmd.getOrdinal(*typeIdColName);
- }
- switch (mp->GetType()) {
- case Slicer::mpt_Sequence:
- DeserializeSequence(mp);
- return;
- case Slicer::mpt_Complex:
- DeserializeObject(mp);
- return;
- case Slicer::mpt_Simple:
- DeserializeSimple(mp);
- return;
- default:
- throw std::invalid_argument("Unspported model type");
- }
-}
-
-void
-SqlSelectDeserializer::DeserializeSimple(Slicer::ModelPartPtr mp)
-{
- auto fmp = mp->GetAnonChild();
- if (!cmd.fetch()) {
- throw NoRowsReturned();
- }
- SqlSourcePtr h = new SqlSource();
- const DB::Column & c = cmd[0];
- c.apply(*h);
- if (!h->isNull()) {
- fmp->Create();
- fmp->SetValue(h);
- fmp->Complete();
- }
- if (cmd.fetch()) {
- throw std::invalid_argument("Too many rows returned");
- }
-}
-
-void
-SqlSelectDeserializer::DeserializeSequence(Slicer::ModelPartPtr mp)
-{
- mp = mp->GetAnonChild();
- SqlSourcePtr h = new SqlSource();
- while (cmd.fetch()) {
- DeserializeRow(mp);
- }
-}
-
-void
-SqlSelectDeserializer::DeserializeObject(Slicer::ModelPartPtr mp)
-{
- if (!cmd.fetch()) {
- throw NoRowsReturned();
- }
- DeserializeRow(mp);
- if (cmd.fetch()) {
- while (cmd.fetch()) ;
- throw std::invalid_argument("Too many rows returned");
- }
-}
-
-void
-SqlSelectDeserializer::DeserializeRow(Slicer::ModelPartPtr mp)
-{
- SqlSourcePtr h = new SqlSource();
- auto rmp = mp->GetAnonChild();
- if (rmp) {
- if (typeIdColIdx) {
- rmp = rmp->GetSubclassModelPart(cmd / *typeIdColIdx);
- }
- rmp->Create();
- for (auto col = 0u; col < columnCount; col += 1) {
- const DB::Column & c = cmd[col];
- auto fmpr = rmp->GetAnonChildRef([&c](Slicer::HookCommonPtr h) {
- return boost::iequals(c.name.raw(), h->PartName());
- });
- if (fmpr) {
- auto fmp = fmpr->Child();
- c.apply(*h);
- if (!h->isNull()) {
- fmp->Create();
- fmp->SetValue(h);
- fmp->Complete();
- }
- }
- }
- rmp->Complete();
- }
-}
-
diff --git a/p2pvr/daemon/sqlSelectDeserializer.h b/p2pvr/daemon/sqlSelectDeserializer.h
deleted file mode 100644
index 0c32811..0000000
--- a/p2pvr/daemon/sqlSelectDeserializer.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef P2PVR_SQL_DESERIALIZER_H
-#define P2PVR_SQL_DESERIALIZER_H
-
-#include <slicer/serializer.h>
-#include <selectcommand.h>
-
-class NoRowsReturned : public std::exception { };
-
-class SqlSelectDeserializer : public Slicer::Deserializer {
- public:
- SqlSelectDeserializer(DB::SelectCommand &, IceUtil::Optional<std::string> typeIdCol = IceUtil::Optional<std::string>());
-
- virtual void Deserialize(Slicer::ModelPartPtr) override;
-
- protected:
- void DeserializeSimple(Slicer::ModelPartPtr);
- void DeserializeObject(Slicer::ModelPartPtr);
- void DeserializeSequence(Slicer::ModelPartPtr);
- void DeserializeRow(Slicer::ModelPartPtr);
-
- DB::SelectCommand & cmd;
- unsigned int columnCount;
- IceUtil::Optional<std::string> typeIdColName;
- IceUtil::Optional<unsigned int> typeIdColIdx;
-};
-
-#endif
-
diff --git a/p2pvr/daemon/unittests/Jamfile.jam b/p2pvr/daemon/unittests/Jamfile.jam
index 86bb906..6f0f0dd 100644
--- a/p2pvr/daemon/unittests/Jamfile.jam
+++ b/p2pvr/daemon/unittests/Jamfile.jam
@@ -237,6 +237,7 @@ run
<library>Ice
<library>../..//boost_utf
<library>testCommon
+ <library>..//slicer-db
<dependency>test-data
<define>ROOT=\"$(me)\"
: testSqlSelectDeserializer ;
diff --git a/p2pvr/daemon/unittests/testMaint.cpp b/p2pvr/daemon/unittests/testMaint.cpp
index 38c9478..9926c2b 100644
--- a/p2pvr/daemon/unittests/testMaint.cpp
+++ b/p2pvr/daemon/unittests/testMaint.cpp
@@ -13,7 +13,7 @@
#include <linux/dvb/frontend.h>
#include <definedDirs.h>
#include "mockDefs.h"
-#include "sqlSelectDeserializer.h"
+#include <slicer/db/sqlSelectDeserializer.h>
#include "commonHelpers.h"
#include <slicer/slicer.h>
#include <testAppInstance.h>
diff --git a/p2pvr/daemon/unittests/testRecording.cpp b/p2pvr/daemon/unittests/testRecording.cpp
index d3ecee6..260bf82 100644
--- a/p2pvr/daemon/unittests/testRecording.cpp
+++ b/p2pvr/daemon/unittests/testRecording.cpp
@@ -13,7 +13,7 @@
#include <linux/dvb/frontend.h>
#include <definedDirs.h>
#include "mockDefs.h"
-#include "sqlSelectDeserializer.h"
+#include <slicer/db/sqlSelectDeserializer.h>
#include "commonHelpers.h"
#include "serviceStreamer.h"
#include "temporaryIceAdapterObject.h"
diff --git a/p2pvr/daemon/unittests/testSqlSelectDeserializer.cpp b/p2pvr/daemon/unittests/testSqlSelectDeserializer.cpp
index 077486c..47d36c5 100644
--- a/p2pvr/daemon/unittests/testSqlSelectDeserializer.cpp
+++ b/p2pvr/daemon/unittests/testSqlSelectDeserializer.cpp
@@ -1,6 +1,6 @@
#define BOOST_TEST_MODULE SqlSelectDeserializer
#include <boost/test/unit_test.hpp>
-#include <sqlSelectDeserializer.h>
+#include <slicer/db/sqlSelectDeserializer.h>
#include <slicer/slicer.h>
#include <connection.h>
#include <p2pvr.h>
@@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE( listOfEvents )
{
auto db = dataSource<RdbmsDataSource>("postgres")->getReadonly();
auto sel = SelectPtr(db->newSelectCommand("SELECT * FROM events ORDER BY serviceId, eventId LIMIT 100"));
- auto res = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(*sel);
+ auto res = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(*sel);
BOOST_REQUIRE_EQUAL(res.size(), 100);
BOOST_REQUIRE_EQUAL(res[0]->ServiceId, 4166);
BOOST_REQUIRE_EQUAL(res[0]->EventId, 49741);
@@ -52,7 +52,7 @@ BOOST_AUTO_TEST_CASE( singleField )
{
auto db = dataSource<RdbmsDataSource>("postgres")->getReadonly();
auto sel = SelectPtr(db->newSelectCommand("SELECT EventId FROM events ORDER BY serviceId, eventId LIMIT 1"));
- auto res = Slicer::DeserializeAny<SqlSelectDeserializer, int>(*sel);
+ auto res = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, int>(*sel);
BOOST_REQUIRE_EQUAL(res, 49741);
}
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE( singleEvent )
{
auto db = dataSource<RdbmsDataSource>("postgres")->getReadonly();
auto sel = SelectPtr(db->newSelectCommand("SELECT * FROM events ORDER BY serviceId, eventId LIMIT 1"));
- auto res = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::EventPtr>(*sel);
+ auto res = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::EventPtr>(*sel);
BOOST_REQUIRE_EQUAL(res->ServiceId, 4166);
BOOST_REQUIRE_EQUAL(res->EventId, 49741);
BOOST_REQUIRE_EQUAL(res->Title, "Skiing Weatherview");
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE( dynamicTypes )
{
auto db = dataSource<RdbmsDataSource>("postgres")->getReadonly();
auto sel = SelectPtr(db->newSelectCommand("SELECT d.*, '::DVBSI::TerrestrialDelivery' \"typeid\" FROM delivery_dvbt d ORDER BY TransportStreamId"));
- auto res = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Deliveries>(*sel, "typeid");
+ auto res = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Deliveries>(*sel, "typeid");
BOOST_REQUIRE_EQUAL(res.size(), 6);
auto dvbt = DVBSI::TerrestrialDeliveryPtr::dynamicCast(res[0]);
BOOST_REQUIRE_EQUAL(dvbt->Frequency, 682000000);