// Copyright (c) 2005-2007 Hartmut Kaiser (hartmut.kaiser@gmail.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include /////////////////////////////////////////////////////////////////////////////// namespace saga { /////////////////////////////////////////////////////////////////////////// namespace impl { /////////////////////////////////////////////////////////////////////// // throw a saga::exception void throw_exception(saga::object const& obj, std::string const& m, error e) { throw saga::exception(obj, m, e); } /////////////////////////////////////////////////////////////////////// // throw a saga::exception from a saga object member function void throw_exception(saga::impl::object const *this_, std::string const& m, error e) { throw saga::exception( runtime::get_object( boost::const_pointer_cast( this_->shared_from_this()) ), m, e); } /////////////////////////////////////////////////////////////////////// // throw a saga::exception from an adaptor member function void throw_exception(saga::impl::v1_0::cpi const *this_, std::string const& m, error e) { TR1::shared_ptr prxy( boost::const_pointer_cast( this_->get_proxy()->shared_from_this())); throw saga::exception(runtime::get_object(prxy), m, e); } /////////////////////////////////////////////////////////////////////// // throw a saga::exception from any other function void throw_exception(void const *this_, std::string const& m, error e) { throw saga::exception(saga::object(), m, e); } /////////////////////////////////////////////////////////////////////////// } /////////////////////////////////////////////////////////////////////////// namespace adaptors { /////////////////////////////////////////////////////////////////////// // throw a saga::adaptors::exception void throw_adaptor_exception(saga::impl::v1_0::cpi const *this_, std::string const& adaptor_name, std::string const& m, error e) { TR1::shared_ptr prxy( boost::const_pointer_cast( this_->get_proxy()->shared_from_this())); throw saga::adaptors::exception( saga::impl::runtime::get_object(prxy), adaptor_name, m, e); } /////////////////////////////////////////////////////////////////////// // throw a saga::adaptors::exception void throw_adaptor_exception(std::string const& adaptor_name, std::string const& m, error e) { throw saga::adaptors::exception(saga::object(), adaptor_name, m, e); } /////////////////////////////////////////////////////////////////////////// } /////////////////////////////////////////////////////////////////////////////// } // namespace saga::impl