Moved the project in to it's own directory libsecondlife
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@18 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
121
libsecondlife/include/boost/asio/error_handler.hpp
Normal file
121
libsecondlife/include/boost/asio/error_handler.hpp
Normal file
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// error_handler.hpp
|
||||
// ~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2005 Christopher M. Kohlhoff (chris at kohlhoff dot 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)
|
||||
//
|
||||
|
||||
#ifndef BOOST_ASIO_ERROR_HANDLER_HPP
|
||||
#define BOOST_ASIO_ERROR_HANDLER_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
|
||||
#include <boost/asio/detail/push_options.hpp>
|
||||
|
||||
#include <boost/asio/detail/push_options.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/asio/detail/pop_options.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace asio {
|
||||
|
||||
namespace detail {
|
||||
|
||||
class ignore_error_t
|
||||
{
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
template <typename Error>
|
||||
void operator()(const Error& err) const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class throw_error_t
|
||||
{
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
template <typename Error>
|
||||
void operator()(const Error& err) const
|
||||
{
|
||||
boost::throw_exception(err);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Target>
|
||||
class assign_error_t
|
||||
{
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
assign_error_t(Target& target)
|
||||
: target_(&target)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Error>
|
||||
void operator()(const Error& err) const
|
||||
{
|
||||
*target_ = err;
|
||||
}
|
||||
|
||||
private:
|
||||
Target* target_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
* @defgroup error_handler Error Handler Function Objects
|
||||
*
|
||||
* Function objects for custom error handling.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/// Return a function object that always ignores the error.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
unspecified ignore_error();
|
||||
#else
|
||||
inline detail::ignore_error_t ignore_error()
|
||||
{
|
||||
return detail::ignore_error_t();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Return a function object that always throws the error.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
unspecified throw_error();
|
||||
#else
|
||||
inline detail::throw_error_t throw_error()
|
||||
{
|
||||
return detail::throw_error_t();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Return a function object that assigns the error to a variable.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
template <typename Target>
|
||||
unspecified assign_error(Target& target);
|
||||
#else
|
||||
template <typename Target>
|
||||
inline detail::assign_error_t<Target> assign_error(Target& target)
|
||||
{
|
||||
return detail::assign_error_t<Target>(target);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*@}*/
|
||||
|
||||
} // namespace asio
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/asio/detail/pop_options.hpp>
|
||||
|
||||
#endif // BOOST_ASIO_ERROR_HANDLER_HPP
|
||||
Reference in New Issue
Block a user