From 45f8d60fb9c715cd1e088de2e06f60863641341c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 17 Jan 2015 01:44:03 +0000 Subject: Migrate recordings impl to SQL deserializer --- p2pvr/daemon/recordings.cpp | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/p2pvr/daemon/recordings.cpp b/p2pvr/daemon/recordings.cpp index ceb89ba..e3e92a0 100644 --- a/p2pvr/daemon/recordings.cpp +++ b/p2pvr/daemon/recordings.cpp @@ -4,6 +4,8 @@ #include #include #include "sqlContainerCreator.h" +#include +#include "sqlSelectDeserializer.h" ResourceString(Recording_Insert, sql_Recordings_insert); ResourceString(Recording_InsertNewId, sql_Recordings_insertNewId); @@ -11,28 +13,6 @@ ResourceString(Recording_Delete, sql_Recordings_delete); ResourceString(Recording_GetStorage, sql_Recordings_getStorage); ResourceString(Recording_GetAll, sql_Recordings_getAll); -template<> -void -CreateColumns(const ColumnCreator & cc) -{ - cc("recordingid", true); - cc("storageaddress", false); - cc("guid", false); - cc("scheduleid", false); - cc("eventuid", false); -} - -template<> -void -UnbindColumns(RowState & rs, const P2PVR::RecordingPtr & r) -{ - rs.fields[0] >> r->RecordingId; - rs.fields[1] >> r->StorageAddress; - rs.fields[2] >> r->Guid; - rs.fields[3] >> r->ScheduleId; - rs.fields[4] >> r->EventUid; -} - int Recordings::NewRecording(const P2PVR::RecordingPtr & r, const Ice::Current &) { @@ -67,9 +47,8 @@ Recordings::DeleteRecording(int id, const Ice::Current & ice) P2PVR::RecordingList Recordings::GetRecordings(const Ice::Current &) { - P2PVR::RecordingList rtn; - SqlContainerCreator cc(rtn); - cc.populate(Select(Recording_GetAll).second); - return rtn; + Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__); + return Slicer::DeserializeAny( + *Select(Recording_GetAll).second); } -- cgit v1.2.3