added 'void deletePlaylist(xmlRpcValue playlistId)' to
StorageClientInterface, and provided dummy implementation in TestStorageClient
This commit is contained in:
parent
4b07803e0c
commit
f0abe66287
3 changed files with 50 additions and 10 deletions
|
@ -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<const UniqueId>::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<const UniqueId>::Ref id)
|
||||
throw (std::invalid_argument)
|
||||
= 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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<const UniqueId>::Ref id) const
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Delete a playlist.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
TestStorageClient :: deletePlaylist(Ptr<const UniqueId>::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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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<Playlist>::Ref
|
||||
getPlaylist(Ptr<const UniqueId>::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<const UniqueId>::Ref id)
|
||||
throw (std::invalid_argument);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue