X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fstlplus%2Fpersistence%2Fpersistent_exceptions.hpp;fp=src%2Fstlplus%2Fpersistence%2Fpersistent_exceptions.hpp;h=2e2a8610541cc9dc0839ed284d58f0f6d37d50e7;hb=6b0a0d0efafe34d48ab344fca3b479553bd4e62c;hp=0000000000000000000000000000000000000000;hpb=85783316365181491a3e3c0c63659972477cebba;p=chaz%2Fyoink diff --git a/src/stlplus/persistence/persistent_exceptions.hpp b/src/stlplus/persistence/persistent_exceptions.hpp new file mode 100644 index 0000000..2e2a861 --- /dev/null +++ b/src/stlplus/persistence/persistent_exceptions.hpp @@ -0,0 +1,53 @@ +#ifndef STLPLUS_PERSISTENT_EXCEPTIONS +#define STLPLUS_PERSISTENT_EXCEPTIONS +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +// Exceptions thrown by persistence routines + +//////////////////////////////////////////////////////////////////////////////// +#include "persistence_fixes.hpp" +#include +#include + +//////////////////////////////////////////////////////////////////////////////// + +namespace stlplus +{ + + //////////////////////////////////////////////////////////////////////////////// + + // exception thrown if you try to dump or restore an illegal polymorphic type + class persistent_illegal_type : public std::logic_error + { + public: + persistent_illegal_type(const std::string& type) throw(); + persistent_illegal_type(unsigned key) throw(); + ~persistent_illegal_type(void) throw(); + }; + + // exception thrown if a dump fails for any reason - but typically because the output stream couldn't take the data + class persistent_dump_failed : public std::runtime_error + { + public: + persistent_dump_failed(const std::string& message) throw(); + ~persistent_dump_failed(void) throw(); + }; + + // exception thrown if you try to restore from an out of date or unrecognised byte stream + class persistent_restore_failed : public std::runtime_error + { + public: + persistent_restore_failed(const std::string& message) throw(); + ~persistent_restore_failed(void) throw(); + }; + + //////////////////////////////////////////////////////////////////////////////// + +} // end namespace stlplus + +#endif