nitpicking

[SVN r48488]
This commit is contained in:
Emil Dotchevski
2008-08-31 04:05:19 +00:00
parent 5c84929742
commit 5d4c014f5b
14 changed files with 4525 additions and 4526 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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_;
}; };

View File

@ -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>();
} }

View File

@ -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,7 +155,10 @@ 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;
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; return x;
} }
} }

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>