mirror of
https://github.com/boostorg/exception.git
synced 2025-07-12 20:16:34 +02:00
nitpicking
[SVN r48488]
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -3,14 +3,4 @@
|
|||||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
//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)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#ifndef UUID_0E57632CCA3011DCB876FD9955D89593
|
namespace boost { template <class Tag,class T> class error_info; }
|
||||||
#define UUID_0E57632CCA3011DCB876FD9955D89593
|
|
||||||
|
|
||||||
namespace
|
|
||||||
boost
|
|
||||||
{
|
|
||||||
template <class Tag,class T>
|
|
||||||
class error_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -119,6 +119,12 @@ boost
|
|||||||
template <class>
|
template <class>
|
||||||
class shared_ptr;
|
class shared_ptr;
|
||||||
|
|
||||||
|
template <class Tag,class T>
|
||||||
|
class error_info;
|
||||||
|
|
||||||
|
template <class E,class Tag,class T>
|
||||||
|
E const & operator<<( E const &, error_info<Tag,T> const & );
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
exception_detail
|
exception_detail
|
||||||
{
|
{
|
||||||
@ -135,9 +141,7 @@ boost
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class ErrorInfo>
|
template <class ErrorInfo>
|
||||||
shared_ptr<typename ErrorInfo::value_type const> get_data( exception const & );
|
shared_ptr<typename ErrorInfo::value_type const> get_info( exception const & );
|
||||||
|
|
||||||
void set_data( exception const *, shared_ptr<exception_detail::error_info_base const> const &, type_info_ const & );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class
|
class
|
||||||
@ -177,10 +181,11 @@ boost
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
template <class ErrorInfo>
|
template <class E,class Tag,class T>
|
||||||
friend shared_ptr<typename ErrorInfo::value_type const> exception_detail::get_data( exception const & );
|
friend E const & operator<<( E const &, error_info<Tag,T> const & );
|
||||||
|
|
||||||
friend void exception_detail::set_data( exception const *, shared_ptr<exception_detail::error_info_base const> const &, exception_detail::type_info_ const & );
|
template <class ErrorInfo>
|
||||||
|
friend shared_ptr<typename ErrorInfo::value_type const> exception_detail::get_info( exception const & );
|
||||||
|
|
||||||
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
|
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,7 @@ boost
|
|||||||
template <class ErrorInfo>
|
template <class ErrorInfo>
|
||||||
inline
|
inline
|
||||||
shared_ptr<typename ErrorInfo::value_type const>
|
shared_ptr<typename ErrorInfo::value_type const>
|
||||||
get_data( exception const & x )
|
get_info( exception const & x )
|
||||||
{
|
{
|
||||||
if( exception_detail::error_info_container * c=x.data_.get() )
|
if( exception_detail::error_info_container * c=x.data_.get() )
|
||||||
if( shared_ptr<exception_detail::error_info_base const> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
|
if( shared_ptr<exception_detail::error_info_base const> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
|
||||||
@ -41,7 +41,7 @@ boost
|
|||||||
shared_ptr<typename ErrorInfo::value_type const>
|
shared_ptr<typename ErrorInfo::value_type const>
|
||||||
get_error_info( boost::exception const & x )
|
get_error_info( boost::exception const & x )
|
||||||
{
|
{
|
||||||
return exception_detail::get_data<ErrorInfo>(x);
|
return exception_detail::get_info<ErrorInfo>(x);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
template <class ErrorInfo,class E>
|
template <class ErrorInfo,class E>
|
||||||
@ -50,7 +50,7 @@ boost
|
|||||||
get_error_info( E const & some_exception )
|
get_error_info( E const & some_exception )
|
||||||
{
|
{
|
||||||
if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
|
if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
|
||||||
return exception_detail::get_data<ErrorInfo>(*x);
|
return exception_detail::get_info<ErrorInfo>(*x);
|
||||||
else
|
else
|
||||||
return shared_ptr<typename ErrorInfo::value_type const>();
|
return shared_ptr<typename ErrorInfo::value_type const>();
|
||||||
}
|
}
|
||||||
|
@ -146,16 +146,6 @@ boost
|
|||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
|
||||||
set_data( exception const * e, shared_ptr<exception_detail::error_info_base const> const & x, exception_detail::type_info_ const & typeid_ )
|
|
||||||
{
|
|
||||||
exception_detail::error_info_container * c;
|
|
||||||
if( !(c=e->data_.get()) )
|
|
||||||
e->data_.adopt(c=new exception_detail::error_info_container_impl);
|
|
||||||
c->set(x,typeid_);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class E,class Tag,class T>
|
template <class E,class Tag,class T>
|
||||||
@ -165,8 +155,11 @@ boost
|
|||||||
{
|
{
|
||||||
typedef error_info<Tag,T> error_info_tag_t;
|
typedef error_info<Tag,T> error_info_tag_t;
|
||||||
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
|
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
|
||||||
exception_detail::set_data(&x,p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
|
exception_detail::error_info_container * c;
|
||||||
return x;
|
if( !(c=x.data_.get()) )
|
||||||
|
x.data_.adopt(c=new exception_detail::error_info_container_impl);
|
||||||
|
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
|
||||||
|
return x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/diagnostic_information.hpp>
|
#include <boost/exception/diagnostic_information.hpp>
|
||||||
|
#include <boost/exception/diagnostic_information.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/error_info.hpp>
|
#include <boost/exception/error_info.hpp>
|
||||||
|
#include <boost/exception/error_info.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception.hpp>
|
#include <boost/exception.hpp>
|
||||||
|
#include <boost/exception.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception_ptr.hpp>
|
#include <boost/exception_ptr.hpp>
|
||||||
|
#include <boost/exception_ptr.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/get_error_info.hpp>
|
#include <boost/exception/get_error_info.hpp>
|
||||||
|
#include <boost/exception/get_error_info.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/info.hpp>
|
#include <boost/exception/info.hpp>
|
||||||
|
#include <boost/exception/info.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/info_tuple.hpp>
|
#include <boost/exception/info_tuple.hpp>
|
||||||
|
#include <boost/exception/info_tuple.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/to_string.hpp>
|
#include <boost/exception/to_string.hpp>
|
||||||
|
#include <boost/exception/to_string.hpp>
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/exception/to_string_stub.hpp>
|
#include <boost/exception/to_string_stub.hpp>
|
||||||
|
#include <boost/exception/to_string_stub.hpp>
|
||||||
|
Reference in New Issue
Block a user