From f0abe66287e57898c54b63f4f7911de608437f02 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Mon, 4 Oct 2004 08:56:30 +0000 Subject: [PATCH] added 'void deletePlaylist(xmlRpcValue playlistId)' to StorageClientInterface, and provided dummy implementation in TestStorageClient --- .../LiveSupport/Core/StorageClientInterface.h | 20 ++++++++++++++---- .../modules/storage/src/TestStorageClient.cxx | 21 +++++++++++++++++-- .../modules/storage/src/TestStorageClient.h | 19 +++++++++++++---- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/livesupport/modules/core/include/LiveSupport/Core/StorageClientInterface.h b/livesupport/modules/core/include/LiveSupport/Core/StorageClientInterface.h index 15076c865..5955f8c5b 100644 --- a/livesupport/modules/core/include/LiveSupport/Core/StorageClientInterface.h +++ b/livesupport/modules/core/include/LiveSupport/Core/StorageClientInterface.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/Attic/StorageClientInterface.h,v $ ------------------------------------------------------------------------------*/ @@ -60,8 +60,8 @@ namespace Core { /** * An interface for storage clients. * - * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.2 $ */ class StorageClientInterface { @@ -89,6 +89,18 @@ class StorageClientInterface getPlaylist(Ptr::Ref id) const throw (std::invalid_argument) = 0; + + /** + * Delete a playlist with the specified id. + * + * @param id the id of the playlist to be deleted. + * @exception std::invalid_argument if no playlist with the specified + * id exists. + */ + virtual void + deletePlaylist(Ptr::Ref id) + throw (std::invalid_argument) + = 0; }; diff --git a/livesupport/modules/storage/src/TestStorageClient.cxx b/livesupport/modules/storage/src/TestStorageClient.cxx index cc04ad1be..ae53713f1 100644 --- a/livesupport/modules/storage/src/TestStorageClient.cxx +++ b/livesupport/modules/storage/src/TestStorageClient.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $ ------------------------------------------------------------------------------*/ @@ -115,3 +115,20 @@ TestStorageClient :: getPlaylist(Ptr::Ref id) const } +/*------------------------------------------------------------------------------ + * Delete a playlist. + *----------------------------------------------------------------------------*/ +void +TestStorageClient :: deletePlaylist(Ptr::Ref id) + throw (std::invalid_argument) +{ + PlaylistMap::iterator it = playlistMap.find(id->getId()); + + if (it == playlistMap.end()) { + throw std::invalid_argument("no such playlist"); + } + + playlistMap.erase(it); +} + + diff --git a/livesupport/modules/storage/src/TestStorageClient.h b/livesupport/modules/storage/src/TestStorageClient.h index 7b8bc9fa6..64fa93653 100644 --- a/livesupport/modules/storage/src/TestStorageClient.h +++ b/livesupport/modules/storage/src/TestStorageClient.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $ ------------------------------------------------------------------------------*/ @@ -66,8 +66,8 @@ using namespace LiveSupport::Core; /** * A dummy storage client, only used for test purposes. * - * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.2 $ */ class TestStorageClient : virtual public Configurable, @@ -148,6 +148,17 @@ class TestStorageClient : virtual Ptr::Ref getPlaylist(Ptr::Ref id) const throw (std::invalid_argument); + + /** + * Delete the playlist with the specified id. + * + * @param id the id of the playlist to be deleted. + * @exception std::invalid_argument if no playlist with the specified + * id exists. + */ + virtual void + deletePlaylist(Ptr::Ref id) + throw (std::invalid_argument); };