[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Usata-commits] Changes to usata2/src/resource-manager.hpp
From: |
David Lau |
Subject: |
[Usata-commits] Changes to usata2/src/resource-manager.hpp |
Date: |
Wed, 19 Jan 2005 01:28:47 -0500 |
Index: usata2/src/resource-manager.hpp
diff -u usata2/src/resource-manager.hpp:1.1 usata2/src/resource-manager.hpp:1.2
--- usata2/src/resource-manager.hpp:1.1 Tue Jan 18 00:08:42 2005
+++ usata2/src/resource-manager.hpp Wed Jan 19 06:28:47 2005
@@ -10,7 +10,7 @@
// included in the software distribution, or visit
// http://www.fsf.org/licenses/gpl.html.
//
-// $Id: resource-manager.hpp,v 1.1 2005/01/18 00:08:42 skunix Exp $
+// $Id: resource-manager.hpp,v 1.2 2005/01/19 06:28:47 skunix Exp $
#ifndef USATA_RESOURCE_MANAGER_HPP
@@ -20,10 +20,19 @@
#include <string>
#include <boost/shared_ptr.hpp>
-
+#include "exception_types.hpp"
namespace usata
{
+ namespace exceptions
+ {
+ class ResourceUnavailable : public RecoverableError
+ {
+ public:
+ ResourceUnavailable(const std::string& w)
+ : RecoverableError(w){}
+ };
+ }
template <typename Tresource_type,
typename Tmeta_type,
typename Tidentifier_type>
@@ -70,7 +79,7 @@
rc = it->second;
return OK;
}
-
+
public:
resource
@@ -85,7 +94,8 @@
Status astatus = create(id, rc);
if (astatus != OK)
{
- // FIXME: throw
+ using namespace exceptions;
+ throw ResourceUnavailable(id);
}
retval.reset(rc);
loaded.insert(typename
LoadedMap::value_type(id,retval));