From 72387302c02d0d1e44491ad9804d808c89c51160 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Fri, 14 Jan 2005 12:29:05 +0000 Subject: [PATCH] changed the return value of createPlaylist() to Ptr::Ref --- .../Storage/StorageClientInterface.h | 8 ++++---- .../modules/storage/src/TestStorageClient.cxx | 6 +++--- .../modules/storage/src/TestStorageClient.h | 8 ++++---- .../storage/src/TestStorageClientTest.cxx | 8 ++++---- .../modules/storage/src/WebStorageClient.cxx | 6 +++--- .../modules/storage/src/WebStorageClient.h | 8 ++++---- .../storage/src/WebStorageClientTest.cxx | 18 +++++++++--------- .../products/gLiveSupport/src/GLiveSupport.cxx | 7 +++---- .../scheduler/src/CreatePlaylistMethod.cxx | 8 ++++---- 9 files changed, 38 insertions(+), 39 deletions(-) diff --git a/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h b/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h index 0a5ed506f..1e24c2e71 100644 --- a/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h +++ b/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/include/LiveSupport/Storage/StorageClientInterface.h,v $ ------------------------------------------------------------------------------*/ @@ -65,7 +65,7 @@ using namespace Core; * An interface for storage clients. * * @author $Author: fgerlits $ - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ class StorageClientInterface { @@ -76,11 +76,11 @@ class StorageClientInterface * savePlaylist(). * * @param sessionId the session ID from the authentication client - * @return the newly created playlist. + * @return the ID of the newly created playlist. * @exception XmlRpcException if there is a problem with the XML-RPC * call. */ - virtual Ptr::Ref + virtual Ptr::Ref createPlaylist(Ptr::Ref sessionId) throw (XmlRpcException) = 0; diff --git a/livesupport/modules/storage/src/TestStorageClient.cxx b/livesupport/modules/storage/src/TestStorageClient.cxx index c9e1626ee..ad9cd07dd 100644 --- a/livesupport/modules/storage/src/TestStorageClient.cxx +++ b/livesupport/modules/storage/src/TestStorageClient.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.29 $ + Version : $Revision: 1.30 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $ ------------------------------------------------------------------------------*/ @@ -197,7 +197,7 @@ TestStorageClient :: configure(const xmlpp::Element & element) /*------------------------------------------------------------------------------ * Create a new playlist. *----------------------------------------------------------------------------*/ -Ptr::Ref +Ptr::Ref TestStorageClient :: createPlaylist(Ptr::Ref sessionId) throw () { @@ -214,7 +214,7 @@ TestStorageClient :: createPlaylist(Ptr::Ref sessionId) playlistMap[playlistId->getId()] = playlist; - return getPlaylist(sessionId, playlistId); // return a copy of the playlist + return playlist->getId(); } diff --git a/livesupport/modules/storage/src/TestStorageClient.h b/livesupport/modules/storage/src/TestStorageClient.h index c55ce0763..4fe511fec 100644 --- a/livesupport/modules/storage/src/TestStorageClient.h +++ b/livesupport/modules/storage/src/TestStorageClient.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.24 $ + Version : $Revision: 1.25 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $ ------------------------------------------------------------------------------*/ @@ -90,7 +90,7 @@ using namespace LiveSupport::Core; * * * @author $Author: fgerlits $ - * @version $Revision: 1.24 $ + * @version $Revision: 1.25 $ */ class TestStorageClient : virtual public Configurable, @@ -191,9 +191,9 @@ class TestStorageClient : * savePlaylist(). * * @param sessionId the session ID from the authentication client - * @return the newly created playlist. + * @return the ID of the newly created playlist. */ - virtual Ptr::Ref + virtual Ptr::Ref createPlaylist(Ptr::Ref sessionId) throw (); diff --git a/livesupport/modules/storage/src/TestStorageClientTest.cxx b/livesupport/modules/storage/src/TestStorageClientTest.cxx index 06014a68b..84e1f69b5 100644 --- a/livesupport/modules/storage/src/TestStorageClientTest.cxx +++ b/livesupport/modules/storage/src/TestStorageClientTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.21 $ + Version : $Revision: 1.22 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -198,15 +198,15 @@ void TestStorageClientTest :: createPlaylistTest(void) throw (CPPUNIT_NS::Exception) { - Ptr::Ref playlist; + Ptr::Ref playlistId; try { - playlist = tsc->createPlaylist(dummySessionId); + playlistId = tsc->createPlaylist(dummySessionId); } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } try { - CPPUNIT_ASSERT(tsc->existsPlaylist(dummySessionId, playlist->getId())); + CPPUNIT_ASSERT(tsc->existsPlaylist(dummySessionId, playlistId)); } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } diff --git a/livesupport/modules/storage/src/WebStorageClient.cxx b/livesupport/modules/storage/src/WebStorageClient.cxx index 6b68d5c01..bab85d76c 100644 --- a/livesupport/modules/storage/src/WebStorageClient.cxx +++ b/livesupport/modules/storage/src/WebStorageClient.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.25 $ + Version : $Revision: 1.26 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $ ------------------------------------------------------------------------------*/ @@ -1180,7 +1180,7 @@ WebStorageClient :: getAllPlaylists(Ptr::Ref sessionId) const /*------------------------------------------------------------------------------ * Create a new playlist. *----------------------------------------------------------------------------*/ -Ptr::Ref +Ptr::Ref WebStorageClient :: createPlaylist(Ptr::Ref sessionId) throw (Core::XmlRpcException) { @@ -1243,7 +1243,7 @@ WebStorageClient :: createPlaylist(Ptr::Ref sessionId) token.reset(); playlist->setToken(token); - return playlist; + return playlist->getId(); } diff --git a/livesupport/modules/storage/src/WebStorageClient.h b/livesupport/modules/storage/src/WebStorageClient.h index 22cea4064..24b516c47 100644 --- a/livesupport/modules/storage/src/WebStorageClient.h +++ b/livesupport/modules/storage/src/WebStorageClient.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.17 $ + Version : $Revision: 1.18 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.h,v $ ------------------------------------------------------------------------------*/ @@ -99,7 +99,7 @@ using namespace LiveSupport::Core; * * * @author $Author: fgerlits $ - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ */ class WebStorageClient : virtual public Configurable, @@ -190,11 +190,11 @@ class WebStorageClient : * savePlaylist(). * * @param sessionId the session ID from the authentication client - * @return the newly created playlist. + * @return the ID of the newly created playlist. * @exception XmlRpcException if there is a problem with the XML-RPC * call. */ - virtual Ptr::Ref + virtual Ptr::Ref createPlaylist(Ptr::Ref sessionId) throw (XmlRpcException); diff --git a/livesupport/modules/storage/src/WebStorageClientTest.cxx b/livesupport/modules/storage/src/WebStorageClientTest.cxx index 7564a5994..db0f29095 100644 --- a/livesupport/modules/storage/src/WebStorageClientTest.cxx +++ b/livesupport/modules/storage/src/WebStorageClientTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.27 $ + Version : $Revision: 1.28 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -200,14 +200,13 @@ WebStorageClientTest :: playlistTest(void) // test createPlaylist() - Ptr::Ref playlist; + Ptr::Ref playlistIdxx; try{ - playlist = wsc->createPlaylist(sessionId); + playlistIdxx = wsc->createPlaylist(sessionId); } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } - CPPUNIT_ASSERT(playlist); - Ptr::Ref playlistIdxx = playlist->getId(); + CPPUNIT_ASSERT(playlistIdxx); // test existsPlaylist() @@ -229,6 +228,7 @@ WebStorageClientTest :: playlistTest(void) // test editPlaylist() + Ptr::Ref playlist; try { playlist = wsc->editPlaylist(sessionId, playlistIdxx); } catch (XmlRpcException &e) { @@ -507,16 +507,16 @@ WebStorageClientTest :: simplePlaylistTest(void) // test createPlaylist() - Ptr::Ref playlist; + Ptr::Ref playlistId; try{ - playlist = wsc->createPlaylist(sessionId); + playlistId = wsc->createPlaylist(sessionId); } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } - CPPUNIT_ASSERT(playlist); - Ptr::Ref playlistId = playlist->getId(); + CPPUNIT_ASSERT(playlistId); // test editPlaylist() + Ptr::Ref playlist; try { playlist = wsc->editPlaylist(sessionId, playlistId); } catch (XmlRpcException &e) { diff --git a/livesupport/products/gLiveSupport/src/GLiveSupport.cxx b/livesupport/products/gLiveSupport/src/GLiveSupport.cxx index b446d16f7..5edc11c2c 100644 --- a/livesupport/products/gLiveSupport/src/GLiveSupport.cxx +++ b/livesupport/products/gLiveSupport/src/GLiveSupport.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.16 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.17 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $ ------------------------------------------------------------------------------*/ @@ -431,8 +431,7 @@ GLiveSupport :: openPlaylistForEditing(Ptr::Ref playlistId) releaseEditedPlaylist(); if (!playlistId.get()) { - editedPlaylist = storage->createPlaylist(sessionId); - playlistId = editedPlaylist->getId(); + playlistId = storage->createPlaylist(sessionId); } editedPlaylist = storage->editPlaylist(sessionId, playlistId); diff --git a/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx b/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx index 3cd0b571c..79c29ce65 100644 --- a/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.11 $ + Version : $Revision: 1.12 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -122,9 +122,9 @@ CreatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, scf = StorageClientFactory::getInstance(); storage = scf->getStorageClient(); - Ptr::Ref playlist; + Ptr::Ref playlistId; try { - playlist = storage->createPlaylist(sessionId); + playlistId = storage->createPlaylist(sessionId); } catch (XmlRpcException &e) { std::string eMsg = "could not create playlist:\n"; eMsg += e.what(); @@ -134,7 +134,7 @@ CreatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, return; } - Ptr::Ref playlistId = playlist->getId(); + Ptr::Ref playlist; try { playlist = storage->editPlaylist(sessionId, playlistId); } catch (XmlRpcException &e) {