SAGA C++ API 1.6
exception.cpp
Go to the documentation of this file.
00001 //  Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net)
00002 //  Copyright (c) 2005-2009 Hartmut Kaiser
00003 //  Copyright (c) 2007 Ole Weidner (oweidner@cct.lsu.edu)
00004 // 
00005 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
00006 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00007 
00008 // include stl
00009 #include <exception>
00010 #include <iostream>
00011 #include <string>
00012 #include <vector>
00013 
00014 #include <boost/assert.hpp>
00015 
00016 // include saga dependencies
00017 #include <saga/saga/base.hpp>
00018 #include <saga/saga/util.hpp>
00019 #include <saga/saga/error.hpp>
00020 #include <saga/saga/object.hpp>
00021 #include <saga/impl/runtime.hpp>
00022 #include <saga/impl/exception.hpp>
00023 
00025 //
00026 namespace saga 
00027 {
00028     exception::exception (saga::object obj, std::string const& m, error e) 
00029       : impl_(new saga::impl::exception(obj, m, e))
00030     {}
00031 
00037     exception::exception (saga::object obj, std::vector<saga::exception> const& l) 
00038       : impl_(new saga::impl::exception(obj, l))
00039     {}
00040 
00047     exception::exception (saga::object obj, 
00048             std::vector<saga::exception> const& l, error e) 
00049       : impl_(new saga::impl::exception(obj, l, e))
00050     {}
00051 
00057     exception::exception (std::string const& m, error e) 
00058       : impl_(new saga::impl::exception(m, e))
00059     {}
00060 
00066     exception::exception (std::vector<saga::exception> const& l) 
00067       : impl_(new saga::impl::exception(l))
00068     {}
00069 
00072     char const* exception::what() const throw() 
00073     { 
00074         BOOST_ASSERT(impl_);
00075         return impl_->what();
00076     }
00077 
00081     char const* exception::get_message() const throw() 
00082     { 
00083         BOOST_ASSERT(impl_);
00084         return impl_->get_message();    // top level message only
00085     }
00086 
00089     saga::error exception::get_error () const throw() 
00090     { 
00091         BOOST_ASSERT(impl_);
00092         return impl_->get_error(); 
00093     }
00094 
00098     saga::object exception::get_object () const throw() 
00099     { 
00100         return impl_->get_object(); 
00101     }
00102 
00105     std::vector<saga::exception> const& exception::get_all_exceptions() const throw()
00106     {
00107         BOOST_ASSERT(impl_);
00108         return impl_->get_all_exceptions(); 
00109     }
00110 
00115     std::vector<std::string> exception::get_all_messages() const
00116     {
00117         BOOST_ASSERT(impl_);
00118         return impl_->get_all_messages(); 
00119     }
00120 
00122 } // namespace saga
00123 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines