shared_ptr -> std::shared_ptr

This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
This commit is contained in:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -25,7 +25,7 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
// do not derive from the classes below. If you want to extend this functionality
@@ -33,10 +33,10 @@ namespace archive {
// preserve correct static polymorphism.
// same as binary_iarchive below - without the shared_ptr_helper
class naked_binary_iarchive :
class naked_binary_iarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_iarchive,
std::istream::char_type,
boost::archive::naked_binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>
{
@@ -56,22 +56,22 @@ public:
} // namespace archive
} // namespace boost
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
namespace boost {
namespace boost {
namespace archive {
// do not derive from this class. If you want to extend this functionality
// via inhertance, derived from binary_iarchive_impl instead. This will
// preserve correct static polymorphism.
class binary_iarchive :
class binary_iarchive :
public binary_iarchive_impl<
boost::archive::binary_iarchive,
std::istream::char_type,
boost::archive::binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>,
public detail::shared_ptr_helper

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -25,29 +25,29 @@
#include <boost/archive/binary_iarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>
namespace boost {
namespace boost {
namespace archive {
// same as binary_wiarchive below - without the shared_ptr_helper
class naked_binary_wiarchive :
class naked_binary_wiarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_wiarchive,
std::wistream::char_type,
boost::archive::naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>
{
public:
naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(is, flags)
{}
naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(bsb, flags)
{}
@@ -56,16 +56,16 @@ public:
} // namespace archive
} // namespace boost
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
namespace boost {
namespace boost {
namespace archive {
class binary_wiarchive :
class binary_wiarchive :
public binary_iarchive_impl<
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
>

View File

@@ -40,7 +40,7 @@ namespace std{
namespace boost {
template<class T>
class shared_ptr;
class std::shared_ptr;
namespace serialization {
class extended_type_info;
} // namespace serialization
@@ -155,9 +155,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>

View File

@@ -39,7 +39,7 @@ namespace std{
namespace boost {
template<class T>
class shared_ptr;
class std::shared_ptr;
namespace serialization {
class extended_type_info;
} // namespace serialization

View File

@@ -22,7 +22,7 @@
#include <cstddef> // NULL
#include <boost/config.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/type_traits/is_polymorphic.hpp>
#include <boost/serialization/type_info_implementation.hpp>
@@ -35,16 +35,16 @@
#include <boost/archive/detail/abi_prefix.hpp> // must be the last headern
namespace boost_132 {
template<class T> class shared_ptr;
template<class T> class std::shared_ptr;
}
namespace boost {
template<class T> class shared_ptr;
template<class T> class std::shared_ptr;
namespace serialization {
class extended_type_info;
template<class Archive, class T>
inline void load(
Archive & ar,
boost::shared_ptr< T > &t,
boost::std::shared_ptr< T > &t,
const unsigned int file_version
);
}
@@ -57,14 +57,14 @@ namespace detail {
class shared_ptr_helper {
struct collection_type_compare {
bool operator()(
const shared_ptr<const void> &lhs,
const shared_ptr<const void> &rhs
const std::shared_ptr<const void> &lhs,
const std::shared_ptr<const void> &rhs
)const{
return lhs.get() < rhs.get();
}
};
typedef std::set<
boost::shared_ptr<const void>,
boost::std::shared_ptr<const void>,
collection_type_compare
> collection_type;
typedef collection_type::const_iterator iterator_type;
@@ -72,7 +72,7 @@ class shared_ptr_helper {
// is used to "match up" shared pointers loaded at different
// points in the archive. Note, we delay construction until
// it is actually used since this is by default included as
// a "mix-in" even if shared_ptr isn't used.
// a "mix-in" even if std::shared_ptr isn't used.
collection_type * m_pointers;
struct null_deleter {
@@ -95,7 +95,7 @@ public:
template<class Archive, class T>
friend inline void boost::serialization::load(
Archive & ar,
boost::shared_ptr< T > &t,
boost::std::shared_ptr< T > &t,
const unsigned int file_version
);
#endif
@@ -109,44 +109,44 @@ public:
// new system which is disjoint from this set. This is implemented
// by a change in load_construct_data below. It makes this file suitable
// only for loading pointers into a 1.33 or later boost system.
std::list<boost_132::shared_ptr<const void> > * m_pointers_132;
std::list<boost_132::std::shared_ptr<const void> > * m_pointers_132;
// #endif
// returns pointer to object and an indicator whether this is a
// new entry (true) or a previous one (false)
BOOST_ARCHIVE_DECL(shared_ptr<void>)
BOOST_ARCHIVE_DECL(std::shared_ptr<void>)
get_od(
const void * od,
const boost::serialization::extended_type_info * true_type,
const boost::serialization::extended_type_info * true_type,
const boost::serialization::extended_type_info * this_type
);
BOOST_ARCHIVE_DECL(void)
append(const boost::shared_ptr<const void> &);
append(const boost::std::shared_ptr<const void> &);
template<class T>
struct non_polymorphic {
static const boost::serialization::extended_type_info *
static const boost::serialization::extended_type_info *
get_object_identifier(T &){
return & boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
>::get_const_instance();
}
};
template<class T>
struct polymorphic {
static const boost::serialization::extended_type_info *
static const boost::serialization::extended_type_info *
get_object_identifier(T & t){
return boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
>::get_const_instance().get_derived_extended_type_info(t);
}
};
public:
template<class T>
void reset(shared_ptr< T > & s, T * t){
void reset(std::shared_ptr< T > & s, T * t){
if(NULL == t){
s.reset();
return;
@@ -175,9 +175,9 @@ public:
this_type->get_debug_info()
)
);
shared_ptr<void> r =
std::shared_ptr<void> r =
get_od(
static_cast<const void *>(t),
static_cast<const void *>(t),
true_type,
this_type
);
@@ -188,11 +188,11 @@ public:
*this_type,
static_cast<const void *>(t)
);
shared_ptr<const void> sp(s, od);
std::shared_ptr<const void> sp(s, od);
append(sp);
}
else{
s = shared_ptr< T >(
s = std::shared_ptr< T >(
r,
static_cast<T *>(r.get())
);
@@ -201,7 +201,7 @@ public:
// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
BOOST_ARCHIVE_DECL(void)
append(const boost_132::shared_ptr<const void> & t);
append(const boost_132::std::shared_ptr<const void> & t);
// #endif
public:
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// text_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -32,11 +32,11 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class Archive>
class text_iarchive_impl :
class text_iarchive_impl :
public basic_text_iprimitive<std::istream>,
public basic_text_iarchive<Archive>
{
@@ -62,16 +62,16 @@ protected:
load(v);
t = boost::serialization::item_version_type(v);
}
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(wchar_t * t);
#endif
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(std::wstring &ws);
#endif
// note: the following should not needed - but one compiler (vc 7.1)
@@ -85,10 +85,10 @@ protected:
load_override(class_name_type & t, int);
BOOST_ARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
text_iarchive_impl(std::istream & is, unsigned int flags);
// don't import inline definitions! leave this as a reminder.
//BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
//BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
~text_iarchive_impl(){};
};
@@ -97,7 +97,7 @@ protected:
// preserve correct static polymorphism.
// same as text_iarchive below - without the shared_ptr_helper
class naked_text_iarchive :
class naked_text_iarchive :
public text_iarchive_impl<naked_text_iarchive>
{
public:
@@ -117,9 +117,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -128,10 +128,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class text_iarchive :
class text_iarchive :
public text_iarchive_impl<text_iarchive>,
public detail::shared_ptr_helper
{

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// text_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -36,11 +36,11 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class Archive>
class text_wiarchive_impl :
class text_wiarchive_impl :
public basic_text_iprimitive<std::wistream>,
public basic_text_iarchive<Archive>
{
@@ -84,7 +84,7 @@ protected:
void load_override(T & t, BOOST_PFTO int){
basic_text_iarchive<Archive>::load_override(t, 0);
}
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
text_wiarchive_impl(std::wistream & is, unsigned int flags);
~text_wiarchive_impl(){};
};
@@ -94,7 +94,7 @@ protected:
// preserve correct static polymorphism.
// same as text_wiarchive below - without the shared_ptr_helper
class naked_text_wiarchive :
class naked_text_wiarchive :
public text_wiarchive_impl<naked_text_wiarchive>
{
public:
@@ -113,9 +113,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -124,10 +124,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class text_wiarchive :
class text_wiarchive :
public text_wiarchive_impl<text_wiarchive>,
public detail::shared_ptr_helper
{

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// xml_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -32,7 +32,7 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class CharType>
@@ -40,7 +40,7 @@ class basic_xml_grammar;
typedef basic_xml_grammar<char> xml_grammar;
template<class Archive>
class xml_iarchive_impl :
class xml_iarchive_impl :
public basic_text_iprimitive<std::istream>,
public basic_xml_iarchive<Archive>
{
@@ -64,13 +64,13 @@ protected:
void load(T & t){
basic_text_iprimitive<std::istream>::load(t);
}
void
void
load(version_type & t){
unsigned int v;
load(v);
t = version_type(v);
}
void
void
load(boost::serialization::item_version_type & t){
unsigned int v;
load(v);
@@ -96,7 +96,7 @@ protected:
load_override(class_name_type & t, int);
BOOST_ARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
xml_iarchive_impl(std::istream & is, unsigned int flags);
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
~xml_iarchive_impl();
@@ -107,7 +107,7 @@ protected:
// preserve correct static polymorphism.
// same as xml_iarchive below - without the shared_ptr_helper
class naked_xml_iarchive :
class naked_xml_iarchive :
public xml_iarchive_impl<naked_xml_iarchive>
{
public:
@@ -126,9 +126,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -137,10 +137,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class xml_iarchive :
class xml_iarchive :
public xml_iarchive_impl<xml_iarchive>,
public detail::shared_ptr_helper
{

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// xml_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -37,7 +37,7 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class CharType>
@@ -45,7 +45,7 @@ class basic_xml_grammar;
typedef basic_xml_grammar<wchar_t> xml_wgrammar;
template<class Archive>
class xml_wiarchive_impl :
class xml_wiarchive_impl :
public basic_text_iprimitive<std::wistream>,
public basic_xml_iarchive<Archive>
{
@@ -65,17 +65,17 @@ protected:
return is;
}
template<class T>
void
void
load(T & t){
basic_text_iprimitive<std::wistream>::load(t);
}
void
void
load(version_type & t){
unsigned int v;
load(v);
t = version_type(v);
}
void
void
load(boost::serialization::item_version_type & t){
unsigned int v;
load(v);
@@ -99,11 +99,11 @@ protected:
}
BOOST_WARCHIVE_DECL(void)
load_override(class_name_type & t, int);
BOOST_WARCHIVE_DECL(void)
BOOST_WARCHIVE_DECL(void)
init();
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
xml_wiarchive_impl(std::wistream & is, unsigned int flags) ;
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
~xml_wiarchive_impl();
};
@@ -112,7 +112,7 @@ protected:
// preserve correct static polymorphism.
// same as xml_wiarchive below - without the shared_ptr_helper
class naked_xml_wiarchive :
class naked_xml_wiarchive :
public xml_wiarchive_impl<naked_xml_wiarchive>
{
public:
@@ -126,14 +126,14 @@ public:
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
# pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -142,10 +142,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class xml_wiarchive :
class xml_wiarchive :
public xml_wiarchive_impl<xml_wiarchive>,
public detail::shared_ptr_helper
{

View File

@@ -144,7 +144,7 @@
# endif // defined(BOOST_MSVC)
#endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
// Standard library support for shared_ptr and weak_ptr.
// Standard library support for std::shared_ptr and weak_ptr.
#if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)

View File

@@ -1,5 +1,5 @@
//
// detail/shared_ptr.hpp
// detail/std::shared_ptr.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
@@ -20,7 +20,7 @@
#if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
# include <memory>
#else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
#endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
namespace boost {
@@ -30,7 +30,7 @@ namespace detail {
#if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
using std::shared_ptr;
#else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
using boost::shared_ptr;
using boost::std::shared_ptr;
#endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
} // namespace detail

View File

@@ -18,7 +18,7 @@
#include <boost/asio/detail/config.hpp>
#include <boost/system/error_code.hpp>
#include <boost/asio/detail/shared_ptr.hpp>
#include <boost/asio/detail/std::shared_ptr.hpp>
#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/detail/weak_ptr.hpp>
@@ -60,7 +60,7 @@ enum
typedef unsigned char state_type;
struct noop_deleter { void operator()(void*) {} };
typedef shared_ptr<void> shared_cancel_token_type;
typedef std::shared_ptr<void> shared_cancel_token_type;
typedef weak_ptr<void> weak_cancel_token_type;
BOOST_ASIO_DECL socket_type accept(socket_type s, socket_addr_type* addr,

View File

@@ -232,19 +232,19 @@ public:
* <tt>delete static_cast<io_service::service*>(svc)</tt>.
*
* @note The destruction sequence described above permits programs to
* simplify their resource management by using @c shared_ptr<>. Where an
* simplify their resource management by using @c std::shared_ptr<>. Where an
* object's lifetime is tied to the lifetime of a connection (or some other
* sequence of asynchronous operations), a @c shared_ptr to the object would
* sequence of asynchronous operations), a @c std::shared_ptr to the object would
* be bound into the handlers for all asynchronous operations associated with
* it. This works as follows:
*
* @li When a single connection ends, all associated asynchronous operations
* complete. The corresponding handler objects are destroyed, and all
* @c shared_ptr references to the objects are destroyed.
* @c std::shared_ptr references to the objects are destroyed.
*
* @li To shut down the whole program, the io_service function stop() is
* called to terminate any run() calls as soon as possible. The io_service
* destructor defined above destroys all handlers, causing all @c shared_ptr
* destructor defined above destroys all handlers, causing all @c std::shared_ptr
* references to all connection objects to be destroyed.
*/
BOOST_ASIO_DECL ~io_service();

View File

@@ -21,7 +21,7 @@
#include <iterator>
#include <string>
#include <vector>
#include <boost/asio/detail/shared_ptr.hpp>
#include <boost/asio/detail/std::shared_ptr.hpp>
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/ip/basic_resolver_entry.hpp>
@@ -184,7 +184,7 @@ private:
}
typedef std::vector<basic_resolver_entry<InternetProtocol> > values_type;
boost::asio::detail::shared_ptr<values_type> values_;
boost::asio::detail::std::shared_ptr<values_type> values_;
std::size_t index_;
};

View File

@@ -37,7 +37,7 @@ public:
do_init()
{
::SSL_library_init();
::SSL_load_error_strings();
::SSL_load_error_strings();
::OpenSSL_add_all_algorithms();
mutexes_.resize(::CRYPTO_num_locks());
@@ -75,7 +75,7 @@ private:
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
}
static void openssl_locking_func(int mode, int n,
static void openssl_locking_func(int mode, int n,
const char* /*file*/, int /*line*/)
{
if (mode & CRYPTO_LOCK)
@@ -85,7 +85,7 @@ private:
}
// Mutexes to be used in locking callbacks.
std::vector<boost::asio::detail::shared_ptr<
std::vector<boost::asio::detail::std::shared_ptr<
boost::asio::detail::mutex> > mutexes_;
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
@@ -94,10 +94,10 @@ private:
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
};
boost::asio::detail::shared_ptr<openssl_init_base::do_init>
boost::asio::detail::std::shared_ptr<openssl_init_base::do_init>
openssl_init_base::instance()
{
static boost::asio::detail::shared_ptr<do_init> init(new do_init);
static boost::asio::detail::std::shared_ptr<do_init> init(new do_init);
return init;
}

View File

@@ -18,7 +18,7 @@
#include <boost/asio/detail/config.hpp>
#include <cstring>
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/shared_ptr.hpp>
#include <boost/asio/detail/std::shared_ptr.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -39,7 +39,7 @@ protected:
// main, and therefore before any other threads can get started. The do_init
// instance must be static in this function to ensure that it gets
// initialised before any other global objects try to use it.
BOOST_ASIO_DECL static boost::asio::detail::shared_ptr<do_init> instance();
BOOST_ASIO_DECL static boost::asio::detail::std::shared_ptr<do_init> instance();
};
template <bool Do_Init = true>
@@ -68,7 +68,7 @@ private:
// Reference to singleton do_init object to ensure that openssl does not get
// cleaned up until the last user has finished with it.
boost::asio::detail::shared_ptr<do_init> ref_;
boost::asio::detail::std::shared_ptr<do_init> ref_;
};
template <bool Do_Init>

View File

@@ -1,12 +1,12 @@
// (C) Copyright John Maddock 2001 - 2003.
// (C) Copyright Darin Adler 2001 - 2002.
// (C) Copyright Jens Maurer 2001 - 2002.
// (C) Copyright Beman Dawes 2001 - 2003.
// (C) Copyright Douglas Gregor 2002.
// (C) Copyright David Abrahams 2002 - 2003.
// (C) Copyright Synge Todo 2003.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001 - 2003.
// (C) Copyright Darin Adler 2001 - 2002.
// (C) Copyright Jens Maurer 2001 - 2002.
// (C) Copyright Beman Dawes 2001 - 2003.
// (C) Copyright Douglas Gregor 2002.
// (C) Copyright David Abrahams 2002 - 2003.
// (C) Copyright Synge Todo 2003.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org for most recent version.
@@ -15,7 +15,7 @@
#if __GNUC__ < 3
# if __GNUC_MINOR__ == 91
// egcs 1.1 won't parse shared_ptr.hpp without this:
// egcs 1.1 won't parse std::shared_ptr.hpp without this:
# define BOOST_NO_AUTO_PTR
# endif
# if __GNUC_MINOR__ < 95
@@ -97,7 +97,7 @@
//
#if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
# define BOOST_HAS_THREADS
#endif
#endif
//
// gcc has "long long"
@@ -116,7 +116,7 @@
//
#if __GNUC__ >= 4
# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__)
// All Win32 development environments, including 64-bit Windows and MinGW, define
// All Win32 development environments, including 64-bit Windows and MinGW, define
// _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
// so does not define _WIN32 or its variants.
# define BOOST_HAS_DECLSPEC
@@ -128,7 +128,7 @@
# endif
# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
#else
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif
@@ -169,7 +169,7 @@
# define BOOST_NO_CXX11_RVALUE_REFERENCES
# define BOOST_NO_CXX11_STATIC_ASSERT
// Variadic templates compiler:
// Variadic templates compiler:
// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
# define BOOST_HAS_VARIADIC_TMPL

View File

@@ -1,10 +1,10 @@
// (C) Copyright John Maddock 2001.
// (C) Copyright Jens Maurer 2001 - 2003.
// (C) Copyright Peter Dimov 2002.
// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
// (C) Copyright David Abrahams 2002.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001.
// (C) Copyright Jens Maurer 2001 - 2003.
// (C) Copyright Peter Dimov 2002.
// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
// (C) Copyright David Abrahams 2002.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org for most recent version.
@@ -34,7 +34,7 @@
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# endif
# if (__SUNPRO_CC <= 0x530)
# if (__SUNPRO_CC <= 0x530)
// Requesting debug info (-g) with Boost.Python results
// in an internal compiler error for "static const"
// initialized in-class.
@@ -44,7 +44,7 @@
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// SunPro 5.3 has better support for partial specialization,
// but breaks when compiling std::less<shared_ptr<T> >
// but breaks when compiling std::less<std::shared_ptr<T> >
// (Jens Maurer 4 Nov 2001).
// std::less specialization fixed as reported by George
@@ -57,7 +57,7 @@
# define BOOST_NO_INTEGRAL_INT64_T
# endif
# if (__SUNPRO_CC < 0x570)
# if (__SUNPRO_CC < 0x570)
# define BOOST_NO_TEMPLATE_TEMPLATES
// see http://lists.boost.org/MailArchives/boost/msg47184.php
// and http://lists.boost.org/MailArchives/boost/msg47220.php
@@ -65,7 +65,7 @@
# define BOOST_NO_SFINAE
# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
# endif
# if (__SUNPRO_CC <= 0x580)
# if (__SUNPRO_CC <= 0x580)
# define BOOST_NO_IS_ABSTRACT
# endif

View File

@@ -1,9 +1,9 @@
// (C) Copyright John Maddock 2001 - 2003.
// (C) Copyright Bill Kempf 2001.
// (C) Copyright Aleksey Gurtovoy 2003.
// (C) Copyright John Maddock 2001 - 2003.
// (C) Copyright Bill Kempf 2001.
// (C) Copyright Aleksey Gurtovoy 2003.
// (C) Copyright Rene Rivera 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// Use, modification and distribution are subject to 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)
// See http://www.boost.org for most recent version.
@@ -46,11 +46,11 @@
//
// Win32 will normally be using native Win32 threads,
// but there is a pthread library avaliable as an option,
// we used to disable this when BOOST_DISABLE_WIN32 was
// we used to disable this when BOOST_DISABLE_WIN32 was
// defined but no longer - this should allow some
// files to be compiled in strict mode - while maintaining
// a consistent setting of BOOST_HAS_THREADS across
// all translation units (needed for shared_ptr etc).
// all translation units (needed for std::shared_ptr etc).
//
#ifdef _WIN32_WCE

View File

@@ -2,7 +2,7 @@
#define GREG_MONTH_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
@@ -11,7 +11,7 @@
#include "boost/date_time/constrained_value.hpp"
#include "boost/date_time/date_defs.hpp"
#include "boost/shared_ptr.hpp"
#include "boost/std::shared_ptr.hpp"
#include "boost/date_time/compiler_config.hpp"
#include <stdexcept>
#include <string>
@@ -39,7 +39,7 @@ namespace gregorian {
using date_time::Dec;
using date_time::NotAMonth;
using date_time::NumMonths;
//! Exception thrown if a greg_month is constructed with a value out of range
struct bad_month : public std::out_of_range
{
@@ -50,15 +50,15 @@ namespace gregorian {
//! A constrained range that implements the gregorian_month rules
typedef CV::constrained_value<greg_month_policies> greg_month_rep;
//! Wrapper class to represent months in gregorian based calendar
class BOOST_DATE_TIME_DECL greg_month : public greg_month_rep {
public:
typedef date_time::months_of_year month_enum;
typedef std::map<std::string, unsigned short> month_map_type;
typedef boost::shared_ptr<month_map_type> month_map_ptr_type;
typedef boost::std::shared_ptr<month_map_type> month_map_ptr_type;
//! Construct a month from the months_of_year enumeration
greg_month(month_enum theMonth) :
greg_month(month_enum theMonth) :
greg_month_rep(static_cast<greg_month_rep::value_type>(theMonth)) {}
//! Construct from a short value
greg_month(unsigned short theMonth) : greg_month_rep(theMonth) {}

View File

@@ -14,7 +14,7 @@
#include "boost/date_time/local_time/dst_transition_day_rules.hpp"
#include "boost/date_time/string_convert.hpp"
//#include "boost/date_time/special_defs.hpp"
#include "boost/shared_ptr.hpp"
#include "boost/std::shared_ptr.hpp"
namespace boost {
namespace local_time {
@@ -22,7 +22,7 @@ namespace local_time {
//typedef boost::date_time::time_zone_names time_zone_names;
typedef boost::date_time::dst_adjustment_offsets<boost::posix_time::time_duration> dst_adjustment_offsets;
//typedef boost::date_time::time_zone_base<boost::posix_time::ptime> time_zone;
typedef boost::shared_ptr<dst_calc_rule> dst_calc_rule_ptr;
typedef boost::std::shared_ptr<dst_calc_rule> dst_calc_rule_ptr;
//! A real time zone
template<class CharT>
@@ -38,7 +38,7 @@ namespace local_time {
custom_time_zone_base(const time_zone_names& zone_names,
const time_duration_type& utc_offset,
const dst_adjustment_offsets& dst_shift,
boost::shared_ptr<dst_calc_rule> calc_rule) :
boost::std::shared_ptr<dst_calc_rule> calc_rule) :
zone_names_(zone_names),
base_utc_offset_(utc_offset),
dst_offsets_(dst_shift),
@@ -100,7 +100,7 @@ namespace local_time {
// std offset dst [offset],start[/time],end[/time] - w/o spaces
stringstream_type ss;
ss.fill('0');
boost::shared_ptr<dst_calc_rule> no_rules;
boost::std::shared_ptr<dst_calc_rule> no_rules;
// std
ss << std_zone_abbrev();
// offset
@@ -157,7 +157,7 @@ namespace local_time {
bool has_dst_;
time_duration_type base_utc_offset_;
dst_adjustment_offsets dst_offsets_;
boost::shared_ptr<dst_calc_rule> dst_calc_rules_;
boost::std::shared_ptr<dst_calc_rule> dst_calc_rules_;
};
typedef custom_time_zone_base<char> custom_time_zone;

View File

@@ -12,7 +12,7 @@
#include <iomanip>
#include <sstream>
#include <stdexcept>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/throw_exception.hpp>
#include <boost/date_time/time.hpp>
#include <boost/date_time/posix_time/posix_time.hpp> //todo remove?
@@ -57,7 +57,7 @@ namespace local_time {
* to wall clock time are made as needed. This approach allows for
* operations between wall-clock times in different time zones, and
* daylight savings time considerations, to be made. Time zones are
* required to be in the form of a boost::shared_ptr<time_zone_base>.
* required to be in the form of a boost::std::shared_ptr<time_zone_base>.
*/
template<class utc_time_=posix_time::ptime,
class tz_type=date_time::time_zone_base<utc_time_,char> >
@@ -79,7 +79,7 @@ namespace local_time {
*@param tz Timezone for to adjust the UTC time to.
*/
local_date_time_base(utc_time_type t,
boost::shared_ptr<tz_type> tz) :
boost::std::shared_ptr<tz_type> tz) :
date_time::base_time<utc_time_type, time_system_type>(t),
zone_(tz)
{
@@ -99,12 +99,12 @@ namespace local_time {
*/
local_date_time_base(date_type d,
time_duration_type td,
boost::shared_ptr<tz_type> tz,
boost::std::shared_ptr<tz_type> tz,
bool dst_flag) : //necessary for constr_adj()
date_time::base_time<utc_time_type,time_system_type>(construction_adjustment(utc_time_type(d, td), tz, dst_flag)),
zone_(tz)
{
if(tz != boost::shared_ptr<tz_type>() && tz->has_dst()){
if(tz != boost::std::shared_ptr<tz_type>() && tz->has_dst()){
// d & td are already local so we use them
time_is_dst_result result = check_dst(d, td, tz);
@@ -140,7 +140,7 @@ namespace local_time {
*/
local_date_time_base(date_type d,
time_duration_type td,
boost::shared_ptr<tz_type> tz,
boost::std::shared_ptr<tz_type> tz,
DST_CALC_OPTIONS calc_option) :
// dummy value - time_ is set in constructor code
date_time::base_time<utc_time_type,time_system_type>(utc_time_type(d,td)),
@@ -189,9 +189,9 @@ namespace local_time {
*/
static time_is_dst_result check_dst(date_type d,
time_duration_type td,
boost::shared_ptr<tz_type> tz)
boost::std::shared_ptr<tz_type> tz)
{
if(tz != boost::shared_ptr<tz_type>() && tz->has_dst()) {
if(tz != boost::std::shared_ptr<tz_type>() && tz->has_dst()) {
typedef typename date_time::dst_calculator<date_type, time_duration_type> dst_calculator;
return dst_calculator::local_is_dst(
d, td,
@@ -218,20 +218,20 @@ namespace local_time {
//! Special values constructor
explicit local_date_time_base(const boost::date_time::special_values sv,
boost::shared_ptr<tz_type> tz = boost::shared_ptr<tz_type>()) :
boost::std::shared_ptr<tz_type> tz = boost::std::shared_ptr<tz_type>()) :
date_time::base_time<utc_time_type, time_system_type>(utc_time_type(sv)),
zone_(tz)
{}
//! returns time zone associated with calling instance
boost::shared_ptr<tz_type> zone() const
boost::std::shared_ptr<tz_type> zone() const
{
return zone_;
}
//! returns false is time_zone is NULL and if time value is a special_value
bool is_dst() const
{
if(zone_ != boost::shared_ptr<tz_type>() && zone_->has_dst() && !this->is_special()) {
if(zone_ != boost::std::shared_ptr<tz_type>() && zone_->has_dst() && !this->is_special()) {
// check_dst takes a local time, *this is utc
utc_time_type lt(this->time_);
lt += zone_->base_utc_offset();
@@ -265,7 +265,7 @@ namespace local_time {
//! Returns object's time value as a local representation
utc_time_type local_time() const
{
if(zone_ != boost::shared_ptr<tz_type>()){
if(zone_ != boost::std::shared_ptr<tz_type>()){
utc_time_type lt = this->utc_time() + zone_->base_utc_offset();
if (is_dst()) {
lt += zone_->dst_offset();
@@ -286,7 +286,7 @@ namespace local_time {
ss << utc_time();
return ss.str();
}
if(zone_ == boost::shared_ptr<tz_type>()) {
if(zone_ == boost::std::shared_ptr<tz_type>()) {
ss << utc_time() << " UTC";
return ss.str();
}
@@ -306,7 +306,7 @@ namespace local_time {
}
/*! returns a local_date_time_base in the given time zone with the
* optional time_duration added. */
local_date_time_base local_time_in(boost::shared_ptr<tz_type> new_tz,
local_date_time_base local_time_in(boost::std::shared_ptr<tz_type> new_tz,
time_duration_type td=time_duration_type(0,0,0)) const
{
return local_date_time_base(utc_time_type(this->time_) + td, new_tz);
@@ -318,7 +318,7 @@ namespace local_time {
* classes that do not use a time_zone */
std::string zone_name(bool as_offset=false) const
{
if(zone_ == boost::shared_ptr<tz_type>()) {
if(zone_ == boost::std::shared_ptr<tz_type>()) {
if(as_offset) {
return std::string("Z");
}
@@ -352,7 +352,7 @@ namespace local_time {
* that do not use a time_zone */
std::string zone_abbrev(bool as_offset=false) const
{
if(zone_ == boost::shared_ptr<tz_type>()) {
if(zone_ == boost::std::shared_ptr<tz_type>()) {
if(as_offset) {
return std::string("Z");
}
@@ -384,7 +384,7 @@ namespace local_time {
//! returns a posix_time_zone string for the associated time_zone. If no time_zone, "UTC+00" is returned.
std::string zone_as_posix_string() const
{
if(zone_ == shared_ptr<tz_type>()) {
if(zone_ == std::shared_ptr<tz_type>()) {
return std::string("UTC+00");
}
return zone_->to_posix_string();
@@ -477,16 +477,16 @@ namespace local_time {
return utc_time_type(this->time_) - utc_time_type(rhs.time_);
}
private:
boost::shared_ptr<tz_type> zone_;
boost::std::shared_ptr<tz_type> zone_;
//bool is_dst_;
/*! Adjust the passed in time to UTC?
*/
utc_time_type construction_adjustment(utc_time_type t,
boost::shared_ptr<tz_type> z,
boost::std::shared_ptr<tz_type> z,
bool dst_flag)
{
if(z != boost::shared_ptr<tz_type>()) {
if(z != boost::std::shared_ptr<tz_type>()) {
if(dst_flag && z->has_dst()) {
t -= z->dst_offset();
} // else no adjust

View File

@@ -2,7 +2,7 @@
#define LOCAL_TIME_LOCAL_TIME_TYPES_HPP__
/* Copyright (c) 2003-2004 CrystalClear Software, Inc.
* Subject to the Boost Software License, Version 1.0.
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
* $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
@@ -20,21 +20,21 @@
namespace boost {
namespace local_time {
typedef boost::date_time::period<local_date_time,
typedef boost::date_time::period<local_date_time,
boost::posix_time::time_duration> local_time_period;
typedef date_time::time_itr<local_date_time> local_time_iterator;
typedef date_time::second_clock<local_date_time> local_sec_clock;
typedef date_time::second_clock<local_date_time> local_sec_clock;
typedef date_time::microsec_clock<local_date_time> local_microsec_clock;
typedef date_time::time_zone_base<posix_time::ptime, char> time_zone;
typedef date_time::time_zone_base<posix_time::ptime, wchar_t> wtime_zone;
//! Shared Pointer for custom_time_zone and posix_time_zone objects
typedef boost::shared_ptr<time_zone> time_zone_ptr;
typedef boost::shared_ptr<wtime_zone> wtime_zone_ptr;
typedef boost::std::shared_ptr<time_zone> time_zone_ptr;
typedef boost::std::shared_ptr<wtime_zone> wtime_zone_ptr;
typedef date_time::time_zone_names_base<char> time_zone_names;
typedef date_time::time_zone_names_base<wchar_t> wtime_zone_names;

View File

@@ -184,7 +184,7 @@ namespace local_time{
// std offset dst [offset],start[/time],end[/time] - w/o spaces
stringstream_type ss;
ss.fill('0');
boost::shared_ptr<dst_calc_rule> no_rules;
boost::std::shared_ptr<dst_calc_rule> no_rules;
// std
ss << std_zone_abbrev();
// offset
@@ -241,7 +241,7 @@ namespace local_time{
bool has_dst_;
time_duration_type base_utc_offset_;
dst_adjustment_offsets dst_offsets_;
boost::shared_ptr<dst_calc_rule> dst_calc_rules_;
boost::std::shared_ptr<dst_calc_rule> dst_calc_rules_;
/*! Extract time zone abbreviations for STD & DST as well
* as the offsets for the time shift that occurs and how
@@ -399,7 +399,7 @@ namespace local_time{
ew = lexical_cast<unsigned short>(*it++);
ed = lexical_cast<unsigned short>(*it);
dst_calc_rules_ = shared_ptr<dst_calc_rule>(
dst_calc_rules_ = std::shared_ptr<dst_calc_rule>(
new nth_kday_dst_rule(
nth_last_dst_rule::start_rule(
static_cast<nkday::week_num>(sw),sd,sm),
@@ -427,7 +427,7 @@ namespace local_time{
ed -= calendar::end_of_month_day(year,em++);
}
dst_calc_rules_ = shared_ptr<dst_calc_rule>(
dst_calc_rules_ = std::shared_ptr<dst_calc_rule>(
new partial_date_dst_rule(
partial_date_dst_rule::start_rule(
sd, static_cast<date_time::months_of_year>(sm)),
@@ -443,7 +443,7 @@ namespace local_time{
int sd=0, ed=0;
sd = lexical_cast<int>(s);
ed = lexical_cast<int>(e);
dst_calc_rules_ = shared_ptr<dst_calc_rule>(
dst_calc_rules_ = std::shared_ptr<dst_calc_rule>(
new partial_date_dst_rule(
partial_date_dst_rule::start_rule(++sd),// args are 0-365
partial_date_dst_rule::end_rule(++ed) // pd expects 1-366

View File

@@ -2,7 +2,7 @@
#define BOOST_DATE_TIME_TZ_DATABASE_HPP__
/* Copyright (c) 2003-2004 CrystalClear Software, Inc.
* Subject to the Boost Software License, Version 1.0.
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
* $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
@@ -17,11 +17,11 @@
namespace boost {
namespace local_time {
using date_time::data_not_accessible;
using date_time::bad_field_count;
using date_time::data_not_accessible;
using date_time::bad_field_count;
//! Object populated with boost::shared_ptr<time_zone_base> objects
/*! Object populated with boost::shared_ptr<time_zone_base> objects
//! Object populated with boost::std::shared_ptr<time_zone_base> objects
/*! Object populated with boost::std::shared_ptr<time_zone_base> objects
* Database is populated from specs stored in external csv file. See
* date_time::tz_db_base for greater detail */
typedef date_time::tz_db_base<custom_time_zone, nth_kday_dst_rule> tz_database;

View File

@@ -15,7 +15,7 @@
*/
#include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/date_time/compiler_config.hpp>
#include <boost/date_time/c_time.hpp>
@@ -50,7 +50,7 @@ namespace date_time {
//! return a local time object for the given zone, based on computer clock
//JKG -- looks like we could rewrite this against universal_time
template<class time_zone_type>
static time_type local_time(shared_ptr<time_zone_type> tz_ptr)
static time_type local_time(std::shared_ptr<time_zone_type> tz_ptr)
{
typedef typename time_type::utc_time_type utc_time_type;
typedef second_clock<utc_time_type> second_clock;

View File

@@ -14,7 +14,7 @@
*/
#include "boost/date_time/c_time.hpp"
#include "boost/shared_ptr.hpp"
#include "boost/std::shared_ptr.hpp"
namespace boost {
namespace date_time {
@@ -54,7 +54,7 @@ namespace date_time {
}
template<class time_zone_type>
static time_type local_time(boost::shared_ptr<time_zone_type> tz_ptr)
static time_type local_time(boost::std::shared_ptr<time_zone_type> tz_ptr)
{
typedef typename time_type::utc_time_type utc_time_type;
utc_time_type utc_time = second_clock<utc_time_type>::universal_time();

View File

@@ -2,7 +2,7 @@
#define DATE_TIME_TZ_DB_BASE_HPP__
/* Copyright (c) 2003-2005 CrystalClear Software, Inc.
* Subject to the Boost Software License, Version 1.0.
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
* $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $
@@ -15,7 +15,7 @@
#include <fstream>
#include <stdexcept>
#include <boost/tokenizer.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/throw_exception.hpp>
#include <boost/date_time/compiler_config.hpp>
#include <boost/date_time/time_zone_names.hpp>
@@ -29,20 +29,20 @@ namespace boost {
class data_not_accessible : public std::logic_error
{
public:
data_not_accessible() :
std::logic_error(std::string("Unable to locate or access the required datafile."))
data_not_accessible() :
std::logic_error(std::string("Unable to locate or access the required datafile."))
{}
data_not_accessible(const std::string& filespec) :
std::logic_error(std::string("Unable to locate or access the required datafile. Filespec: " + filespec))
data_not_accessible(const std::string& filespec) :
std::logic_error(std::string("Unable to locate or access the required datafile. Filespec: " + filespec))
{}
};
//! Exception thrown when tz database locates incorrect field structure in data file
class bad_field_count : public std::out_of_range
{
public:
bad_field_count(const std::string& s) :
std::out_of_range(s)
bad_field_count(const std::string& s) :
std::out_of_range(s)
{}
};
@@ -51,48 +51,48 @@ namespace boost {
* tz_db_base is intended to be customized by the
* library user. When customizing this file (or creating your own) the
* file must follow a specific format.
*
*
* This first line is expected to contain column headings and is therefore
* not processed by the tz_db_base.
*
* Each record (line) must have eleven fields. Some of those fields can
* be empty. Every field (even empty ones) must be enclosed in
* be empty. Every field (even empty ones) must be enclosed in
* double-quotes.
* Ex:
* @code
* "America/Phoenix" <- string enclosed in quotes
* "" <- empty field
* @endcode
*
* Some fields represent a length of time. The format of these fields
*
* Some fields represent a length of time. The format of these fields
* must be:
* @code
* "{+|-}hh:mm[:ss]" <- length-of-time format
* @endcode
* Where the plus or minus is mandatory and the seconds are optional.
*
* Since some time zones do not use daylight savings it is not always
* necessary for every field in a zone_spec to contain a value. All
* zone_specs must have at least ID and GMT offset. Zones that use
* daylight savings must have all fields filled except:
* STD ABBR, STD NAME, DST NAME. You should take note
* that DST ABBR is mandatory for zones that use daylight savings
*
* Since some time zones do not use daylight savings it is not always
* necessary for every field in a zone_spec to contain a value. All
* zone_specs must have at least ID and GMT offset. Zones that use
* daylight savings must have all fields filled except:
* STD ABBR, STD NAME, DST NAME. You should take note
* that DST ABBR is mandatory for zones that use daylight savings
* (see field descriptions for further details).
*
* ******* Fields and their description/details *********
*
* ID:
* ******* Fields and their description/details *********
*
* ID:
* Contains the identifying string for the zone_spec. Any string will
* do as long as it's unique. No two ID's can be the same.
* do as long as it's unique. No two ID's can be the same.
*
* STD ABBR:
* STD NAME:
* DST ABBR:
* DST NAME:
* These four are all the names and abbreviations used by the time
* zone being described. While any string will do in these fields,
* care should be taken. These fields hold the strings that will be
* used in the output of many of the local_time classes.
* These four are all the names and abbreviations used by the time
* zone being described. While any string will do in these fields,
* care should be taken. These fields hold the strings that will be
* used in the output of many of the local_time classes.
* Ex:
* @code
* time_zone nyc = tz_db.time_zone_from_region("America/New_York");
@@ -103,42 +103,42 @@ namespace boost {
* // 2004-Aug-30 00:00:00 EDT
* @endcode
*
* NOTE: The exact format/function names may vary - see local_time
* NOTE: The exact format/function names may vary - see local_time
* documentation for further details.
*
* GMT offset:
* This is the number of hours added to utc to get the local time
* before any daylight savings adjustments are made. Some examples
* This is the number of hours added to utc to get the local time
* before any daylight savings adjustments are made. Some examples
* are: America/New_York offset -5 hours, & Africa/Cairo offset +2 hours.
* The format must follow the length-of-time format described above.
*
* DST adjustment:
* The amount of time added to gmt_offset when daylight savings is in
* The amount of time added to gmt_offset when daylight savings is in
* effect. The format must follow the length-of-time format described
* above.
*
* DST Start Date rule:
* This is a specially formatted string that describes the day of year
* in which the transition take place. It holds three fields of it's own,
* separated by semicolons.
* The first field indicates the "nth" weekday of the month. The possible
* values are: 1 (first), 2 (second), 3 (third), 4 (fourth), 5 (fifth),
* separated by semicolons.
* The first field indicates the "nth" weekday of the month. The possible
* values are: 1 (first), 2 (second), 3 (third), 4 (fourth), 5 (fifth),
* and -1 (last).
* The second field indicates the day-of-week from 0-6 (Sun=0).
* The third field indicates the month from 1-12 (Jan=1).
*
* Examples are: "-1;5;9"="Last Friday of September",
*
* Examples are: "-1;5;9"="Last Friday of September",
* "2;1;3"="Second Monday of March"
*
* Start time:
* Start time is the number of hours past midnight, on the day of the
* start transition, the transition takes place. More simply put, the
* start transition, the transition takes place. More simply put, the
* time of day the transition is made (in 24 hours format). The format
* must follow the length-of-time format described above with the
* must follow the length-of-time format described above with the
* exception that it must always be positive.
*
* DST End date rule:
* See DST Start date rule. The difference here is this is the day
* See DST Start date rule. The difference here is this is the day
* daylight savings ends (transition to STD).
*
* End time:
@@ -147,13 +147,13 @@ namespace boost {
template<class time_zone_type, class rule_type>
class tz_db_base {
public:
/* Having CharT as a template parameter created problems
* with posix_time::duration_from_string. Templatizing
* duration_from_string was not possible at this time, however,
* it should be possible in the future (when poor compilers get
* fixed or stop being used).
* Since this class was designed to use CharT as a parameter it
* is simply typedef'd here to ease converting in back to a
/* Having CharT as a template parameter created problems
* with posix_time::duration_from_string. Templatizing
* duration_from_string was not possible at this time, however,
* it should be possible in the future (when poor compilers get
* fixed or stop being used).
* Since this class was designed to use CharT as a parameter it
* is simply typedef'd here to ease converting in back to a
* parameter the future */
typedef char char_type;
@@ -182,7 +182,7 @@ namespace boost {
{
string_type in_str;
std::string buff;
std::ifstream ifs(pathspec.c_str());
if(!ifs){
boost::throw_exception(data_not_accessible(pathspec));
@@ -192,27 +192,27 @@ namespace boost {
}
//! returns true if record successfully added to map
/*! Takes a region name in the form of "America/Phoenix", and a
* time_zone object for that region. The id string must be a unique
/*! Takes a region name in the form of "America/Phoenix", and a
* time_zone object for that region. The id string must be a unique
* name that does not already exist in the database. */
bool add_record(const string_type& region,
boost::shared_ptr<time_zone_base_type> tz)
bool add_record(const string_type& region,
boost::std::shared_ptr<time_zone_base_type> tz)
{
typename map_type::value_type p(region, tz);
typename map_type::value_type p(region, tz);
return (m_zone_map.insert(p)).second;
}
//! Returns a time_zone object built from the specs for the given region
/*! Returns a time_zone object built from the specs for the given
* region. If region does not exist a local_time::record_not_found
/*! Returns a time_zone object built from the specs for the given
* region. If region does not exist a local_time::record_not_found
* exception will be thrown */
boost::shared_ptr<time_zone_base_type>
time_zone_from_region(const string_type& region) const
boost::std::shared_ptr<time_zone_base_type>
time_zone_from_region(const string_type& region) const
{
// get the record
typename map_type::const_iterator record = m_zone_map.find(region);
if(record == m_zone_map.end()){
return boost::shared_ptr<time_zone_base_type>(); //null pointer
return boost::std::shared_ptr<time_zone_base_type>(); //null pointer
}
return record->second;
}
@@ -229,9 +229,9 @@ namespace boost {
}
return regions;
}
private:
typedef std::map<string_type, boost::shared_ptr<time_zone_base_type> > map_type;
typedef std::map<string_type, boost::std::shared_ptr<time_zone_base_type> > map_type;
map_type m_zone_map;
// start and end rule are of the same type
@@ -240,27 +240,27 @@ namespace boost {
/* TODO: mechanisms need to be put in place to handle different
* types of rule specs. parse_rules() only handles nth_kday
* rule types. */
//! parses rule specs for transition day rules
rule_type* parse_rules(const string_type& sr, const string_type& er) const
{
using namespace gregorian;
// start and end rule are of the same type,
// start and end rule are of the same type,
// both are included here for readability
typedef typename rule_type::start_rule start_rule;
typedef typename rule_type::end_rule end_rule;
// these are: [start|end] nth, day, month
int s_nth = 0, s_d = 0, s_m = 0;
int e_nth = 0, e_d = 0, e_m = 0;
split_rule_spec(s_nth, s_d, s_m, sr);
split_rule_spec(e_nth, e_d, e_m, er);
typename start_rule::week_num s_wn, e_wn;
s_wn = get_week_num(s_nth);
e_wn = get_week_num(e_nth);
return new rule_type(start_rule(s_wn, s_d, s_m),
end_rule(e_wn, e_d, e_m));
}
@@ -286,7 +286,7 @@ namespace boost {
}
return start_rule::fifth; // silence warnings
}
//! splits the [start|end]_date_rule string into 3 ints
void split_rule_spec(int& nth, int& d, int& m, string_type rule) const
{
@@ -297,22 +297,22 @@ namespace boost {
typedef boost::tokenizer<char_separator_type,
std::basic_string<char_type>::const_iterator,
std::basic_string<char_type> >::iterator tokenizer_iterator;
const char_type sep_char[] = { ';', '\0'};
char_separator_type sep(sep_char);
tokenizer tokens(rule, sep); // 3 fields
tokenizer_iterator tok_iter = tokens.begin();
tokenizer_iterator tok_iter = tokens.begin();
nth = std::atoi(tok_iter->c_str()); ++tok_iter;
d = std::atoi(tok_iter->c_str()); ++tok_iter;
m = std::atoi(tok_iter->c_str());
}
//! Take a line from the csv, turn it into a time_zone_type.
/*! Take a line from the csv, turn it into a time_zone_type,
* and add it to the map. Zone_specs in csv file are expected to
* have eleven fields that describe the time zone. Returns true if
* and add it to the map. Zone_specs in csv file are expected to
* have eleven fields that describe the time zone. Returns true if
* zone_spec successfully added to database */
bool parse_string(string_type& s)
{
@@ -333,16 +333,16 @@ namespace boost {
//take a shot at fixing gcc 4.x error
const unsigned int expected_fields = static_cast<unsigned int>(FIELD_COUNT);
if (result.size() != expected_fields) {
if (result.size() != expected_fields) {
std::ostringstream msg;
msg << "Expecting " << FIELD_COUNT << " fields, got "
msg << "Expecting " << FIELD_COUNT << " fields, got "
<< result.size() << " fields in line: " << s;
boost::throw_exception(bad_field_count(msg.str()));
BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return false); // should never reach
}
// initializations
bool has_dst = true;
bool has_dst = true;
if(result[DSTABBR] == std::string()){
has_dst = false;
}
@@ -352,14 +352,14 @@ namespace boost {
time_zone_names names(result[STDNAME], result[STDABBR],
result[DSTNAME], result[DSTABBR]);
time_duration_type utc_offset =
time_duration_type utc_offset =
str_from_delimited_time_duration<time_duration_type,char_type>(result[GMTOFFSET]);
dst_adjustment_offsets adjust(time_duration_type(0,0,0),
time_duration_type(0,0,0),
time_duration_type(0,0,0));
boost::shared_ptr<rule_type> rules;
boost::std::shared_ptr<rule_type> rules;
if(has_dst){
adjust = dst_adjustment_offsets(
@@ -368,16 +368,16 @@ namespace boost {
str_from_delimited_time_duration<time_duration_type,char_type>(result[END_TIME])
);
rules =
boost::shared_ptr<rule_type>(parse_rules(result[START_DATE_RULE],
rules =
boost::std::shared_ptr<rule_type>(parse_rules(result[START_DATE_RULE],
result[END_DATE_RULE]));
}
string_type id(result[ID]);
boost::shared_ptr<time_zone_base_type> zone(new time_zone_type(names, utc_offset, adjust, rules));
boost::std::shared_ptr<time_zone_base_type> zone(new time_zone_type(names, utc_offset, adjust, rules));
return (add_record(id, zone));
}
}
};
} } // namespace

View File

@@ -21,7 +21,7 @@
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/exception/detail/clone_current_exception.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <stdexcept>
#include <new>
#include <ios>
@@ -37,7 +37,7 @@ boost
class
exception_ptr
{
typedef boost::shared_ptr<exception_detail::clone_base const> impl;
typedef boost::std::shared_ptr<exception_detail::clone_base const> impl;
impl ptr_;
friend void rethrow_exception( exception_ptr const & );
typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const;
@@ -122,7 +122,7 @@ boost
throw_function(BOOST_CURRENT_FUNCTION) <<
throw_file(__FILE__) <<
throw_line(__LINE__);
static exception_ptr ep(shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c)));
static exception_ptr ep(std::shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c)));
return ep;
}
@@ -305,7 +305,7 @@ boost
success:
{
BOOST_ASSERT(e!=0);
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e));
return exception_ptr(std::shared_ptr<exception_detail::clone_base const>(e));
}
case exception_detail::clone_current_exception_result::
bad_alloc:
@@ -332,7 +332,7 @@ boost
catch(
exception_detail::clone_base & e )
{
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone()));
return exception_ptr(std::shared_ptr<exception_detail::clone_base const>(e.clone()));
}
catch(
std::domain_error & e )

View File

@@ -145,7 +145,7 @@ boost
#endif
template <class T>
class shared_ptr;
class std::shared_ptr;
namespace
exception_detail
@@ -157,8 +157,8 @@ boost
error_info_container
{
virtual char const * diagnostic_information( char const * ) const = 0;
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual std::shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( std::shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0;
virtual bool release() const = 0;
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;

View File

@@ -15,7 +15,7 @@
#include <boost/exception/exception.hpp>
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
namespace
boost
@@ -32,7 +32,7 @@ boost
get( exception const & x )
{
if( exception_detail::error_info_container * c=x.data_.get() )
if( shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
if( std::shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
{
#ifndef BOOST_NO_RTTI
BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo *>(eib.get()) );

View File

@@ -15,7 +15,7 @@
#include <boost/exception/exception.hpp>
#include <boost/exception/to_string_stub.hpp>
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/config.hpp>
#include <map>
@@ -82,26 +82,26 @@ boost
}
void
set( shared_ptr<error_info_base> const & x, type_info_ const & typeid_ )
set( std::shared_ptr<error_info_base> const & x, type_info_ const & typeid_ )
{
BOOST_ASSERT(x);
info_[typeid_] = x;
diagnostic_info_str_.clear();
}
shared_ptr<error_info_base>
std::shared_ptr<error_info_base>
get( type_info_ const & ti ) const
{
error_info_map::const_iterator i=info_.find(ti);
if( info_.end()!=i )
{
shared_ptr<error_info_base> const & p = i->second;
std::shared_ptr<error_info_base> const & p = i->second;
#ifndef BOOST_NO_RTTI
BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
#endif
return p;
}
return shared_ptr<error_info_base>();
return std::shared_ptr<error_info_base>();
}
char const *
@@ -125,7 +125,7 @@ boost
friend class boost::exception;
typedef std::map< type_info_, shared_ptr<error_info_base> > error_info_map;
typedef std::map< type_info_, std::shared_ptr<error_info_base> > error_info_map;
error_info_map info_;
mutable std::string diagnostic_info_str_;
mutable int count_;
@@ -168,7 +168,7 @@ boost
set_info( E const & x, error_info<Tag,T> const & v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
std::shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);

View File

@@ -2,9 +2,9 @@
// Copyright Beman Dawes 2002-2009
// Copyright Jan Langer 2002
// Copyright Dietmar Kuehl 2001
// Copyright Dietmar Kuehl 2001
// Copyright Vladimir Prus 2002
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -28,7 +28,7 @@
#include <boost/detail/bitmask.hpp>
#include <boost/system/error_code.hpp>
#include <boost/system/system_error.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/iterator.hpp>
@@ -59,7 +59,7 @@ namespace boost
//--------------------------------------------------------------------------------------//
enum file_type
{
{
status_error,
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
status_unknown = status_error,
@@ -92,7 +92,7 @@ namespace boost
// Values are from POSIX and are given in octal per the POSIX standard.
// permission bits
owner_read = 0400, // S_IRUSR, Read permission, owner
owner_write = 0200, // S_IWUSR, Write permission, owner
owner_exe = 0100, // S_IXUSR, Execute/search permission, owner
@@ -115,8 +115,8 @@ namespace boost
set_uid_on_exe = 04000, // S_ISUID, Set-user-ID on execution
set_gid_on_exe = 02000, // S_ISGID, Set-group-ID on execution
sticky_bit = 01000, // S_ISVTX,
// (POSIX XSI) On directories, restricted deletion flag
// (V7) 'sticky bit': save swapped text even after use
// (POSIX XSI) On directories, restricted deletion flag
// (V7) 'sticky bit': save swapped text even after use
// (SunOS) On non-directories: don't cache this file
// (SVID-v4.2) On directories: restricted deletion flag
// Also see http://en.wikipedia.org/wiki/Sticky_bit
@@ -151,13 +151,13 @@ namespace boost
// observers
file_type type() const { return m_value; }
perms permissions() const { return m_perms; }
perms permissions() const { return m_perms; }
// modifiers
void type(file_type v) { m_value = v; }
void permissions(perms prms) { m_perms = prms; }
bool operator==(const file_status& rhs) const { return type() == rhs.type() &&
bool operator==(const file_status& rhs) const { return type() == rhs.type() &&
permissions() == rhs.permissions(); }
bool operator!=(const file_status& rhs) const { return !(*this == rhs); }
@@ -260,7 +260,7 @@ namespace boost
BOOST_FILESYSTEM_DECL
void resize_file(const path& p, uintmax_t size, system::error_code* ec=0);
BOOST_FILESYSTEM_DECL
space_info space(const path& p, system::error_code* ec=0);
space_info space(const path& p, system::error_code* ec=0);
BOOST_FILESYSTEM_DECL
path system_complete(const path& p, system::error_code* ec=0);
BOOST_FILESYSTEM_DECL
@@ -277,37 +277,37 @@ namespace boost
inline
file_status status(const path& p) {return detail::status(p);}
inline
inline
file_status status(const path& p, system::error_code& ec)
{return detail::status(p, &ec);}
inline
inline
file_status symlink_status(const path& p) {return detail::symlink_status(p);}
inline
file_status symlink_status(const path& p, system::error_code& ec)
{return detail::symlink_status(p, &ec);}
inline
inline
bool exists(const path& p) {return exists(detail::status(p));}
inline
inline
bool exists(const path& p, system::error_code& ec)
{return exists(detail::status(p, &ec));}
inline
inline
bool is_directory(const path& p) {return is_directory(detail::status(p));}
inline
inline
bool is_directory(const path& p, system::error_code& ec)
{return is_directory(detail::status(p, &ec));}
inline
inline
bool is_regular_file(const path& p) {return is_regular_file(detail::status(p));}
inline
inline
bool is_regular_file(const path& p, system::error_code& ec)
{return is_regular_file(detail::status(p, &ec));}
inline
inline
bool is_other(const path& p) {return is_other(detail::status(p));}
inline
inline
bool is_other(const path& p, system::error_code& ec)
{return is_other(detail::status(p, &ec));}
inline
bool is_symlink(const path& p) {return is_symlink(detail::symlink_status(p));}
inline
inline
bool is_symlink(const path& p, system::error_code& ec)
{return is_symlink(detail::symlink_status(p, &ec));}
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
@@ -330,7 +330,7 @@ namespace boost
// in alphabetical order, unless otherwise noted //
// //
//--------------------------------------------------------------------------------------//
// forward declarations
path current_path(); // fwd declaration
path initial_path();
@@ -367,7 +367,7 @@ namespace boost
void copy(const path& from, const path& to) {detail::copy(from, to);}
inline
void copy(const path& from, const path& to, system::error_code& ec)
void copy(const path& from, const path& to, system::error_code& ec)
{detail::copy(from, to, &ec);}
inline
void copy_directory(const path& from, const path& to)
@@ -500,7 +500,7 @@ namespace boost
inline
boost::uintmax_t remove_all(const path& p) {return detail::remove_all(p);}
inline
boost::uintmax_t remove_all(const path& p, system::error_code& ec)
{return detail::remove_all(p, &ec);}
@@ -517,10 +517,10 @@ namespace boost
void resize_file(const path& p, uintmax_t size, system::error_code& ec)
{detail::resize_file(p, size, &ec);}
inline
space_info space(const path& p) {return detail::space(p);}
space_info space(const path& p) {return detail::space(p);}
inline
space_info space(const path& p, system::error_code& ec) {return detail::space(p, &ec);}
space_info space(const path& p, system::error_code& ec) {return detail::space(p, &ec);}
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
inline bool symbolic_link_exists(const path& p)
@@ -537,7 +537,7 @@ namespace boost
path temp_directory_path() {return detail::temp_directory_path();}
inline
path temp_directory_path(system::error_code& ec)
path temp_directory_path(system::error_code& ec)
{return detail::temp_directory_path(&ec);}
inline
path unique_path(const path& p="%%%%-%%%%-%%%%-%%%%")
@@ -552,7 +552,7 @@ namespace boost
// //
//--------------------------------------------------------------------------------------//
// GCC has a problem with a member function named path within a namespace or
// GCC has a problem with a member function named path within a namespace or
// sub-namespace that also has a class named path. The workaround is to always
// fully qualify the name path when it refers to the class name.
@@ -593,12 +593,12 @@ public:
file_status symlink_status() const {return m_get_symlink_status();}
file_status symlink_status(system::error_code& ec) const {return m_get_symlink_status(&ec);}
bool operator==(const directory_entry& rhs) {return m_path == rhs.m_path;}
bool operator!=(const directory_entry& rhs) {return m_path != rhs.m_path;}
bool operator< (const directory_entry& rhs) {return m_path < rhs.m_path;}
bool operator<=(const directory_entry& rhs) {return m_path <= rhs.m_path;}
bool operator> (const directory_entry& rhs) {return m_path > rhs.m_path;}
bool operator>=(const directory_entry& rhs) {return m_path >= rhs.m_path;}
bool operator==(const directory_entry& rhs) {return m_path == rhs.m_path;}
bool operator!=(const directory_entry& rhs) {return m_path != rhs.m_path;}
bool operator< (const directory_entry& rhs) {return m_path < rhs.m_path;}
bool operator<=(const directory_entry& rhs) {return m_path <= rhs.m_path;}
bool operator> (const directory_entry& rhs) {return m_path > rhs.m_path;}
bool operator>=(const directory_entry& rhs) {return m_path >= rhs.m_path;}
private:
boost::filesystem::path m_path;
@@ -625,7 +625,7 @@ namespace detail
# if defined(BOOST_POSIX_API)
, void *& buffer
# endif
);
);
struct dir_itr_imp
{
@@ -688,7 +688,7 @@ namespace detail
~directory_iterator() {} // never throws
directory_iterator& increment(system::error_code& ec)
{
{
detail::directory_iterator_increment(*this, &ec);
return *this;
}
@@ -700,16 +700,16 @@ namespace detail
friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_increment(directory_iterator& it,
system::error_code* ec);
// shared_ptr provides shallow-copy semantics required for InputIterators.
// std::shared_ptr provides shallow-copy semantics required for InputIterators.
// m_imp.get()==0 indicates the end iterator.
boost::shared_ptr< detail::dir_itr_imp > m_imp;
boost::std::shared_ptr< detail::dir_itr_imp > m_imp;
friend class boost::iterator_core_access;
boost::iterator_facade<
directory_iterator,
directory_entry,
boost::single_pass_traversal_tag >::reference dereference() const
boost::single_pass_traversal_tag >::reference dereference() const
{
BOOST_ASSERT_MSG(m_imp.get(), "attempt to dereference end iterator");
return m_imp->dir_entry;
@@ -884,7 +884,7 @@ namespace detail
}
int level() const
{
{
BOOST_ASSERT_MSG(m_imp.get(),
"level() on end recursive_directory_iterator");
return m_imp->m_level;
@@ -903,7 +903,7 @@ namespace detail
# endif
void pop()
{
{
BOOST_ASSERT_MSG(m_imp.get(),
"pop() on end recursive_directory_iterator");
m_imp->pop();
@@ -936,17 +936,17 @@ namespace detail
private:
// shared_ptr provides shallow-copy semantics required for InputIterators.
// std::shared_ptr provides shallow-copy semantics required for InputIterators.
// m_imp.get()==0 indicates the end iterator.
boost::shared_ptr< detail::recur_dir_itr_imp > m_imp;
boost::std::shared_ptr< detail::recur_dir_itr_imp > m_imp;
friend class boost::iterator_core_access;
boost::iterator_facade<
boost::iterator_facade<
recursive_directory_iterator,
directory_entry,
boost::single_pass_traversal_tag >::reference
dereference() const
dereference() const
{
BOOST_ASSERT_MSG(m_imp.get(),
"dereference of end recursive_directory_iterator");
@@ -954,7 +954,7 @@ namespace detail
}
void increment()
{
{
BOOST_ASSERT_MSG(m_imp.get(),
"increment of end recursive_directory_iterator");
m_imp->increment(0);
@@ -976,7 +976,7 @@ namespace detail
// class filesystem_error //
// //
//--------------------------------------------------------------------------------------//
class BOOST_SYMBOL_VISIBLE filesystem_error : public system::system_error
{
// see http://www.boost.org/more/error_handling.html for design rationale
@@ -1009,7 +1009,7 @@ namespace detail
}
catch (...) { m_imp_ptr.reset(); }
}
filesystem_error(
const std::string & what_arg, const path& path1_arg,
const path& path2_arg, system::error_code ec)
@@ -1075,7 +1075,7 @@ namespace detail
path m_path2; // may be empty()
std::string m_what; // not built until needed
};
boost::shared_ptr<m_imp> m_imp_ptr;
boost::std::shared_ptr<m_imp> m_imp_ptr;
};
// test helper -----------------------------------------------------------------------//

View File

@@ -26,7 +26,7 @@
#include <boost/system/error_code.hpp>
#include <boost/system/system_error.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/io/detail/quoted_manip.hpp>
#include <boost/static_assert.hpp>
#include <boost/functional/hash_fwd.hpp>
@@ -62,11 +62,11 @@ namespace filesystem
# ifdef BOOST_WINDOWS_API
typedef wchar_t value_type;
BOOST_STATIC_CONSTEXPR value_type preferred_separator = L'\\';
# else
# else
typedef char value_type;
BOOST_STATIC_CONSTEXPR value_type preferred_separator = '/';
# endif
typedef std::basic_string<value_type> string_type;
typedef std::basic_string<value_type> string_type;
typedef std::codecvt<wchar_t, char,
std::mbstate_t> codecvt_type;
@@ -89,7 +89,7 @@ namespace filesystem
//
// The path locale, which is global to the thread, can be changed by the
// imbue() function. It is initialized to an implementation defined locale.
//
//
// For Windows, wchar_t strings do not undergo conversion. char strings
// are converted using the "ANSI" or "OEM" code pages, as determined by
// the AreFileApisANSI() function, or, if a conversion argument is given,
@@ -98,7 +98,7 @@ namespace filesystem
// See m_pathname comments for further important rationale.
// TODO: rules needed for operating systems that use / or .
// differently, or format directory paths differently from file paths.
// differently, or format directory paths differently from file paths.
//
// **********************************************************************************
//
@@ -127,7 +127,7 @@ namespace filesystem
// ----- constructors -----
path(){}
path(){}
path(const path& p) : m_pathname(p.m_pathname) {}
@@ -159,7 +159,7 @@ namespace filesystem
template <class InputIterator>
path(InputIterator begin, InputIterator end)
{
{
if (begin != end)
{
std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
@@ -170,7 +170,7 @@ namespace filesystem
template <class InputIterator>
path(InputIterator begin, InputIterator end, const codecvt_type& cvt)
{
{
if (begin != end)
{
std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
@@ -225,7 +225,7 @@ namespace filesystem
template <class InputIterator>
path& assign(InputIterator begin, InputIterator end, const codecvt_type& cvt)
{
{
m_pathname.clear();
if (begin != end)
{
@@ -270,13 +270,13 @@ namespace filesystem
template <class InputIterator>
path& concat(InputIterator begin, InputIterator end)
{
{
return concat(begin, end, codecvt());
}
template <class InputIterator>
path& concat(InputIterator begin, InputIterator end, const codecvt_type& cvt)
{
{
if (begin == end)
return *this;
std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
@@ -313,7 +313,7 @@ namespace filesystem
template <class InputIterator>
path& append(InputIterator begin, InputIterator end)
{
{
return append(begin, end, codecvt());
}
@@ -334,7 +334,7 @@ namespace filesystem
void swap(path& rhs) { m_pathname.swap(rhs.m_pathname); }
// ----- observers -----
// For operating systems that format file paths differently than directory
// paths, return values from observers are formatted as file names unless there
// is a trailing separator, in which case returns are formatted as directory
@@ -364,16 +364,16 @@ namespace filesystem
String string(const codecvt_type& cvt) const;
# ifdef BOOST_WINDOWS_API
const std::string string() const { return string(codecvt()); }
const std::string string() const { return string(codecvt()); }
const std::string string(const codecvt_type& cvt) const
{
{
std::string tmp;
if (!m_pathname.empty())
path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
tmp, cvt);
return tmp;
}
// string_type is std::wstring, so there is no conversion
const std::wstring& wstring() const { return m_pathname; }
const std::wstring& wstring(const codecvt_type&) const { return m_pathname; }
@@ -385,7 +385,7 @@ namespace filesystem
const std::wstring wstring() const { return wstring(codecvt()); }
const std::wstring wstring(const codecvt_type& cvt) const
{
{
std::wstring tmp;
if (!m_pathname.empty())
path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
@@ -404,8 +404,8 @@ namespace filesystem
String generic_string(const codecvt_type& cvt) const;
# ifdef BOOST_WINDOWS_API
const std::string generic_string() const { return generic_string(codecvt()); }
const std::string generic_string(const codecvt_type& cvt) const;
const std::string generic_string() const { return generic_string(codecvt()); }
const std::string generic_string(const codecvt_type& cvt) const;
const std::wstring generic_wstring() const;
const std::wstring generic_wstring(const codecvt_type&) const { return generic_wstring(); };
@@ -426,7 +426,7 @@ namespace filesystem
// ----- decomposition -----
path root_path() const;
path root_path() const;
path root_name() const; // returns 0 or 1 element path
// even on POSIX, root_name() is non-empty() for network paths
path root_directory() const; // returns 0 or 1 element path
@@ -455,7 +455,7 @@ namespace filesystem
return has_root_directory();
# endif
}
bool is_relative() const { return !is_absolute(); }
bool is_relative() const { return !is_absolute(); }
// ----- iterators -----
@@ -489,7 +489,7 @@ namespace filesystem
# if defined(BOOST_FILESYSTEM_DEPRECATED)
// deprecated functions with enough signature or semantic changes that they are
// not supplied by default
// not supplied by default
const std::string file_string() const { return string(); }
const std::string directory_string() const { return string(); }
const std::string native_file_string() const { return string(); }
@@ -502,7 +502,7 @@ namespace filesystem
//basic_path(const string_type& str, name_check) { operator/=(str); }
//basic_path(const typename string_type::value_type* s, name_check)
// { operator/=(s);}
//static bool default_name_check_writable() { return false; }
//static bool default_name_check_writable() { return false; }
//static void default_name_check(name_check) {}
//static name_check default_name_check() { return 0; }
//basic_path& canonize();
@@ -529,7 +529,7 @@ namespace filesystem
// slashes NOT converted to backslashes
# if defined(_MSC_VER)
# pragma warning(pop) // restore warning settings.
# endif
# endif
string_type::size_type m_append_separator_if_needed();
// Returns: If separator is to be appended, m_pathname.size() before append. Otherwise 0.
@@ -541,7 +541,7 @@ namespace filesystem
path& m_normalize();
// Was qualified; como433beta8 reports:
// warning #427-D: qualified name is not allowed in member declaration
// warning #427-D: qualified name is not allowed in member declaration
friend class iterator;
friend bool operator<(const path& lhs, const path& rhs);
@@ -565,7 +565,7 @@ namespace filesystem
//------------------------------------------------------------------------------------//
// class path::iterator //
//------------------------------------------------------------------------------------//
class path::iterator
: public boost::iterator_facade<
path::iterator,
@@ -596,7 +596,7 @@ namespace filesystem
// m_path_ptr->m_pathname.
// if m_element is implicit dot, m_pos is the
// position of the last separator in the path.
// end() iterator is indicated by
// end() iterator is indicated by
// m_pos == m_path_ptr->m_pathname.size()
}; // path::iterator
@@ -611,15 +611,15 @@ namespace filesystem
inline bool lexicographical_compare(path::iterator first1, path::iterator last1,
path::iterator first2, path::iterator last2)
{ return detail::lex_compare(first1, last1, first2, last2) < 0; }
inline bool operator==(const path& lhs, const path& rhs) {return lhs.compare(rhs) == 0;}
inline bool operator==(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) == 0;}
inline bool operator==(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) == 0;}
inline bool operator==(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) == 0;}
inline bool operator==(const path& lhs, const path::value_type* rhs) {return lhs.compare(rhs) == 0;}
inline bool operator==(const path::value_type* lhs, const path& rhs) {return rhs.compare(lhs) == 0;}
inline bool operator!=(const path& lhs, const path& rhs) {return lhs.compare(rhs) != 0;}
inline bool operator!=(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) != 0;}
inline bool operator!=(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) != 0;}
inline bool operator!=(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) != 0;}
inline bool operator!=(const path& lhs, const path::value_type* rhs) {return lhs.compare(rhs) != 0;}
inline bool operator!=(const path::value_type* lhs, const path& rhs) {return rhs.compare(lhs) != 0;}
@@ -658,7 +658,7 @@ namespace filesystem
return os
<< boost::io::quoted(p.template string<std::basic_string<Char> >(), static_cast<Char>('&'));
}
template <class Char, class Traits>
inline std::basic_istream<Char, Traits>&
operator>>(std::basic_istream<Char, Traits>& is, path& p)
@@ -668,7 +668,7 @@ namespace filesystem
p = str;
return is;
}
// name_checks
// These functions are holdovers from version 1. It isn't clear they have much
@@ -680,14 +680,14 @@ namespace filesystem
BOOST_FILESYSTEM_DECL bool portable_directory_name(const std::string & name);
BOOST_FILESYSTEM_DECL bool portable_file_name(const std::string & name);
BOOST_FILESYSTEM_DECL bool native(const std::string & name);
//--------------------------------------------------------------------------------------//
// class path member template implementation //
//--------------------------------------------------------------------------------------//
template <class InputIterator>
path& path::append(InputIterator begin, InputIterator end, const codecvt_type& cvt)
{
{
if (begin == end)
return *this;
string_type::size_type sep_pos(m_append_separator_if_needed());

View File

@@ -1,5 +1,5 @@
// ----------------------------------------------------------------------------
// alt_sstream.hpp : alternative stringstream
// alt_sstream.hpp : alternative stringstream
// ----------------------------------------------------------------------------
// Copyright Samuel Krempp 2003. Use, modification, and distribution are
@@ -18,23 +18,23 @@
#include <string>
#include <boost/format/detail/compat_workarounds.hpp>
#include <boost/utility/base_from_member.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/assert.hpp>
namespace boost {
namespace io {
template<class Ch, class Tr=::std::char_traits<Ch>,
template<class Ch, class Tr=::std::char_traits<Ch>,
class Alloc=::std::allocator<Ch> >
class basic_altstringbuf;
template<class Ch, class Tr =::std::char_traits<Ch>,
template<class Ch, class Tr =::std::char_traits<Ch>,
class Alloc=::std::allocator<Ch> >
class basic_oaltstringstream;
template<class Ch, class Tr, class Alloc>
class basic_altstringbuf
class basic_altstringbuf
: public ::std::basic_streambuf<Ch, Tr>
{
typedef ::std::basic_streambuf<Ch, Tr> streambuf_t;
@@ -55,14 +55,14 @@ namespace boost {
explicit basic_altstringbuf(std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
: putend_(NULL), is_allocated_(false), mode_(mode)
: putend_(NULL), is_allocated_(false), mode_(mode)
{}
explicit basic_altstringbuf(const string_type& s,
::std::ios_base::openmode mode
= ::std::ios_base::in | ::std::ios_base::out)
: putend_(NULL), is_allocated_(false), mode_(mode)
: putend_(NULL), is_allocated_(false), mode_(mode)
{ dealloc(); str(s); }
virtual ~basic_altstringbuf()
virtual ~basic_altstringbuf()
{ dealloc(); }
using streambuf_t::pbase;
using streambuf_t::pptr;
@@ -70,36 +70,36 @@ namespace boost {
using streambuf_t::eback;
using streambuf_t::gptr;
using streambuf_t::egptr;
void clear_buffer();
void str(const string_type& s);
// 0-copy access :
Ch * begin() const;
Ch * begin() const;
size_type size() const;
size_type cur_size() const; // stop at current pointer
Ch * pend() const // the highest position reached by pptr() since creation
{ return ((putend_ < pptr()) ? pptr() : putend_); }
size_type pcount() const
size_type pcount() const
{ return static_cast<size_type>( pptr() - pbase()) ;}
// copy buffer to string :
string_type str() const
string_type str() const
{ return string_type(begin(), size()); }
string_type cur_str() const
string_type cur_str() const
{ return string_type(begin(), cur_size()); }
protected:
explicit basic_altstringbuf (basic_altstringbuf * s,
::std::ios_base::openmode mode
::std::ios_base::openmode mode
= ::std::ios_base::in | ::std::ios_base::out)
: putend_(NULL), is_allocated_(false), mode_(mode)
: putend_(NULL), is_allocated_(false), mode_(mode)
{ dealloc(); str(s); }
virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way,
::std::ios_base::openmode which
virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way,
::std::ios_base::openmode which
= ::std::ios_base::in | ::std::ios_base::out);
virtual pos_type seekpos (pos_type pos,
::std::ios_base::openmode which
virtual pos_type seekpos (pos_type pos,
::std::ios_base::openmode which
= ::std::ios_base::in | ::std::ios_base::out);
virtual int_type underflow();
virtual int_type pbackfail(int_type meta = compat_traits_type::eof());
@@ -117,53 +117,53 @@ namespace boost {
// --- class basic_oaltstringstream ----------------------------------------
template <class Ch, class Tr, class Alloc>
class basic_oaltstringstream
: private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >,
class basic_oaltstringstream
: private base_from_member< std::shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >,
public ::std::basic_ostream<Ch, Tr>
{
class No_Op {
class No_Op {
// used as no-op deleter for (not-owner) shared_pointers
public:
public:
template<class T>
const T & operator()(const T & arg) { return arg; }
};
typedef ::std::basic_ostream<Ch, Tr> stream_t;
typedef boost::base_from_member<boost::shared_ptr<
basic_altstringbuf<Ch,Tr, Alloc> > >
typedef boost::base_from_member<boost::std::shared_ptr<
basic_altstringbuf<Ch,Tr, Alloc> > >
pbase_type;
typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
typedef typename string_type::size_type size_type;
typedef basic_altstringbuf<Ch, Tr, Alloc> stringbuf_t;
public:
typedef Alloc allocator_type;
basic_oaltstringstream()
: pbase_type(new stringbuf_t), stream_t(rdbuf())
basic_oaltstringstream()
: pbase_type(new stringbuf_t), stream_t(rdbuf())
{ }
basic_oaltstringstream(::boost::shared_ptr<stringbuf_t> buf)
: pbase_type(buf), stream_t(rdbuf())
basic_oaltstringstream(::boost::std::shared_ptr<stringbuf_t> buf)
: pbase_type(buf), stream_t(rdbuf())
{ }
basic_oaltstringstream(stringbuf_t * buf)
: pbase_type(buf, No_Op() ), stream_t(rdbuf())
basic_oaltstringstream(stringbuf_t * buf)
: pbase_type(buf, No_Op() ), stream_t(rdbuf())
{ }
stringbuf_t * rdbuf() const
stringbuf_t * rdbuf() const
{ return pbase_type::member.get(); }
void clear_buffer()
void clear_buffer()
{ rdbuf()->clear_buffer(); }
// 0-copy access :
Ch * begin() const
Ch * begin() const
{ return rdbuf()->begin(); }
size_type size() const
size_type size() const
{ return rdbuf()->size(); }
size_type cur_size() const // stops at current position
{ return rdbuf()->cur_size(); }
// copy buffer to string :
string_type str() const // [pbase, epptr[
{ return rdbuf()->str(); }
{ return rdbuf()->str(); }
string_type cur_str() const // [pbase, pptr[
{ return rdbuf()->cur_str(); }
void str(const string_type& s)
void str(const string_type& s)
{ rdbuf()->str(s); }
};

View File

@@ -5,7 +5,7 @@
// Based on Peter Dimov's proposal
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
// issue 6.18.
// issue 6.18.
// This implements the extensions to the standard.
// It's undocumented, so you shouldn't use it....
@@ -358,12 +358,12 @@ namespace boost
}
};
};
template <class T>
struct hash_impl_msvc2
: public hash_impl_msvc<boost::is_const<T>::value>
::BOOST_NESTED_TEMPLATE inner<T> {};
template <>
struct hash_impl<false>
{

View File

@@ -9,11 +9,11 @@
// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
// pull in the TR1 headers: that's why we use this header
// pull in the TR1 headers: that's why we use this header
// rather than including <memory> directly:
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
namespace boost {
namespace boost {
// get_pointer(p) extracts a ->* capable pointer from p
@@ -22,7 +22,7 @@ template<class T> T * get_pointer(T * p)
return p;
}
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
// get_pointer(std::shared_ptr<T> const & p) has been moved to std::shared_ptr.hpp
template<class T> T * get_pointer(std::auto_ptr<T> const& p)
{

View File

@@ -1,6 +1,6 @@
/*
Copyright 2005-2007 Adobe Systems Incorporated
Use, modification and distribution are subject to 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).
@@ -20,7 +20,7 @@
#include <ios>
#include "../../gil_config.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
namespace boost { namespace gil {
@@ -30,7 +30,7 @@ inline void io_error_if(bool expr, const char* descr="") { if (expr) io_error(de
namespace detail {
class file_mgr {
protected:
shared_ptr<FILE> _fp;
std::shared_ptr<FILE> _fp;
struct null_deleter { void operator()(void const*) const {} };
file_mgr(FILE* file) : _fp(file, null_deleter()) {}
@@ -38,7 +38,7 @@ namespace detail {
file_mgr(const char* filename, const char* flags) {
FILE* fp;
io_error_if((fp=fopen(filename,flags))==NULL, "file_mgr: failed to open file");
_fp=shared_ptr<FILE>(fp,fclose);
_fp=std::shared_ptr<FILE>(fp,fclose);
}
public:

View File

@@ -1,6 +1,6 @@
/*
Copyright 2005-2007 Adobe Systems Incorporated
Use, modification and distribution are subject to 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).
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <string>
#include <boost/mpl/bool.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include "../dynamic_image/dynamic_image_all.hpp"
#include "io_error.hpp"
@@ -43,7 +43,7 @@ struct jpeg_write_is_supported {
class jpeg_writer_dynamic : public jpeg_writer {
int _quality;
public:
public:
jpeg_writer_dynamic(FILE* file, int quality=100) : jpeg_writer(file) , _quality(quality) {}
jpeg_writer_dynamic(const char* filename, int quality=100) : jpeg_writer(filename), _quality(quality) {}
@@ -74,7 +74,7 @@ class jpeg_reader_dynamic : public jpeg_reader {
public:
jpeg_reader_dynamic(FILE* file) : jpeg_reader(file) {}
jpeg_reader_dynamic(const char* filename) : jpeg_reader(filename){}
template <typename Images>
void read_image(any_image<Images>& im) {
if (!construct_matched(im,detail::jpeg_type_format_checker(_cinfo.out_color_space))) {
@@ -110,7 +110,7 @@ inline void jpeg_read_image(const std::string& filename,any_image<Images>& im) {
/// \ingroup JPEG_IO
/// \brief Saves the currently instantiated view to a jpeg file specified by the given jpeg image file name.
/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension
/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension
/// or if it fails to create the file.
template <typename Views>
inline void jpeg_write_view(const char* filename,const any_image_view<Views>& runtime_view) {

View File

@@ -1,6 +1,6 @@
/*
Copyright 2005-2007 Adobe Systems Incorporated
Use, modification and distribution are subject to 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).
@@ -24,7 +24,7 @@
#include <algorithm>
#include <string>
#include <boost/static_assert.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
extern "C" {
#include <jpeglib.h>
}
@@ -64,7 +64,7 @@ inline point2<std::ptrdiff_t> jpeg_read_dimensions(const std::string& filename)
/// \ingroup JPEG_IO
/// \brief Loads the image specified by the given jpeg image file name into the given view.
/// Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension.
/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not
/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not
/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view.
template <typename View>
inline void jpeg_read_view(const char* filename,const View& view) {
@@ -84,7 +84,7 @@ inline void jpeg_read_view(const std::string& filename,const View& view) {
/// \ingroup JPEG_IO
/// \brief Allocates a new image whose dimensions are determined by the given jpeg image file, and loads the pixels into it.
/// Triggers a compile assert if the image color space or channel depth are not supported by the JPEG library or by the I/O extension.
/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not
/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not
/// compatible with the ones specified by Image
template <typename Image>
inline void jpeg_read_image(const char* filename,Image& im) {

View File

@@ -1,6 +1,6 @@
/*
Copyright 2005-2007 Adobe Systems Incorporated
Use, modification and distribution are subject to 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).
@@ -31,7 +31,7 @@
#include <string>
#include <stdio.h>
#include <boost/mpl/bool.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include "../dynamic_image/dynamic_image_all.hpp"
#include "io_error.hpp"
#include "png_io.hpp"
@@ -81,7 +81,7 @@ class png_reader_dynamic : public png_reader {
public:
png_reader_dynamic(FILE* file) : png_reader(file) {}
png_reader_dynamic(const char* filename) : png_reader(filename){}
template <typename Images>
void read_image(any_image<Images>& im) {
png_uint_32 width, height;
@@ -99,7 +99,7 @@ public:
}
};
} // namespace detail
} // namespace detail
/// \ingroup PNG_IO
/// \brief reads a PNG image into a run-time instantiated image
@@ -121,7 +121,7 @@ inline void png_read_image(const std::string& filename,any_image<Images>& im) {
/// \ingroup PNG_IO
/// \brief Saves the currently instantiated view to a png file specified by the given png image file name.
/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension
/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension
/// or if it fails to create the file.
template <typename Views>
inline void png_write_view(const char* filename,const any_image_view<Views>& runtime_view) {

View File

@@ -10,19 +10,19 @@
#define BOOST_SELF_AVOIDING_WALK_HPP
/*
This file defines necessary components for SAW.
This file defines necessary components for SAW.
mesh language: (defined by myself to clearify what is what)
A triangle in mesh is called an triangle.
An edge in mesh is called an line.
An edge in mesh is called an line.
A vertex in mesh is called a point.
A triangular mesh corresponds to a graph in which a vertex is a
triangle and an edge(u, v) stands for triangle u and triangle v
triangle and an edge(u, v) stands for triangle u and triangle v
share an line.
After this point, a vertex always refers to vertex in graph,
therefore it is a traingle in mesh.
therefore it is a traingle in mesh.
*/
@@ -43,7 +43,7 @@ namespace boost {
triple(const T1& a, const T2& b, const T3& c) : first(a), second(b), third(c) {}
triple() : first(SAW_SENTINAL), second(SAW_SENTINAL), third(SAW_SENTINAL) {}
};
typedef triple<int, int, int> Triple;
/* Define a vertex property which has a triangle inside. Triangle is
@@ -70,14 +70,14 @@ namespace boost {
if ( a.second == b.second || a.second == b.third )
l.second = a.second;
else if ( a.third == b.second || a.third == b.third )
l.second = a.third;
l.second = a.third;
} else if ( a.first == b.second ) {
l.first = a.first;
if ( a.second == b.third )
l.second = a.second;
else if ( a.third == b.third )
l.second = a.third;
l.second = a.third;
} else if ( a.first == b.third ) {
l.first = a.first;
@@ -90,17 +90,17 @@ namespace boost {
} else if ( a.second == b.second ) {
l.first = a.second;
if ( a.third == b.third )
if ( a.third == b.third )
l.second = a.third;
} else if ( a.second == b.third ) {
l.first = a.second;
} else if ( a.third == b.first
|| a.third == b.second
} else if ( a.third == b.first
|| a.third == b.second
|| a.third == b.third )
l.first = a.third;
l.first = a.third;
/*Make it in order*/
if ( l.first > l.second ) {
@@ -132,7 +132,7 @@ namespace boost {
}
TriangleDecorator td;
};
/* HList has to be a handle of data holder so that pass-by-value is
* in right logic.
*
@@ -146,7 +146,7 @@ namespace boost {
: public bfs_visitor<>, public dfs_visitor<>
{
typedef typename boost::property_traits<IteratorD>::value_type iter;
/*use boost shared_ptr*/
/*use boost std::shared_ptr*/
typedef typename HList::element_type::value_type::second_type Line;
public:
@@ -176,12 +176,12 @@ namespace boost {
using std::make_pair;
typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
Vertex tau = target(e, G);
Vertex i = source(e, G);
Vertex i = source(e, G);
get_vertex_sharing<TriangleDecorator, Vertex, Line> get_sharing_line(td);
Line tau_i = get_sharing_line(tau, i);
iter w_end = hlist->end();
iter w_i = iter_d[i];
@@ -197,7 +197,7 @@ namespace boost {
*b w(i) |- w(i+1) w(i) ~> w(i+1) or no w(i+1) yet
*----------------------------------------------------------
*/
bool a = false, b = false;
--w_i_m_1;
@@ -206,13 +206,13 @@ namespace boost {
if ( w_i_m_1 != w_end ) {
a = ( w_i_m_1->second.first != SAW_SENTINAL );
}
}
if ( a ) {
if ( b ) {
/*Case 1:
/*Case 1:
w(i-1) |- w(i) |- w(i+1)
*/
Line l1 = get_sharing_line(*w_i_m_1, tau);
@@ -221,7 +221,7 @@ namespace boost {
--w_i_m_2;
bool c = true;
if ( w_i_m_2 != w_end ) {
c = w_i_m_2->second != l1;
}
@@ -230,11 +230,11 @@ namespace boost {
/*extension: w(i-1) -> tau |- w(i) */
w_i_m_1->second = l1;
/*insert(pos, const T&) is to insert before pos*/
iter_d[tau] = hlist->insert(w_i, make_pair(tau, tau_i));
iter_d[tau] = hlist->insert(w_i, make_pair(tau, tau_i));
} else { /* w(i-1) ^ tau == w(i-2) ^ w(i-1) */
/*must be w(i-2) ~> w(i-1) */
bool d = true;
//need to handle the case when w_i_p_1 is null
Line l3 = get_sharing_line(*w_i_p_1, tau);
@@ -261,15 +261,15 @@ namespace boost {
;
}
}
}
} else {
} else {
/*Case 2:
w(i-1) |- w(i) ~> w(1+1)
*/
if ( w_i->second.second == tau_i.first
if ( w_i->second.second == tau_i.first
|| w_i->second.second == tau_i.second ) { /*w(i) ^ w(i+1) < w(i) ^ tau*/
/*extension: w(i) |- tau -> w(i+1) */
w_i->second = tau_i;
@@ -296,23 +296,23 @@ namespace boost {
iter_d[w_i_m_1->first] = hlist->insert(w_i_p_1, *w_i_m_1);
hlist->erase(w_i_m_1);
}
}
}
}
} else {
if ( b ) {
/*Case 3:
w(i-1) ~> w(i) |- w(i+1)
*/
bool c = false;
if ( w_i_m_1 != w_end )
c = ( w_i_m_1->second.second == tau_i.first)
|| ( w_i_m_1->second.second == tau_i.second);
if ( c ) { /*w(i-1) ^ w(i) < w(i) ^ tau*/
/* extension: w(i-1) -> tau |- w(i) */
if ( w_i_m_1 != w_end )
@@ -336,7 +336,7 @@ namespace boost {
/*extension: w(i-1) -> w(i+1) |- w(i) |- tau -> w(i+2) */
iter w_i_p_2 = w_i_p_1;
++w_i_p_2;
w_i_p_1->second = w_i->second;
iter_d[i] = hlist->insert(w_i_p_2, make_pair(i, tau_i));
hlist->erase(w_i);
@@ -344,16 +344,16 @@ namespace boost {
iter_d[tau] = hlist->insert(w_i_p_2, make_pair(tau, l2));
}
}
} else {
/*Case 4:
w(i-1) ~> w(i) ~> w(i+1)
*/
bool c = false;
if ( w_i_m_1 != w_end ) {
c = (w_i_m_1->second.second == tau_i.first)
c = (w_i_m_1->second.second == tau_i.first)
|| (w_i_m_1->second.second == tau_i.second);
}
if ( c ) { /*w(i-1) ^ w(i) < w(i) ^ tau */
@@ -361,48 +361,48 @@ namespace boost {
if ( w_i_m_1 != w_end )
w_i_m_1->second = get_sharing_line(*w_i_m_1, tau);
iter_d[tau] = hlist->insert(w_i, make_pair(tau, tau_i));
} else {
} else {
/*extension: w(i) |- tau -> w(i+1) */
w_i->second = tau_i;
Line l1;
l1.first = SAW_SENTINAL;
l1.second = SAW_SENTINAL;
if ( w_i_p_1 != w_end )
if ( w_i_p_1 != w_end )
l1 = get_sharing_line(*w_i_p_1, tau);
iter_d[tau] = hlist->insert(w_i_p_1, make_pair(tau, l1));
}
}
}
return true;
}
protected:
TriangleDecorator td; /*a decorator for vertex*/
HList hlist;
/*This must be a handle of list to record the SAW
The element type of the list is pair<Vertex, Line>
*/
IteratorD iter_d;
IteratorD iter_d;
/*Problem statement: Need a fast access to w for triangle i.
*Possible solution: mantain an array to record.
iter_d[i] will return an iterator
*Possible solution: mantain an array to record.
iter_d[i] will return an iterator
which points to w(i), where i is a vertex
representing triangle i.
*/
};
template <class Triangle, class HList, class Iterator>
inline
inline
SAW_visitor<Triangle, HList, Iterator>
visit_SAW(Triangle t, HList hl, Iterator i) {
return SAW_visitor<Triangle, HList, Iterator>(t, hl, i);
}
template <class Tri, class HList, class Iter>
inline
inline
SAW_visitor< random_access_iterator_property_map<Tri*,Tri,Tri&>,
HList, random_access_iterator_property_map<Iter*,Iter,Iter&> >
visit_SAW_ptr(Tri* t, HList hl, Iter* i) {
@@ -412,7 +412,7 @@ namespace boost {
}
// should also have combo's of pointers, and also const :(
}
#endif /*BOOST_SAW_H*/

View File

@@ -40,7 +40,7 @@ namespace boost { namespace graph { namespace distributed {
struct mpi_process_group::impl
{
typedef mpi_process_group::message_header message_header;
typedef mpi_process_group::outgoing_messages outgoing_messages;
@@ -71,7 +71,7 @@ struct mpi_process_group::impl
std::size_t batch_header_number;
std::size_t batch_buffer_size;
std::size_t batch_message_size;
/**
* The actual MPI communicator used to transmit data.
*/
@@ -90,19 +90,19 @@ struct mpi_process_group::impl
/// The numbers of processors that have entered a synchronization stage
std::vector<int> processors_synchronizing_stage;
/// The synchronization stage of a processor
std::vector<int> synchronizing_stage;
/// Number of processors still sending messages
std::vector<int> synchronizing_unfinished;
/// Number of batches sent since last synchronization stage
std::vector<int> number_sent_batches;
/// Number of batches received minus number of expected batches
std::vector<int> number_received_batches;
/// The context of the currently-executing trigger, or @c trc_none
/// if no trigger is executing.
@@ -124,7 +124,7 @@ struct mpi_process_group::impl
/// The MPI requests for posted sends of oob messages
std::vector<MPI_Request> requests;
/// The MPI buffers for posted irecvs of oob messages
std::map<int,buffer_type> buffers;
@@ -144,14 +144,14 @@ struct mpi_process_group::impl
std::stack<std::size_t> free_batches;
void free_sent_batches();
// Tag allocator
detail::tag_allocator allocated_tags;
impl(std::size_t num_headers, std::size_t buffers_size,
communicator_type parent_comm);
~impl();
private:
void set_batch_size(std::size_t header_num, std::size_t buffer_sz);
};
@@ -175,7 +175,7 @@ mpi_process_group::send_impl(int dest, int tag, const T& value,
header.source = process_id(*this);
header.tag = tag;
header.offset = outgoing.buffer.size();
boost::mpi::packed_oarchive oa(impl_->comm, outgoing.buffer);
oa << value;
@@ -237,7 +237,7 @@ send(const mpi_process_group& pg, mpi_process_group::process_id_type dest,
int tag, const T values[], std::size_t n)
{
pg.send_impl(dest, pg.encode_tag(pg.my_block_number(), tag),
boost::serialization::make_array(values,n),
boost::serialization::make_array(values,n),
boost::mpl::true_());
}
@@ -279,7 +279,7 @@ typename disable_if<boost::mpi::is_mpi_datatype<T>, void>::type
send(const mpi_process_group& pg, mpi_process_group::process_id_type dest,
int tag, const T values[], std::size_t n)
{
pg.array_send_impl(dest, pg.encode_tag(pg.my_block_number(), tag),
pg.array_send_impl(dest, pg.encode_tag(pg.my_block_number(), tag),
values, n);
}
@@ -316,7 +316,7 @@ mpi_process_group::receive_impl(int source, int tag, T& value,
// Unpack the data
if (header->bytes > 0) {
boost::mpi::packed_iarchive ia(impl_->comm, incoming.buffer,
boost::mpi::packed_iarchive ia(impl_->comm, incoming.buffer,
archive::no_header, header->offset);
ia >> value;
}
@@ -364,7 +364,7 @@ mpi_process_group::receive_impl(int source, int tag, T& value,
if (header == incoming.headers.end()) return false;
// Deserialize the data
boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer,
boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer,
archive::no_header, header->offset);
in >> value;
@@ -411,7 +411,7 @@ array_receive_impl(int source, int tag, T* values, std::size_t& n) const
if (header == incoming.headers.end()) return false;
// Deserialize the data
boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer,
boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer,
archive::no_header, header->offset);
std::size_t num_sent;
in >> num_sent;
@@ -455,7 +455,7 @@ template<typename Type, typename Handler>
void mpi_process_group::trigger(int tag, const Handler& handler)
{
BOOST_ASSERT(block_num);
install_trigger(tag,my_block_number(),shared_ptr<trigger_base>(
install_trigger(tag,my_block_number(),std::shared_ptr<trigger_base>(
new trigger_launcher<Type, Handler>(*this, tag, handler)));
}
@@ -463,28 +463,28 @@ template<typename Type, typename Handler>
void mpi_process_group::trigger_with_reply(int tag, const Handler& handler)
{
BOOST_ASSERT(block_num);
install_trigger(tag,my_block_number(),shared_ptr<trigger_base>(
install_trigger(tag,my_block_number(),std::shared_ptr<trigger_base>(
new reply_trigger_launcher<Type, Handler>(*this, tag, handler)));
}
template<typename Type, typename Handler>
void mpi_process_group::global_trigger(int tag, const Handler& handler,
void mpi_process_group::global_trigger(int tag, const Handler& handler,
std::size_t sz)
{
if (sz==0) // normal trigger
install_trigger(tag,0,shared_ptr<trigger_base>(
install_trigger(tag,0,std::shared_ptr<trigger_base>(
new global_trigger_launcher<Type, Handler>(*this, tag, handler)));
else // trigger with irecv
install_trigger(tag,0,shared_ptr<trigger_base>(
install_trigger(tag,0,std::shared_ptr<trigger_base>(
new global_irecv_trigger_launcher<Type, Handler>(*this, tag, handler,sz)));
}
namespace detail {
template<typename Type>
void do_oob_receive(mpi_process_group const& self,
int source, int tag, Type& data, mpl::true_ /*is_mpi_datatype*/)
int source, int tag, Type& data, mpl::true_ /*is_mpi_datatype*/)
{
using boost::mpi::get_mpi_datatype;
@@ -495,7 +495,7 @@ void do_oob_receive(mpi_process_group const& self,
template<typename Type>
void do_oob_receive(mpi_process_group const& self,
int source, int tag, Type& data, mpl::false_ /*is_mpi_datatype*/)
int source, int tag, Type& data, mpl::false_ /*is_mpi_datatype*/)
{
// self.impl_->comm.recv(source,tag,data);
// Receive the size of the data packet
@@ -521,7 +521,7 @@ void do_oob_receive(mpi_process_group const& self,
}
template<typename Type>
void do_oob_receive(mpi_process_group const& self, int source, int tag, Type& data)
void do_oob_receive(mpi_process_group const& self, int source, int tag, Type& data)
{
do_oob_receive(self, source, tag, data,
boost::mpi::is_mpi_datatype<Type>());
@@ -532,13 +532,13 @@ void do_oob_receive(mpi_process_group const& self, int source, int tag, Type& da
template<typename Type, typename Handler>
void
void
mpi_process_group::trigger_launcher<Type, Handler>::
receive(mpi_process_group const&, int source, int tag,
receive(mpi_process_group const&, int source, int tag,
trigger_receive_context context, int block) const
{
#ifdef PBGL_PROCESS_GROUP_DEBUG
std::cerr << (out_of_band? "OOB trigger" : "Trigger")
std::cerr << (out_of_band? "OOB trigger" : "Trigger")
<< " receive from source " << source << " and tag " << tag
<< " in block " << (block == -1 ? self.my_block_number() : block) << std::endl;
#endif
@@ -560,13 +560,13 @@ receive(mpi_process_group const&, int source, int tag,
}
template<typename Type, typename Handler>
void
void
mpi_process_group::reply_trigger_launcher<Type, Handler>::
receive(mpi_process_group const&, int source, int tag,
receive(mpi_process_group const&, int source, int tag,
trigger_receive_context context, int block) const
{
#ifdef PBGL_PROCESS_GROUP_DEBUG
std::cerr << (out_of_band? "OOB reply trigger" : "Reply trigger")
std::cerr << (out_of_band? "OOB reply trigger" : "Reply trigger")
<< " receive from source " << source << " and tag " << tag
<< " in block " << (block == -1 ? self.my_block_number() : block) << std::endl;
#endif
@@ -581,18 +581,18 @@ receive(mpi_process_group const&, int source, int tag,
// Pass the message off to the handler and send the result back to
// the source.
send_oob(self, source, data.first,
send_oob(self, source, data.first,
handler(source, tag, data.second, context), -2);
}
template<typename Type, typename Handler>
void
void
mpi_process_group::global_trigger_launcher<Type, Handler>::
receive(mpi_process_group const& self, int source, int tag,
receive(mpi_process_group const& self, int source, int tag,
trigger_receive_context context, int block) const
{
#ifdef PBGL_PROCESS_GROUP_DEBUG
std::cerr << (out_of_band? "OOB trigger" : "Trigger")
std::cerr << (out_of_band? "OOB trigger" : "Trigger")
<< " receive from source " << source << " and tag " << tag
<< " in block " << (block == -1 ? self.my_block_number() : block) << std::endl;
#endif
@@ -615,13 +615,13 @@ receive(mpi_process_group const& self, int source, int tag,
template<typename Type, typename Handler>
void
void
mpi_process_group::global_irecv_trigger_launcher<Type, Handler>::
receive(mpi_process_group const& self, int source, int tag,
receive(mpi_process_group const& self, int source, int tag,
trigger_receive_context context, int block) const
{
#ifdef PBGL_PROCESS_GROUP_DEBUG
std::cerr << (out_of_band? "OOB trigger" : "Trigger")
std::cerr << (out_of_band? "OOB trigger" : "Trigger")
<< " receive from source " << source << " and tag " << tag
<< " in block " << (block == -1 ? self.my_block_number() : block) << std::endl;
#endif
@@ -644,12 +644,12 @@ receive(mpi_process_group const& self, int source, int tag,
template<typename Type, typename Handler>
void
void
mpi_process_group::global_irecv_trigger_launcher<Type, Handler>::
prepare_receive(mpi_process_group const& self, int tag, bool force) const
{
#ifdef PBGL_PROCESS_GROUP_DEBUG
std::cerr << ("Posting Irecv for trigger")
std::cerr << ("Posting Irecv for trigger")
<< " receive with tag " << tag << std::endl;
#endif
if (self.impl_->buffers.find(tag) == self.impl_->buffers.end()) {
@@ -657,7 +657,7 @@ prepare_receive(mpi_process_group const& self, int tag, bool force) const
force = true;
}
BOOST_ASSERT(static_cast<int>(self.impl_->buffers[tag].size()) >= buffer_size);
//BOOST_MPL_ASSERT(mpl::not_<is_mpi_datatype<Type> >);
if (force) {
self.impl_->requests.push_back(MPI_Request());
@@ -681,8 +681,8 @@ receive(const mpi_process_group& pg, int tag, T& value)
}
template<typename T>
typename
enable_if<boost::mpi::is_mpi_datatype<T>,
typename
enable_if<boost::mpi::is_mpi_datatype<T>,
std::pair<mpi_process_group::process_id_type, std::size_t> >::type
receive(const mpi_process_group& pg, int tag, T values[], std::size_t n)
{
@@ -691,15 +691,15 @@ receive(const mpi_process_group& pg, int tag, T values[], std::size_t n)
pg.receive_impl(source, pg.encode_tag(pg.my_block_number(), tag),
boost::serialization::make_array(values,n),
boost::mpl::true_());
if (result)
if (result)
return std::make_pair(source, n);
}
BOOST_ASSERT(false);
}
template<typename T>
typename
disable_if<boost::mpi::is_mpi_datatype<T>,
typename
disable_if<boost::mpi::is_mpi_datatype<T>,
std::pair<mpi_process_group::process_id_type, std::size_t> >::type
receive(const mpi_process_group& pg, int tag, T values[], std::size_t n)
{
@@ -730,14 +730,14 @@ receive(const mpi_process_group& pg,
}
template<typename T>
typename
enable_if<boost::mpi::is_mpi_datatype<T>,
typename
enable_if<boost::mpi::is_mpi_datatype<T>,
std::pair<mpi_process_group::process_id_type, std::size_t> >::type
receive(const mpi_process_group& pg, int source, int tag, T values[],
receive(const mpi_process_group& pg, int source, int tag, T values[],
std::size_t n)
{
if (pg.receive_impl(source, pg.encode_tag(pg.my_block_number(), tag),
boost::serialization::make_array(values,n),
boost::serialization::make_array(values,n),
boost::mpl::true_()))
return std::make_pair(source,n);
else {
@@ -751,10 +751,10 @@ receive(const mpi_process_group& pg, int source, int tag, T values[],
}
template<typename T>
typename
disable_if<boost::mpi::is_mpi_datatype<T>,
typename
disable_if<boost::mpi::is_mpi_datatype<T>,
std::pair<mpi_process_group::process_id_type, std::size_t> >::type
receive(const mpi_process_group& pg, int source, int tag, T values[],
receive(const mpi_process_group& pg, int source, int tag, T values[],
std::size_t n)
{
pg.array_receive_impl(source, pg.encode_tag(pg.my_block_number(), tag),
@@ -775,7 +775,7 @@ all_reduce(const mpi_process_group& pg, T* first, T* last, T* out,
if (inplace) out = new T [last-first];
boost::mpi::all_reduce(boost::mpi::communicator(communicator(pg),
boost::mpi::comm_attach),
boost::mpi::comm_attach),
first, last-first, out, bin_op);
if (inplace) {
@@ -789,10 +789,10 @@ all_reduce(const mpi_process_group& pg, T* first, T* last, T* out,
template<typename T>
void
broadcast(const mpi_process_group& pg, T& val,
broadcast(const mpi_process_group& pg, T& val,
mpi_process_group::process_id_type root)
{
// broadcast the seed
// broadcast the seed
boost::mpi::communicator comm(communicator(pg),boost::mpi::comm_attach);
boost::mpi::broadcast(comm,val,root);
}
@@ -914,7 +914,7 @@ Receiver* mpi_process_group::get_receiver()
template<typename T>
typename enable_if<boost::mpi::is_mpi_datatype<T> >::type
receive_oob(const mpi_process_group& pg,
receive_oob(const mpi_process_group& pg,
mpi_process_group::process_id_type source, int tag, T& value, int block)
{
using boost::mpi::get_mpi_datatype;
@@ -926,8 +926,8 @@ receive_oob(const mpi_process_group& pg,
// Post a non-blocking receive that waits until we complete this request.
MPI_Request request;
MPI_Irecv(&value, 1, get_mpi_datatype<T>(value),
source, actual.second, actual.first, &request);
MPI_Irecv(&value, 1, get_mpi_datatype<T>(value),
source, actual.second, actual.first, &request);
int done = 0;
do {
@@ -939,7 +939,7 @@ receive_oob(const mpi_process_group& pg,
template<typename T>
typename disable_if<boost::mpi::is_mpi_datatype<T> >::type
receive_oob(const mpi_process_group& pg,
receive_oob(const mpi_process_group& pg,
mpi_process_group::process_id_type source, int tag, T& value, int block)
{
// Determine the actual message we expect to receive, and which
@@ -967,11 +967,11 @@ receive_oob(const mpi_process_group& pg,
MPI_Get_count(&mpi_status, MPI_PACKED, &size);
in.resize(size);
#endif
// Receive the message data
MPI_Recv(in.address(), in.size(), MPI_PACKED,
status->source(), status->tag(), actual.first, MPI_STATUS_IGNORE);
// Unpack the message data
in >> value;
}
@@ -979,7 +979,7 @@ receive_oob(const mpi_process_group& pg,
template<typename SendT, typename ReplyT>
typename enable_if<boost::mpi::is_mpi_datatype<ReplyT> >::type
send_oob_with_reply(const mpi_process_group& pg,
send_oob_with_reply(const mpi_process_group& pg,
mpi_process_group::process_id_type dest,
int tag, const SendT& send_value, ReplyT& reply_value,
int block)
@@ -992,14 +992,14 @@ send_oob_with_reply(const mpi_process_group& pg,
template<typename SendT, typename ReplyT>
typename disable_if<boost::mpi::is_mpi_datatype<ReplyT> >::type
send_oob_with_reply(const mpi_process_group& pg,
send_oob_with_reply(const mpi_process_group& pg,
mpi_process_group::process_id_type dest,
int tag, const SendT& send_value, ReplyT& reply_value,
int block)
{
detail::tag_allocator::token reply_tag = pg.impl_->allocated_tags.get_tag();
send_oob(pg, dest, tag,
boost::parallel::detail::make_untracked_pair((int)reply_tag,
send_oob(pg, dest, tag,
boost::parallel::detail::make_untracked_pair((int)reply_tag,
send_value), block);
receive_oob(pg, dest, reply_tag, reply_value);
}

View File

@@ -20,7 +20,7 @@
#define SEND_OOB_BSEND
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <utility>
#include <memory>
@@ -48,7 +48,7 @@ class mpi_process_group
* The type of a "receive" handler, that will be provided with
* (source, tag) pairs when a message is received. Users can provide a
* receive handler for a distributed data structure, for example, to
* automatically pick up and respond to messages as needed.
* automatically pick up and respond to messages as needed.
*/
typedef function<void(int source, int tag)> receiver_type;
@@ -75,7 +75,7 @@ class mpi_process_group
/// Classification of the capabilities of this process group
struct communication_category
: virtual parallel::bsp_process_group_tag,
: virtual parallel::bsp_process_group_tag,
virtual mpi_process_group_tag { };
// TBD: We can eliminate the "source" field and possibly the
@@ -92,7 +92,7 @@ class mpi_process_group
/// The length of the message in the buffer, in bytes
std::size_t bytes;
template <class Archive>
void serialize(Archive& ar, int)
{
@@ -113,14 +113,14 @@ class mpi_process_group
std::vector<message_header> headers;
buffer_type buffer;
template <class Archive>
void serialize(Archive& ar, int)
{
ar & headers & buffer;
}
void swap(outgoing_messages& x)
void swap(outgoing_messages& x)
{
headers.swap(x.headers);
buffer.swap(x.buffer);
@@ -137,21 +137,21 @@ private:
public:
explicit trigger_base(int tag) : tag_(tag) { }
/// Retrieve the tag associated with this trigger
/// Retrieve the tag associated with this trigger
int tag() const { return tag_; }
virtual ~trigger_base() { }
/**
* Invoked to receive a message that matches a particular trigger.
* Invoked to receive a message that matches a particular trigger.
*
* @param source the source of the message
* @param tag the (local) tag of the message
* @param context the context under which the trigger is being
* invoked
*/
virtual void
receive(mpi_process_group const& pg, int source, int tag,
virtual void
receive(mpi_process_group const& pg, int source, int tag,
trigger_receive_context context, int block=-1) const = 0;
protected:
@@ -162,19 +162,19 @@ private:
/**
* Launches a specific handler in response to a trigger. This
* function object wraps up the handler function object and a buffer
* for incoming data.
* for incoming data.
*/
template<typename Type, typename Handler>
class trigger_launcher : public trigger_base
{
public:
explicit trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler)
: trigger_base(tag), self(self), handler(handler)
explicit trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler)
: trigger_base(tag), self(self), handler(handler)
{}
void
receive(mpi_process_group const& pg, int source, int tag,
void
receive(mpi_process_group const& pg, int source, int tag,
trigger_receive_context context, int block=-1) const;
private:
@@ -191,13 +191,13 @@ private:
class reply_trigger_launcher : public trigger_base
{
public:
explicit reply_trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler)
: trigger_base(tag), self(self), handler(handler)
explicit reply_trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler)
: trigger_base(tag), self(self), handler(handler)
{}
void
receive(mpi_process_group const& pg, int source, int tag,
void
receive(mpi_process_group const& pg, int source, int tag,
trigger_receive_context context, int block=-1) const;
private:
@@ -209,14 +209,14 @@ private:
class global_trigger_launcher : public trigger_base
{
public:
explicit global_trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler)
: trigger_base(tag), handler(handler)
{
explicit global_trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler)
: trigger_base(tag), handler(handler)
{
}
void
receive(mpi_process_group const& pg, int source, int tag,
void
receive(mpi_process_group const& pg, int source, int tag,
trigger_receive_context context, int block=-1) const;
private:
@@ -229,15 +229,15 @@ private:
class global_irecv_trigger_launcher : public trigger_base
{
public:
explicit global_irecv_trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler, int sz)
explicit global_irecv_trigger_launcher(mpi_process_group& self, int tag,
const Handler& handler, int sz)
: trigger_base(tag), handler(handler), buffer_size(sz)
{
{
prepare_receive(self,tag);
}
void
receive(mpi_process_group const& pg, int source, int tag,
void
receive(mpi_process_group const& pg, int source, int tag,
trigger_receive_context context, int block=-1) const;
private:
@@ -249,32 +249,32 @@ private:
};
public:
/**
/**
* Construct a new BSP process group from an MPI communicator. The
* MPI communicator will be duplicated to create a new communicator
* for this process group to use.
*/
mpi_process_group(communicator_type parent_comm = communicator_type());
/**
/**
* Construct a new BSP process group from an MPI communicator. The
* MPI communicator will be duplicated to create a new communicator
* for this process group to use. This constructor allows to tune the
* size of message batches.
*
*
* @param num_headers The maximum number of headers in a message batch
*
* @param buffer_size The maximum size of the message buffer in a batch.
*
*/
mpi_process_group( std::size_t num_headers, std::size_t buffer_size,
mpi_process_group( std::size_t num_headers, std::size_t buffer_size,
communicator_type parent_comm = communicator_type());
/**
* Construct a copy of the BSP process group for a new distributed
* data structure. This data structure will synchronize with all
* other members of the process group's equivalence class (including
* @p other), but will have its own set of tags.
* @p other), but will have its own set of tags.
*
* @param other The process group that this new process group will
* be based on, using a different set of tags within the same
@@ -296,9 +296,9 @@ public:
* Construct a copy of the BSP process group for a new distributed
* data structure. This data structure will synchronize with all
* other members of the process group's equivalence class (including
* @p other), but will have its own set of tags.
* @p other), but will have its own set of tags.
*/
mpi_process_group(const mpi_process_group& other,
mpi_process_group(const mpi_process_group& other,
attach_distributed_object,
bool out_of_band_receive = false);
@@ -335,7 +335,7 @@ public:
void
replace_on_synchronize_handler(const on_synchronize_event_type& handler = 0);
/**
/**
* Return the block number of the current data structure. A value of
* 0 indicates that this particular instance of the process group is
* not associated with any distributed data structure.
@@ -350,7 +350,7 @@ public:
{ return block_num * max_tags + tag; }
/**
* Decode an encoded tag into a block number/tag pair.
* Decode an encoded tag into a block number/tag pair.
*/
std::pair<int, int> decode_tag(int encoded_tag) const
{ return std::make_pair(encoded_tag / max_tags, encoded_tag % max_tags); }
@@ -366,13 +366,13 @@ public:
*/
int allocate_block(bool out_of_band_receive = false);
/** Potentially emit a receive event out of band. Returns true if an event
* was actually sent, false otherwise.
/** Potentially emit a receive event out of band. Returns true if an event
* was actually sent, false otherwise.
*/
bool maybe_emit_receive(int process, int encoded_tag) const;
/** Emit a receive event. Returns true if an event was actually
* sent, false otherwise.
* sent, false otherwise.
*/
bool emit_receive(int process, int encoded_tag) const;
@@ -450,7 +450,7 @@ public:
void trigger_with_reply(int tag, const Handler& handler);
template<typename Type, typename Handler>
void global_trigger(int tag, const Handler& handler, std::size_t buffer_size=0);
void global_trigger(int tag, const Handler& handler, std::size_t buffer_size=0);
@@ -468,7 +468,7 @@ public:
* @param synchronizing whether we are currently synchronizing the
* process group
*/
optional<std::pair<int, int> >
optional<std::pair<int, int> >
poll(bool wait = false, int block = -1, bool synchronizing = false) const;
/**
@@ -489,11 +489,11 @@ public:
///
/// Determine the actual communicator and tag will be used for a
/// transmission with the given tag.
std::pair<boost::mpi::communicator, int>
std::pair<boost::mpi::communicator, int>
actual_communicator_and_tag(int tag, int block) const;
/// set the size of the message buffer used for buffered oob sends
static void set_message_buffer_size(std::size_t s);
/// get the size of the message buffer used for buffered oob sends
@@ -503,12 +503,12 @@ public:
static void* old_buffer;
private:
void install_trigger(int tag, int block,
shared_ptr<trigger_base> const& launcher);
void install_trigger(int tag, int block,
std::shared_ptr<trigger_base> const& launcher);
void poll_requests(int block=-1) const;
// send a batch if the buffer is full now or would get full
void maybe_send_batch(process_id_type dest) const;
@@ -527,7 +527,7 @@ private:
void receive_batch(boost::mpi::status& status) const;
//void free_finished_sends() const;
/// Status messages used internally by the process group
enum status_messages {
/// the first of the reserved message tags
@@ -557,13 +557,13 @@ private:
/// Handler for receive events
receiver_type on_receive;
/// Handler executed at the start of synchronization
/// Handler executed at the start of synchronization
on_synchronize_event_type on_synchronize;
/// Individual message triggers. Note: at present, this vector is
/// indexed by the (local) tag of the trigger. Any tags that
/// don't have triggers will have NULL pointers in that spot.
std::vector<shared_ptr<trigger_base> > triggers;
std::vector<std::shared_ptr<trigger_base> > triggers;
};
/**
@@ -581,7 +581,7 @@ private:
* @c block_num.
*/
struct deallocate_block;
static std::vector<char> message_buffer;
public:
@@ -589,17 +589,17 @@ public:
* Data associated with the process group and all of its attached
* distributed data structures.
*/
shared_ptr<impl> impl_;
std::shared_ptr<impl> impl_;
/**
* When non-null, indicates that this copy of the process group is
* associated with a particular distributed data structure. The
* integer value contains the block number (a value > 0) associated
* with that data structure. The deleter for this @c shared_ptr is a
* with that data structure. The deleter for this @c std::shared_ptr is a
* @c deallocate_block object that will deallocate the associated
* block in @c impl_->blocks.
*/
shared_ptr<int> block_num;
std::shared_ptr<int> block_num;
/**
* Rank of this process, to avoid having to call rank() repeatedly.
@@ -615,11 +615,11 @@ public:
inline mpi_process_group::process_id_type
inline mpi_process_group::process_id_type
process_id(const mpi_process_group& pg)
{ return pg.rank; }
inline mpi_process_group::process_size_type
inline mpi_process_group::process_size_type
num_processes(const mpi_process_group& pg)
{ return pg.size; }
@@ -683,7 +683,7 @@ process_subgroup(const mpi_process_group& pg,
template<typename T>
void
broadcast(const mpi_process_group& pg, T& val,
broadcast(const mpi_process_group& pg, T& val,
mpi_process_group::process_id_type root);
@@ -705,15 +705,15 @@ send_oob(const mpi_process_group& pg, mpi_process_group::process_id_type dest,
#ifdef SEND_OOB_BSEND
if (mpi_process_group::message_buffer_size()) {
MPI_Bsend(const_cast<T*>(&value), 1, get_mpi_datatype<T>(value), dest,
MPI_Bsend(const_cast<T*>(&value), 1, get_mpi_datatype<T>(value), dest,
actual.second, actual.first);
return;
}
#endif
MPI_Request request;
MPI_Isend(const_cast<T*>(&value), 1, get_mpi_datatype<T>(value), dest,
MPI_Isend(const_cast<T*>(&value), 1, get_mpi_datatype<T>(value), dest,
actual.second, actual.first, &request);
int done=0;
do {
pg.poll();
@@ -759,24 +759,24 @@ send_oob(const mpi_process_group& pg, mpi_process_group::process_id_type dest,
template<typename T>
typename enable_if<boost::mpi::is_mpi_datatype<T> >::type
receive_oob(const mpi_process_group& pg,
receive_oob(const mpi_process_group& pg,
mpi_process_group::process_id_type source, int tag, T& value, int block=-1);
template<typename T>
typename disable_if<boost::mpi::is_mpi_datatype<T> >::type
receive_oob(const mpi_process_group& pg,
receive_oob(const mpi_process_group& pg,
mpi_process_group::process_id_type source, int tag, T& value, int block=-1);
template<typename SendT, typename ReplyT>
typename enable_if<boost::mpi::is_mpi_datatype<ReplyT> >::type
send_oob_with_reply(const mpi_process_group& pg,
send_oob_with_reply(const mpi_process_group& pg,
mpi_process_group::process_id_type dest,
int tag, const SendT& send_value, ReplyT& reply_value,
int block = -1);
template<typename SendT, typename ReplyT>
typename disable_if<boost::mpi::is_mpi_datatype<ReplyT> >::type
send_oob_with_reply(const mpi_process_group& pg,
send_oob_with_reply(const mpi_process_group& pg,
mpi_process_group::process_id_type dest,
int tag, const SendT& send_value, ReplyT& reply_value,
int block = -1);
@@ -791,7 +791,7 @@ namespace boost { namespace mpi {
namespace std {
/// optimized swap for outgoing messages
inline void
inline void
swap(boost::graph::distributed::mpi_process_group::outgoing_messages& x,
boost::graph::distributed::mpi_process_group::outgoing_messages& y)
{

View File

@@ -15,7 +15,7 @@
#include <boost/graph/parallel/process_group.hpp>
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <vector>
namespace boost { namespace graph { namespace distributed {
@@ -213,12 +213,12 @@ class distributed_queue
void setup_triggers();
// Message handlers
void
handle_push(int source, int tag, const value_type& value,
void
handle_push(int source, int tag, const value_type& value,
trigger_receive_context);
void
handle_multipush(int source, int tag, const std::vector<value_type>& values,
void
handle_multipush(int source, int tag, const std::vector<value_type>& values,
trigger_receive_context);
mutable ProcessGroup process_group;
@@ -229,7 +229,7 @@ class distributed_queue
typedef std::vector<value_type> outgoing_buffer_t;
typedef std::vector<outgoing_buffer_t> outgoing_buffers_t;
shared_ptr<outgoing_buffers_t> outgoing_buffers;
std::shared_ptr<outgoing_buffers_t> outgoing_buffers;
};
/// Helper macro containing the normal names for the template

View File

@@ -25,7 +25,7 @@ namespace boost {
// requires an MPI process group. Run-time is slightly worse than
// the unique rmat generator. Edge list generated is sorted and
// unique.
template<typename ProcessGroup, typename Distribution,
template<typename ProcessGroup, typename Distribution,
typename RandomGenerator, typename Graph>
class scalable_rmat_iterator
{
@@ -47,8 +47,8 @@ namespace boost {
// Initialize for edge generation
scalable_rmat_iterator(ProcessGroup pg, Distribution distrib,
RandomGenerator& gen, vertices_size_type n,
edges_size_type m, double a, double b, double c,
RandomGenerator& gen, vertices_size_type n,
edges_size_type m, double a, double b, double c,
double d, bool permute_vertices = true)
: gen(), done(false)
{
@@ -58,12 +58,12 @@ namespace boost {
this->gen.reset(new uniform_01<RandomGenerator>(gen));
std::vector<vertices_size_type> vertexPermutation;
if (permute_vertices)
if (permute_vertices)
generate_permutation_vector(gen, vertexPermutation, n);
int SCALE = int(floor(log(double(n))/log(2.)));
boost::uniform_01<RandomGenerator> prob(gen);
std::map<value_type, bool> edge_map;
edges_size_type generated = 0, local_edges = 0;
@@ -121,13 +121,13 @@ namespace boost {
reference operator*() const { return current; }
pointer operator->() const { return &current; }
scalable_rmat_iterator& operator++()
{
if (!values.empty()) {
current = values.back();
values.pop_back();
} else
} else
done = true;
return *this;
@@ -151,7 +151,7 @@ namespace boost {
private:
// Parameters
shared_ptr<uniform_01<RandomGenerator> > gen;
std::shared_ptr<uniform_01<RandomGenerator> > gen;
// Internal data structures
std::vector<value_type> values;

View File

@@ -16,7 +16,7 @@
#include <boost/graph/graph_traits.hpp>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/parallel/algorithm.hpp>
#include <boost/graph/parallel/container_traits.hpp>
@@ -25,9 +25,9 @@
namespace boost { namespace graph {
// --------------------------------------------------------------------------
// Global index map built from a distribution
// Global index map built from a distribution
// --------------------------------------------------------------------------
template<typename Distribution, typename OwnerPropertyMap,
template<typename Distribution, typename OwnerPropertyMap,
typename LocalPropertyMap>
class distribution_global_index_map
{
@@ -47,16 +47,16 @@ class distribution_global_index_map
LocalPropertyMap local;
};
template<typename Distribution, typename OwnerPropertyMap,
template<typename Distribution, typename OwnerPropertyMap,
typename LocalPropertyMap>
inline
inline
typename distribution_global_index_map<Distribution, OwnerPropertyMap,
LocalPropertyMap>::value_type
get(const distribution_global_index_map<Distribution, OwnerPropertyMap,
LocalPropertyMap>& p,
typename distribution_global_index_map<Distribution, OwnerPropertyMap,
LocalPropertyMap>::key_type x)
{
{
using boost::get;
return p.distribution_.global(get(p.owner, x), get(p.local, x));
}
@@ -64,15 +64,15 @@ get(const distribution_global_index_map<Distribution, OwnerPropertyMap,
template<typename Graph, typename Distribution>
inline
distribution_global_index_map<
Distribution,
Distribution,
typename property_map<Graph, vertex_owner_t>::const_type,
typename property_map<Graph, vertex_local_t>::const_type>
make_distribution_global_index_map(const Graph& g, const Distribution& d)
{
typedef distribution_global_index_map<
Distribution,
Distribution,
typename property_map<Graph, vertex_owner_t>::const_type,
typename property_map<Graph, vertex_local_t>::const_type>
typename property_map<Graph, vertex_local_t>::const_type>
result_type;
return result_type(d, get(vertex_owner, g), get(vertex_local, g));
}
@@ -86,7 +86,7 @@ class stored_global_index_map : public IndexMap
public:
typedef readable_property_map_tag category;
stored_global_index_map(const IndexMap& index_map) : IndexMap(index_map) {
stored_global_index_map(const IndexMap& index_map) : IndexMap(index_map) {
// When we have a global index, we need to always have the indices
// of every key we've seen
this->set_max_ghost_cells(0);
@@ -98,13 +98,13 @@ class stored_global_index_map : public IndexMap
// --------------------------------------------------------------------------
namespace detail {
template<typename PropertyMap, typename ForwardIterator>
inline void
initialize_global_index_map(const PropertyMap&,
ForwardIterator, ForwardIterator)
inline void
initialize_global_index_map(const PropertyMap&,
ForwardIterator, ForwardIterator)
{ }
template<typename IndexMap, typename ForwardIterator>
void
void
initialize_global_index_map(stored_global_index_map<IndexMap>& p,
ForwardIterator first, ForwardIterator last)
{
@@ -126,18 +126,18 @@ class vertex_list_adaptor : public graph_traits<Graph>
typedef graph_traits<Graph> inherited;
typedef typename inherited::traversal_category base_traversal_category;
public:
typedef typename inherited::vertex_descriptor vertex_descriptor;
typedef typename std::vector<vertex_descriptor>::iterator vertex_iterator;
typedef typename std::vector<vertex_descriptor>::size_type
vertices_size_type;
struct traversal_category
struct traversal_category
: public virtual base_traversal_category,
public virtual vertex_list_graph_tag {};
vertex_list_adaptor(const Graph& g,
vertex_list_adaptor(const Graph& g,
const GlobalIndexMap& index_map = GlobalIndexMap())
: g(&g), index_map(index_map)
{
@@ -146,7 +146,7 @@ class vertex_list_adaptor : public graph_traits<Graph>
all_vertices_.reset(new std::vector<vertex_descriptor>());
all_gather(process_group(), vertices(g).first, vertices(g).second,
*all_vertices_);
detail::initialize_global_index_map(this->index_map,
detail::initialize_global_index_map(this->index_map,
all_vertices_->begin(),
all_vertices_->end());
}
@@ -156,13 +156,13 @@ class vertex_list_adaptor : public graph_traits<Graph>
// --------------------------------------------------------------------------
// Distributed Container
// --------------------------------------------------------------------------
typedef typename boost::graph::parallel::process_group_type<Graph>::type
typedef typename boost::graph::parallel::process_group_type<Graph>::type
process_group_type;
process_group_type process_group() const
{
process_group_type process_group() const
{
using boost::graph::parallel::process_group;
return process_group(*g);
return process_group(*g);
}
std::pair<vertex_iterator, vertex_iterator> vertices() const
@@ -175,7 +175,7 @@ class vertex_list_adaptor : public graph_traits<Graph>
private:
const Graph* g;
GlobalIndexMap index_map;
shared_ptr<std::vector<vertex_descriptor> > all_vertices_;
std::shared_ptr<std::vector<vertex_descriptor> > all_vertices_;
};
template<typename Graph, typename GlobalIndexMap>
@@ -197,18 +197,18 @@ namespace detail {
}
template<typename Graph>
inline
vertex_list_adaptor<Graph,
inline
vertex_list_adaptor<Graph,
typename detail::default_global_index_map<Graph>::type>
make_vertex_list_adaptor(const Graph& g)
{
typedef typename detail::default_global_index_map<Graph>::type
{
typedef typename detail::default_global_index_map<Graph>::type
GlobalIndexMap;
typedef typename detail::default_global_index_map<Graph>::distributed_map
DistributedMap;
typedef vertex_list_adaptor<Graph, GlobalIndexMap> result_type;
return result_type(g,
GlobalIndexMap(DistributedMap(num_vertices(g),
return result_type(g,
GlobalIndexMap(DistributedMap(num_vertices(g),
get(vertex_index, g))));
}
@@ -375,7 +375,7 @@ namespace boost {
// Property Graph: vertex_index property
// --------------------------------------------------------------------------
template<typename Graph, typename GlobalIndexMap>
class property_map<vertex_index_t,
class property_map<vertex_index_t,
graph::vertex_list_adaptor<Graph, GlobalIndexMap> >
{
public:
@@ -384,7 +384,7 @@ public:
};
template<typename Graph, typename GlobalIndexMap>
class property_map<vertex_index_t,
class property_map<vertex_index_t,
const graph::vertex_list_adaptor<Graph, GlobalIndexMap> >
{
public:

View File

@@ -13,7 +13,7 @@
#include <boost/assert.hpp>
#include <iterator>
#include <utility>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/random/geometric_distribution.hpp>
@@ -31,7 +31,7 @@ namespace boost {
std::pair<typename graph_traits<Graph>::vertices_size_type,
typename graph_traits<Graph>::vertices_size_type>,
std::input_iterator_tag,
const
const
std::pair<typename graph_traits<Graph>::vertices_size_type,
typename graph_traits<Graph>::vertices_size_type>&>
{
@@ -97,7 +97,7 @@ namespace boost {
std::pair<typename graph_traits<Graph>::vertices_size_type,
typename graph_traits<Graph>::vertices_size_type>,
std::input_iterator_tag,
const
const
std::pair<typename graph_traits<Graph>::vertices_size_type,
typename graph_traits<Graph>::vertices_size_type>&>
{
@@ -181,7 +181,7 @@ namespace boost {
if (src == n) src = (std::numeric_limits<vertices_size_type>::max)();
}
shared_ptr<uniform_01<RandomGenerator*> > gen;
std::shared_ptr<uniform_01<RandomGenerator*> > gen;
geometric_distribution<vertices_size_type> rand_vertex;
vertices_size_type n;
bool allow_self_loops;

View File

@@ -26,13 +26,13 @@
#include <boost/graph/properties.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/named_function_params.hpp>
#include <boost/graph/topology.hpp>
namespace boost {
namespace boost {
namespace detail {
@@ -62,12 +62,12 @@ struct update_position_visitor {
double distance_limit,
double learning_constant,
double falloff_ratio):
position_map(position_map), node_distance(node_distance),
position_map(position_map), node_distance(node_distance),
space(space),
input_vector(input_vector), distance_limit(distance_limit),
learning_constant(learning_constant), falloff_ratio(falloff_ratio) {}
void operator()(vertex_descriptor v, const Graph&) const
void operator()(vertex_descriptor v, const Graph&) const
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::pow;
@@ -77,7 +77,7 @@ struct update_position_visitor {
BOOST_THROW_EXCEPTION(over_distance_limit());
Point old_position = get(position_map, v);
double distance = get(node_distance, v);
double fraction =
double fraction =
learning_constant * pow(falloff_ratio, distance * distance);
put(position_map, v,
space.move_position_toward(old_position, fraction, input_vector));
@@ -88,7 +88,7 @@ template<typename EdgeWeightMap>
struct gursoy_shortest
{
template<typename Graph, typename NodeDistanceMap, typename UpdatePosition>
static inline void
static inline void
run(const Graph& g, typename graph_traits<Graph>::vertex_descriptor s,
NodeDistanceMap node_distance, UpdatePosition& update_position,
EdgeWeightMap weight)
@@ -104,7 +104,7 @@ template<>
struct gursoy_shortest<dummy_property_map>
{
template<typename Graph, typename NodeDistanceMap, typename UpdatePosition>
static inline void
static inline void
run(const Graph& g, typename graph_traits<Graph>::vertex_descriptor s,
NodeDistanceMap node_distance, UpdatePosition& update_position,
dummy_property_map)
@@ -119,11 +119,11 @@ struct gursoy_shortest<dummy_property_map>
} // namespace detail
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename Diameter, typename VertexIndexMap,
typename PositionMap, typename Diameter, typename VertexIndexMap,
typename EdgeWeightMap>
void
void
gursoy_atun_step
(const VertexListAndIncidenceGraph& graph,
(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
Diameter diameter,
@@ -143,21 +143,21 @@ gursoy_atun_step
typedef typename Topology::point_type point_type;
vertex_iterator i, iend;
std::vector<double> distance_from_input_vector(num_vertices(graph));
typedef boost::iterator_property_map<std::vector<double>::iterator,
typedef boost::iterator_property_map<std::vector<double>::iterator,
VertexIndexMap,
double, double&>
DistanceFromInputMap;
DistanceFromInputMap distance_from_input(distance_from_input_vector.begin(),
vertex_index_map);
std::vector<double> node_distance_map_vector(num_vertices(graph));
typedef boost::iterator_property_map<std::vector<double>::iterator,
typedef boost::iterator_property_map<std::vector<double>::iterator,
VertexIndexMap,
double, double&>
NodeDistanceMap;
NodeDistanceMap node_distance(node_distance_map_vector.begin(),
vertex_index_map);
point_type input_vector = space.random_point();
vertex_descriptor min_distance_loc
vertex_descriptor min_distance_loc
= graph_traits<VertexListAndIncidenceGraph>::null_vertex();
double min_distance = 0.0;
bool min_distance_unset = true;
@@ -173,24 +173,24 @@ gursoy_atun_step
BOOST_ASSERT (!min_distance_unset); // Graph must have at least one vertex
boost::detail::update_position_visitor<
PositionMap, NodeDistanceMap, Topology,
VertexListAndIncidenceGraph>
VertexListAndIncidenceGraph>
update_position(position, node_distance, space,
input_vector, diameter, learning_constant,
input_vector, diameter, learning_constant,
exp(-1. / (2 * diameter * diameter)));
std::fill(node_distance_map_vector.begin(), node_distance_map_vector.end(), 0);
try {
typedef detail::gursoy_shortest<EdgeWeightMap> shortest;
shortest::run(graph, min_distance_loc, node_distance, update_position,
weight);
} catch (detail::over_distance_limit) {
/* Thrown to break out of BFS or Dijkstra early */
weight);
} catch (detail::over_distance_limit) {
/* Thrown to break out of BFS or Dijkstra early */
}
}
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename VertexIndexMap,
typename PositionMap, typename VertexIndexMap,
typename EdgeWeightMap>
void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph,
void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
int nsteps,
@@ -199,7 +199,7 @@ void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph,
double learning_constant_initial,
double learning_constant_final,
VertexIndexMap vertex_index_map,
EdgeWeightMap weight)
EdgeWeightMap weight)
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::pow;
@@ -213,17 +213,17 @@ void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph,
typedef typename Topology::point_type point_type;
vertex_iterator i, iend;
double diameter_ratio = (double)diameter_final / diameter_initial;
double learning_constant_ratio =
double learning_constant_ratio =
learning_constant_final / learning_constant_initial;
std::vector<double> distance_from_input_vector(num_vertices(graph));
typedef boost::iterator_property_map<std::vector<double>::iterator,
typedef boost::iterator_property_map<std::vector<double>::iterator,
VertexIndexMap,
double, double&>
DistanceFromInputMap;
DistanceFromInputMap distance_from_input(distance_from_input_vector.begin(),
vertex_index_map);
std::vector<int> node_distance_map_vector(num_vertices(graph));
typedef boost::iterator_property_map<std::vector<int>::iterator,
typedef boost::iterator_property_map<std::vector<int>::iterator,
VertexIndexMap, double, double&>
NodeDistanceMap;
NodeDistanceMap node_distance(node_distance_map_vector.begin(),
@@ -231,17 +231,17 @@ void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph,
for (int round = 0; round < nsteps; ++round) {
double part_done = (double)round / (nsteps - 1);
int diameter = (int)(diameter_initial * pow(diameter_ratio, part_done));
double learning_constant =
double learning_constant =
learning_constant_initial * pow(learning_constant_ratio, part_done);
gursoy_atun_step(graph, space, position, diameter, learning_constant,
gursoy_atun_step(graph, space, position, diameter, learning_constant,
vertex_index_map, weight);
}
}
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename VertexIndexMap,
typename PositionMap, typename VertexIndexMap,
typename EdgeWeightMap>
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
int nsteps,
@@ -260,14 +260,14 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
}
gursoy_atun_refine(graph, space,
position, nsteps,
diameter_initial, diameter_final,
diameter_initial, diameter_final,
learning_constant_initial, learning_constant_final,
vertex_index_map, weight);
}
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename VertexIndexMap>
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
int nsteps,
@@ -277,15 +277,15 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
double learning_constant_final,
VertexIndexMap vertex_index_map)
{
gursoy_atun_layout(graph, space, position, nsteps,
diameter_initial, diameter_final,
learning_constant_initial, learning_constant_final,
gursoy_atun_layout(graph, space, position, nsteps,
diameter_initial, diameter_final,
learning_constant_initial, learning_constant_final,
vertex_index_map, dummy_property_map());
}
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap>
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
int nsteps,
@@ -293,15 +293,15 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
double diameter_final = 1.0,
double learning_constant_initial = 0.8,
double learning_constant_final = 0.2)
{
{
gursoy_atun_layout(graph, space, position, nsteps, diameter_initial,
diameter_final, learning_constant_initial,
learning_constant_final, get(vertex_index, graph));
learning_constant_final, get(vertex_index, graph));
}
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap>
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
int nsteps)
@@ -310,13 +310,13 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
using std::sqrt;
#endif
gursoy_atun_layout(graph, space, position, nsteps,
gursoy_atun_layout(graph, space, position, nsteps,
sqrt((double)num_vertices(graph)));
}
template <typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap>
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position)
{
@@ -325,8 +325,8 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
template<typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename P, typename T, typename R>
void
gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
void
gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
const Topology& space,
PositionMap position,
const bgl_named_params<P,T,R>& params)
@@ -340,17 +340,17 @@ gursoy_atun_layout(const VertexListAndIncidenceGraph& graph,
gursoy_atun_layout(graph, space, position,
choose_param(get_param(params, iterations_t()),
num_vertices(graph)),
choose_param(get_param(params, diameter_range_t()),
choose_param(get_param(params, diameter_range_t()),
diam).first,
choose_param(get_param(params, diameter_range_t()),
choose_param(get_param(params, diameter_range_t()),
diam).second,
choose_param(get_param(params, learning_constant_range_t()),
choose_param(get_param(params, learning_constant_range_t()),
learn).first,
choose_param(get_param(params, learning_constant_range_t()),
choose_param(get_param(params, learning_constant_range_t()),
learn).second,
choose_const_pmap(get_param(params, vertex_index), graph,
vertex_index),
choose_param(get_param(params, edge_weight),
choose_param(get_param(params, edge_weight),
dummy_property_map()));
}

View File

@@ -46,11 +46,11 @@ namespace boost {
// Algorithms", and the application to connected components is
// similar to the algorithm described in Ch. 22 of "Intro to
// Algorithms" by Cormen, et. all.
//
//
// An implementation of disjoint sets can be found in
// boost/pending/disjoint_sets.hpp
template <class EdgeListGraph, class DisjointSets>
void incremental_components(EdgeListGraph& g, DisjointSets& ds)
{
@@ -58,35 +58,35 @@ namespace boost {
for (boost::tie(e,end) = edges(g); e != end; ++e)
ds.union_set(source(*e,g),target(*e,g));
}
template <class ParentIterator>
void compress_components(ParentIterator first, ParentIterator last)
{
for (ParentIterator current = first; current != last; ++current)
for (ParentIterator current = first; current != last; ++current)
detail::find_representative_with_full_compression(first, current-first);
}
template <class ParentIterator>
typename boost::detail::iterator_traits<ParentIterator>::difference_type
component_count(ParentIterator first, ParentIterator last)
{
std::ptrdiff_t count = 0;
for (ParentIterator current = first; current != last; ++current)
if (*current == current - first) ++count;
for (ParentIterator current = first; current != last; ++current)
if (*current == current - first) ++count;
return count;
}
// This algorithm can be applied to the result container of the
// connected_components algorithm to normalize
// the components.
template <class ParentIterator>
void normalize_components(ParentIterator first, ParentIterator last)
{
for (ParentIterator current = first; current != last; ++current)
for (ParentIterator current = first; current != last; ++current)
detail::normalize_node(first, current - first);
}
template <class VertexListGraph, class DisjointSets>
template <class VertexListGraph, class DisjointSets>
void initialize_incremental_components(VertexListGraph& G, DisjointSets& ds)
{
typename graph_traits<VertexListGraph>
@@ -129,7 +129,7 @@ namespace boost {
m_index_list(make_shared<IndexContainer>(m_num_elements)) {
build_index_lists(parent_start, index_map);
} // component_index
template <typename ParentIterator>
@@ -222,10 +222,10 @@ namespace boost {
protected:
IndexType m_num_elements;
shared_ptr<IndexContainer> m_components, m_index_list;
std::shared_ptr<IndexContainer> m_components, m_index_list;
}; // class component_index
} // namespace boost
#endif // BOOST_INCREMENTAL_COMPONENTS_HPP

View File

@@ -35,13 +35,13 @@ namespace boost {
struct mcgregor_common_subgraph_traits {
typedef typename graph_traits<GraphFirst>::vertex_descriptor vertex_first_type;
typedef typename graph_traits<GraphSecond>::vertex_descriptor vertex_second_type;
typedef shared_array_property_map<vertex_second_type, VertexIndexMapFirst>
correspondence_map_first_to_second_type;
typedef shared_array_property_map<vertex_first_type, VertexIndexMapSecond>
correspondence_map_second_to_first_type;
};
};
} // namespace detail
@@ -52,7 +52,7 @@ namespace boost {
template <typename PropertyMapFirst,
typename PropertyMapSecond>
struct property_map_equivalent {
property_map_equivalent(const PropertyMapFirst property_map1,
const PropertyMapSecond property_map2) :
m_property_map1(property_map1),
@@ -63,7 +63,7 @@ namespace boost {
bool operator()(const ItemFirst item1, const ItemSecond item2) {
return (get(m_property_map1, item1) == get(m_property_map2, item2));
}
private:
const PropertyMapFirst m_property_map1;
const PropertyMapSecond m_property_map2;
@@ -86,7 +86,7 @@ namespace boost {
// Binary function object that always returns true. Used when
// vertices or edges are always equivalent (i.e. have no labels).
struct always_equivalent {
template <typename ItemFirst,
typename ItemSecond>
bool operator()(const ItemFirst&, const ItemSecond&) {
@@ -123,7 +123,7 @@ namespace boost {
{
typedef typename graph_traits<GraphFirst>::vertex_descriptor VertexFirst;
typedef typename graph_traits<GraphSecond>::vertex_descriptor VertexSecond;
typedef typename graph_traits<GraphFirst>::edge_descriptor EdgeFirst;
typedef typename graph_traits<GraphSecond>::edge_descriptor EdgeSecond;
@@ -153,7 +153,7 @@ namespace boost {
// first matching edge is always chosen.
EdgeFirst edge_to_new1, edge_from_new1;
bool edge_to_new_exists1 = false, edge_from_new_exists1 = false;
EdgeSecond edge_to_new2, edge_from_new2;
bool edge_to_new_exists2 = false, edge_from_new_exists2 = false;
@@ -179,7 +179,7 @@ namespace boost {
if ((edge_to_new_exists1 != edge_to_new_exists2) ||
((edge_to_new_exists1 && edge_to_new_exists2) &&
!edges_equivalent(edge_to_new1, edge_to_new2))) {
return (false);
}
@@ -225,7 +225,7 @@ namespace boost {
if ((edge_from_new_exists1 != edge_from_new_exists2) ||
((edge_from_new_exists1 && edge_from_new_exists2) &&
!edges_equivalent(edge_from_new1, edge_from_new2))) {
return (false);
}
@@ -244,7 +244,7 @@ namespace boost {
}
return (true);
}
}
// Recursive method that does a depth-first search in the space of
// potential subgraphs. At each level, every new vertex pair from
@@ -284,14 +284,14 @@ namespace boost {
// Get iterators for vertices from both graphs
typename graph_traits<GraphFirst>::vertex_iterator
vertex1_iter, vertex1_end;
typename graph_traits<GraphSecond>::vertex_iterator
vertex2_begin, vertex2_end, vertex2_iter;
boost::tie(vertex1_iter, vertex1_end) = vertices(graph1);
boost::tie(vertex2_begin, vertex2_end) = vertices(graph2);
vertex2_iter = vertex2_begin;
// Iterate until all vertices have been visited
BGL_FORALL_VERTICES_T(new_vertex1, graph1, GraphFirst) {
@@ -301,7 +301,7 @@ namespace boost {
if (existing_vertex2 != graph_traits<GraphSecond>::null_vertex()) {
continue;
}
BGL_FORALL_VERTICES_T(new_vertex2, graph2, GraphSecond) {
VertexFirst existing_vertex1 = get(correspondence_map_2_to_1, new_vertex2);
@@ -330,7 +330,7 @@ namespace boost {
// Only output sub-graphs larger than a single vertex
if (new_graph_size > 1) {
// Returning false from the callback will cancel iteration
if (!subgraph_callback(correspondence_map_1_to_2,
correspondence_map_2_to_1,
@@ -338,7 +338,7 @@ namespace boost {
return (false);
}
}
// Depth-first search into the state space of possible sub-graphs
bool continue_iteration =
mcgregor_common_subgraphs_internal
@@ -352,10 +352,10 @@ namespace boost {
if (!continue_iteration) {
return (false);
}
// Restore previous state
if (vertex_stack1.size() > old_graph_size) {
VertexFirst stack_vertex1 = vertex_stack1.top();
VertexSecond stack_vertex2 = get(correspondence_map_1_to_2,
stack_vertex1);
@@ -363,10 +363,10 @@ namespace boost {
// Contract subgraph
put(correspondence_map_1_to_2, stack_vertex1,
graph_traits<GraphSecond>::null_vertex());
put(correspondence_map_2_to_1, stack_vertex2,
graph_traits<GraphFirst>::null_vertex());
vertex_stack1.pop();
}
@@ -401,7 +401,7 @@ namespace boost {
typedef mcgregor_common_subgraph_traits<GraphFirst,
GraphSecond, VertexIndexMapFirst,
VertexIndexMapSecond> SubGraphTraits;
typename SubGraphTraits::correspondence_map_first_to_second_type
correspondence_map_1_to_2(num_vertices(graph1), vindex_map1);
@@ -409,7 +409,7 @@ namespace boost {
put(correspondence_map_1_to_2, vertex1,
graph_traits<GraphSecond>::null_vertex());
}
typename SubGraphTraits::correspondence_map_second_to_first_type
correspondence_map_2_to_1(num_vertices(graph2), vindex_map2);
@@ -420,7 +420,7 @@ namespace boost {
typedef typename graph_traits<GraphFirst>::vertex_descriptor
VertexFirst;
std::stack<VertexFirst> vertex_stack1;
mcgregor_common_subgraphs_internal
@@ -432,7 +432,7 @@ namespace boost {
only_connected_subgraphs,
subgraph_callback);
}
} // namespace detail
// ==========================================================================
@@ -457,7 +457,7 @@ namespace boost {
bool only_connected_subgraphs,
SubGraphCallback user_callback)
{
detail::mcgregor_common_subgraphs_internal_init
(graph1, graph2,
vindex_map1, vindex_map2,
@@ -465,7 +465,7 @@ namespace boost {
only_connected_subgraphs,
user_callback);
}
// Variant of mcgregor_common_subgraphs with all default parameters
template <typename GraphFirst,
typename GraphSecond,
@@ -476,7 +476,7 @@ namespace boost {
bool only_connected_subgraphs,
SubGraphCallback user_callback)
{
detail::mcgregor_common_subgraphs_internal_init
(graph1, graph2,
get(vertex_index, graph1), get(vertex_index, graph2),
@@ -498,7 +498,7 @@ namespace boost {
SubGraphCallback user_callback,
const bgl_named_params<Param, Tag, Rest>& params)
{
detail::mcgregor_common_subgraphs_internal_init
(graph1, graph2,
choose_const_pmap(get_param(params, vertex_index1),
@@ -532,7 +532,7 @@ namespace boost {
typedef mcgregor_common_subgraph_traits<GraphFirst, GraphSecond,
VertexIndexMapFirst, VertexIndexMapSecond> SubGraphTraits;
typedef typename SubGraphTraits::correspondence_map_first_to_second_type
CachedCorrespondenceMapFirstToSecond;
@@ -542,19 +542,19 @@ namespace boost {
typedef std::pair<VertexSizeFirst,
std::pair<CachedCorrespondenceMapFirstToSecond,
CachedCorrespondenceMapSecondToFirst> > SubGraph;
typedef std::vector<SubGraph> SubGraphList;
unique_subgraph_interceptor(const GraphFirst& graph1,
const GraphSecond& graph2,
const VertexIndexMapFirst vindex_map1,
const VertexIndexMapSecond vindex_map2,
SubGraphCallback user_callback) :
SubGraphCallback user_callback) :
m_graph1(graph1), m_graph2(graph2),
m_vindex_map1(vindex_map1), m_vindex_map2(vindex_map2),
m_subgraphs(make_shared<SubGraphList>()),
m_user_callback(user_callback) { }
template <typename CorrespondenceMapFirstToSecond,
typename CorrespondenceMapSecondToFirst>
bool operator()(CorrespondenceMapFirstToSecond correspondence_map_1_to_2,
@@ -572,16 +572,16 @@ namespace boost {
if (subgraph_size != subgraph_cached.first) {
continue;
}
if (!are_property_maps_different(correspondence_map_1_to_2,
subgraph_cached.second.first,
m_graph1)) {
// New subgraph is a duplicate
return (true);
}
}
// Subgraph is unique, so make a cached copy
CachedCorrespondenceMapFirstToSecond
new_subgraph_1_to_2 = CachedCorrespondenceMapFirstToSecond
@@ -602,21 +602,21 @@ namespace boost {
m_subgraphs->push_back(std::make_pair(subgraph_size,
std::make_pair(new_subgraph_1_to_2,
new_subgraph_2_to_1)));
return (m_user_callback(correspondence_map_1_to_2,
correspondence_map_2_to_1,
subgraph_size));
}
private:
const GraphFirst& m_graph1;
const GraphFirst& m_graph2;
const VertexIndexMapFirst m_vindex_map1;
const VertexIndexMapSecond m_vindex_map2;
shared_ptr<SubGraphList> m_subgraphs;
std::shared_ptr<SubGraphList> m_subgraphs;
SubGraphCallback m_user_callback;
};
} // namespace detail
// Enumerates all unique common subgraphs between graph1 and graph2.
@@ -645,7 +645,7 @@ namespace boost {
(graph1, graph2,
vindex_map1, vindex_map2,
user_callback);
detail::mcgregor_common_subgraphs_internal_init
(graph1, graph2,
vindex_map1, vindex_map2,
@@ -717,7 +717,7 @@ namespace boost {
typedef mcgregor_common_subgraph_traits<GraphFirst, GraphSecond,
VertexIndexMapFirst, VertexIndexMapSecond> SubGraphTraits;
typedef typename SubGraphTraits::correspondence_map_first_to_second_type
CachedCorrespondenceMapFirstToSecond;
@@ -753,7 +753,7 @@ namespace boost {
}
if (subgraph_size == *m_largest_size_so_far) {
// Make a cached copy
CachedCorrespondenceMapFirstToSecond
new_subgraph_1_to_2 = CachedCorrespondenceMapFirstToSecond
@@ -797,11 +797,11 @@ namespace boost {
const GraphFirst& m_graph2;
const VertexIndexMapFirst m_vindex_map1;
const VertexIndexMapSecond m_vindex_map2;
shared_ptr<SubGraphList> m_subgraphs;
shared_ptr<VertexSizeFirst> m_largest_size_so_far;
std::shared_ptr<SubGraphList> m_subgraphs;
std::shared_ptr<VertexSizeFirst> m_largest_size_so_far;
SubGraphCallback m_user_callback;
};
} // namespace detail
// Enumerates the largest common subgraphs found between graph1
@@ -828,7 +828,7 @@ namespace boost {
VertexIndexMapFirst, VertexIndexMapSecond, SubGraphCallback>
max_interceptor
(graph1, graph2, vindex_map1, vindex_map2, user_callback);
detail::mcgregor_common_subgraphs_internal_init
(graph1, graph2,
vindex_map1, vindex_map2,
@@ -903,7 +903,7 @@ namespace boost {
typedef mcgregor_common_subgraph_traits<GraphFirst, GraphSecond,
VertexIndexMapFirst, VertexIndexMapSecond> SubGraphTraits;
typedef typename SubGraphTraits::correspondence_map_first_to_second_type
CachedCorrespondenceMapFirstToSecond;
@@ -920,13 +920,13 @@ namespace boost {
const GraphSecond& graph2,
const VertexIndexMapFirst vindex_map1,
const VertexIndexMapSecond vindex_map2,
SubGraphCallback user_callback) :
SubGraphCallback user_callback) :
m_graph1(graph1), m_graph2(graph2),
m_vindex_map1(vindex_map1), m_vindex_map2(vindex_map2),
m_subgraphs(make_shared<SubGraphList>()),
m_largest_size_so_far(make_shared<VertexSizeFirst>(0)),
m_user_callback(user_callback) { }
m_user_callback(user_callback) { }
template <typename CorrespondenceMapFirstToSecond,
typename CorrespondenceMapSecondToFirst>
bool operator()(CorrespondenceMapFirstToSecond correspondence_map_1_to_2,
@@ -945,18 +945,18 @@ namespace boost {
subgraph_iter = m_subgraphs->begin();
subgraph_iter != m_subgraphs->end();
++subgraph_iter) {
SubGraph subgraph_cached = *subgraph_iter;
if (!are_property_maps_different(correspondence_map_1_to_2,
subgraph_cached.second.first,
m_graph1)) {
// New subgraph is a duplicate
return (true);
}
}
// Subgraph is unique, so make a cached copy
CachedCorrespondenceMapFirstToSecond
new_subgraph_1_to_2 = CachedCorrespondenceMapFirstToSecond
@@ -978,7 +978,7 @@ namespace boost {
std::make_pair(new_subgraph_1_to_2,
new_subgraph_2_to_1)));
}
return (true);
}
@@ -994,17 +994,17 @@ namespace boost {
subgraph_cached.first);
}
}
private:
const GraphFirst& m_graph1;
const GraphFirst& m_graph2;
const VertexIndexMapFirst m_vindex_map1;
const VertexIndexMapSecond m_vindex_map2;
shared_ptr<SubGraphList> m_subgraphs;
shared_ptr<VertexSizeFirst> m_largest_size_so_far;
std::shared_ptr<SubGraphList> m_subgraphs;
std::shared_ptr<VertexSizeFirst> m_largest_size_so_far;
SubGraphCallback m_user_callback;
};
} // namespace detail
// Enumerates the largest, unique common subgraphs found between
@@ -1031,7 +1031,7 @@ namespace boost {
VertexIndexMapFirst, VertexIndexMapSecond, SubGraphCallback>
unique_max_interceptor
(graph1, graph2, vindex_map1, vindex_map2, user_callback);
detail::mcgregor_common_subgraphs_internal_init
(graph1, graph2,
vindex_map1, vindex_map2,
@@ -1122,7 +1122,7 @@ namespace boost {
// Returns a filtered sub-graph of graph whose edge and vertex
// inclusion is dictated by membership_map.
template <typename Graph,
typename MembershipMap>
typename MembershipMap>
typename membership_filtered_graph_traits<Graph, MembershipMap>::graph_type
make_membership_filtered_graph
(const Graph& graph,
@@ -1134,9 +1134,9 @@ namespace boost {
typename MFGTraits::vertex_filter_type v_filter(membership_map);
return (MembershipFilteredGraph(graph, keep_all(), v_filter));
}
} // namespace boost
#endif // BOOST_GRAPH_MCGREGOR_COMMON_SUBGRAPHS_HPP

View File

@@ -28,7 +28,7 @@
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/concept_check.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_as_tree.hpp>

View File

@@ -21,7 +21,7 @@
#include <boost/assert.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <typeinfo>
namespace boost { namespace parallel {
@@ -86,13 +86,13 @@ public:
size_type block_size(process_id_type id, size_type n) const
{ return distribution_->block_size(id, n); }
process_id_type operator()(size_type i) const
{ return distribution_->in_process(i); }
size_type local(size_type i) const
{ return distribution_->local(i); }
size_type global(size_type n) const
{ return distribution_->global(n); }
@@ -122,13 +122,13 @@ public:
}
private:
shared_ptr<basic_distribution> distribution_;
std::shared_ptr<basic_distribution> distribution_;
};
struct block
{
template<typename LinearProcessGroup>
explicit block(const LinearProcessGroup& pg, std::size_t n)
explicit block(const LinearProcessGroup& pg, std::size_t n)
: id(process_id(pg)), p(num_processes(pg)), n(n) { }
// If there are n elements in the distributed data structure, returns the number of elements stored locally.
@@ -144,7 +144,7 @@ struct block
// Returns the processor on which element with global index i is stored
template<typename SizeType>
SizeType operator()(SizeType i) const
{
{
SizeType cutoff_processor = n % p;
SizeType cutoff = cutoff_processor * (n / p + 1);
@@ -165,7 +165,7 @@ struct block
// Find the local index for the ith global element
template<typename SizeType>
SizeType local(SizeType i) const
{
{
SizeType owner = (*this)(i);
return i - start(owner);
}
@@ -192,9 +192,9 @@ struct uneven_block
typedef std::vector<std::size_t> size_vector;
template<typename LinearProcessGroup>
explicit uneven_block(const LinearProcessGroup& pg, const std::vector<std::size_t>& local_sizes)
explicit uneven_block(const LinearProcessGroup& pg, const std::vector<std::size_t>& local_sizes)
: id(process_id(pg)), p(num_processes(pg)), local_sizes(local_sizes)
{
{
BOOST_ASSERT(local_sizes.size() == p);
local_starts.resize(p + 1);
local_starts[0] = 0;
@@ -204,7 +204,7 @@ struct uneven_block
// To do maybe: enter local size in each process and gather in constructor (much handier)
// template<typename LinearProcessGroup>
// explicit uneven_block(const LinearProcessGroup& pg, std::size_t my_local_size)
// explicit uneven_block(const LinearProcessGroup& pg, std::size_t my_local_size)
// If there are n elements in the distributed data structure, returns the number of elements stored locally.
template<typename SizeType>
@@ -227,7 +227,7 @@ struct uneven_block
// Find the starting index for processor with the given id
template<typename ID>
std::size_t start(ID id) const
std::size_t start(ID id) const
{
return local_starts[id];
}
@@ -235,7 +235,7 @@ struct uneven_block
// Find the local index for the ith global element
template<typename SizeType>
SizeType local(SizeType i) const
{
{
SizeType owner = (*this)(i);
return i - start(owner);
}
@@ -264,10 +264,10 @@ struct oned_block_cyclic
template<typename LinearProcessGroup>
explicit oned_block_cyclic(const LinearProcessGroup& pg, std::size_t size)
: id(process_id(pg)), p(num_processes(pg)), size(size) { }
template<typename SizeType>
SizeType block_size(SizeType n) const
{
{
return block_size(id, n);
}
@@ -279,20 +279,20 @@ struct oned_block_cyclic
SizeType everyone_gets = all_blocks / p;
SizeType extra_blocks = all_blocks % p;
SizeType my_blocks = everyone_gets + (p < extra_blocks? 1 : 0);
SizeType my_elements = my_blocks * size
SizeType my_elements = my_blocks * size
+ (p == extra_blocks? extra_elements : 0);
return my_elements;
}
template<typename SizeType>
SizeType operator()(SizeType i) const
{
{
return (i / size) % p;
}
template<typename SizeType>
SizeType local(SizeType i) const
{
{
return ((i / size) / p) * size + i % size;
}
@@ -302,7 +302,7 @@ struct oned_block_cyclic
template<typename ProcessID, typename SizeType>
SizeType global(ProcessID id, SizeType i) const
{
{
return ((i / size) * p + id) * size + i % size;
}
@@ -318,14 +318,14 @@ struct twod_block_cyclic
explicit twod_block_cyclic(const LinearProcessGroup& pg,
std::size_t block_rows, std::size_t block_columns,
std::size_t data_columns_per_row)
: id(process_id(pg)), p(num_processes(pg)),
block_rows(block_rows), block_columns(block_columns),
: id(process_id(pg)), p(num_processes(pg)),
block_rows(block_rows), block_columns(block_columns),
data_columns_per_row(data_columns_per_row)
{ }
template<typename SizeType>
SizeType block_size(SizeType n) const
{
{
return block_size(id, n);
}
@@ -346,7 +346,7 @@ struct twod_block_cyclic
template<typename SizeType>
SizeType operator()(SizeType i) const
{
{
SizeType result = get_block_num(i) % p;
// std::cerr << "Item " << i << " goes on processor " << result << std::endl;
return result;
@@ -354,7 +354,7 @@ struct twod_block_cyclic
template<typename SizeType>
SizeType local(SizeType i) const
{
{
// Compute the start of the block
std::size_t block_num = get_block_num(i);
// std::cerr << "Item " << i << " is in block #" << block_num << std::endl;
@@ -362,11 +362,11 @@ struct twod_block_cyclic
std::size_t local_block_num = block_num / p;
std::size_t block_start = local_block_num * block_rows * block_columns;
// Compute the offset into the block
// Compute the offset into the block
std::size_t data_row = i / data_columns_per_row;
std::size_t data_col = i % data_columns_per_row;
std::size_t block_offset = (data_row % block_rows) * block_columns
+ (data_col % block_columns);
std::size_t block_offset = (data_row % block_rows) * block_columns
+ (data_col % block_columns);
// std::cerr << "Item " << i << " maps to local index " << block_start+block_offset << std::endl;
return block_start + block_offset;
@@ -374,7 +374,7 @@ struct twod_block_cyclic
template<typename SizeType>
SizeType global(SizeType i) const
{
{
// Compute the (global) block in which this element resides
SizeType local_block_num = i / (block_rows * block_columns);
SizeType block_offset = i % (block_rows * block_columns);
@@ -401,7 +401,7 @@ struct twod_block_cyclic
+ row_in_block * block_rows + col_in_block;
std::cerr << "global(" << i << "@" << id << ") = " << result
std::cerr << "global(" << i << "@" << id << ") = " << result
<< " =? " << local(result) << std::endl;
BOOST_ASSERT(i == local(result));
return result;
@@ -444,7 +444,7 @@ class twod_random
private:
RandomNumberGen& gen;
};
public:
template<typename LinearProcessGroup, typename RandomNumberGen>
explicit twod_random(const LinearProcessGroup& pg,
@@ -452,11 +452,11 @@ class twod_random
std::size_t data_columns_per_row,
std::size_t n,
RandomNumberGen& gen)
: id(process_id(pg)), p(num_processes(pg)),
block_rows(block_rows), block_columns(block_columns),
: id(process_id(pg)), p(num_processes(pg)),
block_rows(block_rows), block_columns(block_columns),
data_columns_per_row(data_columns_per_row),
global_to_local(n / (block_rows * block_columns))
{
{
std::copy(make_counting_iterator(std::size_t(0)),
make_counting_iterator(global_to_local.size()),
global_to_local.begin());
@@ -464,10 +464,10 @@ class twod_random
random_int<RandomNumberGen> rand(gen);
std::random_shuffle(global_to_local.begin(), global_to_local.end(), rand);
}
template<typename SizeType>
SizeType block_size(SizeType n) const
{
{
return block_size(id, n);
}
@@ -488,7 +488,7 @@ class twod_random
template<typename SizeType>
SizeType operator()(SizeType i) const
{
{
SizeType result = get_block_num(i) % p;
// std::cerr << "Item " << i << " goes on processor " << result << std::endl;
return result;
@@ -496,7 +496,7 @@ class twod_random
template<typename SizeType>
SizeType local(SizeType i) const
{
{
// Compute the start of the block
std::size_t block_num = get_block_num(i);
// std::cerr << "Item " << i << " is in block #" << block_num << std::endl;
@@ -504,11 +504,11 @@ class twod_random
std::size_t local_block_num = block_num / p;
std::size_t block_start = local_block_num * block_rows * block_columns;
// Compute the offset into the block
// Compute the offset into the block
std::size_t data_row = i / data_columns_per_row;
std::size_t data_col = i % data_columns_per_row;
std::size_t block_offset = (data_row % block_rows) * block_columns
+ (data_col % block_columns);
std::size_t block_offset = (data_row % block_rows) * block_columns
+ (data_col % block_columns);
// std::cerr << "Item " << i << " maps to local index " << block_start+block_offset << std::endl;
return block_start + block_offset;
@@ -552,7 +552,7 @@ class random_distribution
private:
RandomNumberGen& gen;
};
public:
template<typename LinearProcessGroup, typename RandomNumberGen>
random_distribution(const LinearProcessGroup& pg, RandomNumberGen& gen,
@@ -565,7 +565,7 @@ class random_distribution
random_int<RandomNumberGen> rand(gen);
std::random_shuffle(local_to_global.begin(), local_to_global.end(), rand);
for (std::vector<std::size_t>::size_type i = 0; i < n; ++i)
global_to_local[local_to_global[i]] = i;
@@ -587,19 +587,19 @@ class random_distribution
template<typename SizeType>
SizeType local(SizeType i) const
{
{
return base.local(global_to_local[i]);
}
template<typename ProcessID, typename SizeType>
SizeType global(ProcessID p, SizeType i) const
{
{
return local_to_global[base.global(p, i)];
}
template<typename SizeType>
SizeType global(SizeType i) const
{
{
return local_to_global[base.global(i)];
}

View File

@@ -12,7 +12,7 @@
#include <list>
#include <boost/graph/graph_traits.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
// A "face handle" is an optimization meant to serve two purposes in
@@ -26,7 +26,7 @@
// sequence of edges. The functions first_vertex/second_vertex and
// first_edge/second_edge allow fast access to the beginning and end of the
// stored sequence, which allows one to traverse the outer face of the partial
// planar embedding as it's being created.
// planar embedding as it's being created.
//
// There are some policies below that define the contents of the face handles:
// in the case no embedding is needed (for example, if one just wants to use
@@ -48,7 +48,7 @@ namespace boost { namespace graph { namespace detail {
//face handle policies
//EmbeddingStorage policy
struct store_embedding {};
struct recursive_lazy_list : public store_embedding {};
@@ -65,14 +65,14 @@ namespace boost { namespace graph { namespace detail {
template<typename DataType>
struct lazy_list_node
{
typedef shared_ptr< lazy_list_node<DataType> > ptr_t;
typedef std::shared_ptr< lazy_list_node<DataType> > ptr_t;
lazy_list_node(const DataType& data) :
m_reversed(false),
m_data(data),
m_has_data(true)
{}
lazy_list_node(ptr_t left_child, ptr_t right_child) :
m_reversed(false),
m_has_data(false),
@@ -83,10 +83,10 @@ namespace boost { namespace graph { namespace detail {
bool m_reversed;
DataType m_data;
bool m_has_data;
shared_ptr<lazy_list_node> m_left_child;
shared_ptr<lazy_list_node> m_right_child;
std::shared_ptr<lazy_list_node> m_left_child;
std::shared_ptr<lazy_list_node> m_right_child;
};
template <typename StoreOldHandlesPolicy, typename Vertex, typename Edge>
@@ -139,7 +139,7 @@ namespace boost { namespace graph { namespace detail {
struct edge_list_storage<recursive_lazy_list, Edge>
{
typedef lazy_list_node<Edge> node_type;
typedef shared_ptr< node_type > type;
typedef std::shared_ptr< node_type > type;
type value;
void push_back(Edge e)
@@ -178,17 +178,17 @@ namespace boost { namespace graph { namespace detail {
private:
template <typename OutputIterator>
void get_list_helper(OutputIterator o_itr,
void get_list_helper(OutputIterator o_itr,
type root,
bool flipped = false
)
{
if (!root)
return;
if (root->m_has_data)
*o_itr = root->m_data;
if ((flipped && !root->m_reversed) ||
(!flipped && root->m_reversed)
)
@@ -201,9 +201,9 @@ namespace boost { namespace graph { namespace detail {
get_list_helper(o_itr, root->m_left_child, false);
get_list_helper(o_itr, root->m_right_child, false);
}
}
};
@@ -254,20 +254,20 @@ namespace boost { namespace graph { namespace detail {
template<typename Graph,
typename StoreOldHandlesPolicy,
typename StoreEmbeddingPolicy
template<typename Graph,
typename StoreOldHandlesPolicy,
typename StoreEmbeddingPolicy
>
struct face_handle_impl
{
typedef typename graph_traits<Graph>::vertex_descriptor vertex_t;
typedef typename graph_traits<Graph>::edge_descriptor edge_t;
typedef typename edge_list_storage<StoreEmbeddingPolicy, edge_t>::type
typedef typename edge_list_storage<StoreEmbeddingPolicy, edge_t>::type
edge_list_storage_t;
face_handle_impl() :
face_handle_impl() :
cached_first_vertex(graph_traits<Graph>::null_vertex()),
cached_second_vertex(graph_traits<Graph>::null_vertex()),
true_first_vertex(graph_traits<Graph>::null_vertex()),
@@ -308,11 +308,11 @@ namespace boost { namespace graph { namespace detail {
template <typename Graph,
typename StoreOldHandlesPolicy = store_old_handles,
template <typename Graph,
typename StoreOldHandlesPolicy = store_old_handles,
typename StoreEmbeddingPolicy = recursive_lazy_list
>
class face_handle
class face_handle
{
public:
typedef typename graph_traits<Graph>::vertex_descriptor vertex_t;
@@ -347,19 +347,19 @@ namespace boost { namespace graph { namespace detail {
}
//default copy construction, assignment okay.
void push_first(edge_t e, const Graph& g)
{
void push_first(edge_t e, const Graph& g)
{
pimpl->edge_list.push_front(e);
pimpl->cached_first_vertex = pimpl->true_first_vertex =
pimpl->cached_first_vertex = pimpl->true_first_vertex =
source(e, g) == pimpl->anchor ? target(e,g) : source(e,g);
pimpl->cached_first_edge = e;
}
void push_second(edge_t e, const Graph& g)
{
void push_second(edge_t e, const Graph& g)
{
pimpl->edge_list.push_back(e);
pimpl->cached_second_vertex = pimpl->true_second_vertex =
pimpl->cached_second_vertex = pimpl->true_second_vertex =
source(e, g) == pimpl->anchor ? target(e,g) : source(e,g);
pimpl->cached_second_edge = e;
}
@@ -370,22 +370,22 @@ namespace boost { namespace graph { namespace detail {
}
inline vertex_t first_vertex() const
{
{
return pimpl->cached_first_vertex;
}
inline vertex_t second_vertex() const
{
inline vertex_t second_vertex() const
{
return pimpl->cached_second_vertex;
}
inline vertex_t true_first_vertex() const
{
inline vertex_t true_first_vertex() const
{
return pimpl->true_first_vertex;
}
inline vertex_t true_second_vertex() const
{
inline vertex_t true_second_vertex() const
{
return pimpl->true_second_vertex;
}
@@ -413,17 +413,17 @@ namespace boost { namespace graph { namespace detail {
{
return pimpl->cached_first_edge;
}
inline edge_t second_edge() const
{
return pimpl->cached_second_edge;
}
inline vertex_t get_anchor() const
{
return pimpl->anchor;
}
void glue_first_to_second
(face_handle<Graph,StoreOldHandlesPolicy,StoreEmbeddingPolicy>& bottom)
{
@@ -432,7 +432,7 @@ namespace boost { namespace graph { namespace detail {
pimpl->cached_first_vertex = bottom.pimpl->cached_first_vertex;
pimpl->cached_first_edge = bottom.pimpl->cached_first_edge;
}
void glue_second_to_first
(face_handle<Graph,StoreOldHandlesPolicy,StoreEmbeddingPolicy>& bottom)
{
@@ -441,7 +441,7 @@ namespace boost { namespace graph { namespace detail {
pimpl->cached_second_vertex = bottom.pimpl->cached_second_vertex;
pimpl->cached_second_edge = bottom.pimpl->cached_second_edge;
}
void flip()
{
pimpl->edge_list.reverse();
@@ -449,7 +449,7 @@ namespace boost { namespace graph { namespace detail {
std::swap(pimpl->cached_first_vertex, pimpl->cached_second_vertex);
std::swap(pimpl->cached_first_edge, pimpl->cached_second_edge);
}
template <typename OutputIterator>
void get_list(OutputIterator o_itr)
{
@@ -481,12 +481,12 @@ namespace boost { namespace graph { namespace detail {
pimpl->old_handles.first_edge = pimpl->cached_first_edge;
pimpl->old_handles.second_edge = pimpl->cached_second_edge;
}
void store_old_face_handles_dispatch(no_old_handles) {}
boost::shared_ptr<impl_t> pimpl;
boost::std::shared_ptr<impl_t> pimpl;
};

View File

@@ -12,7 +12,7 @@
#include <iterator>
#include <utility>
#include <boost/random/uniform_int.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/graph/graph_traits.hpp>
#include <vector>
#include <map>
@@ -21,7 +21,7 @@
namespace boost {
template<typename RandomGenerator>
class out_directed_plod_iterator
class out_directed_plod_iterator
{
public:
typedef std::forward_iterator_tag iterator_category;
@@ -32,10 +32,10 @@ namespace boost {
out_directed_plod_iterator() : gen(0), at_end(true) { }
out_directed_plod_iterator(RandomGenerator& gen, std::size_t n,
double alpha, double beta,
out_directed_plod_iterator(RandomGenerator& gen, std::size_t n,
double alpha, double beta,
bool allow_self_loops)
: gen(&gen), n(n), alpha(alpha), beta(beta),
: gen(&gen), n(n), alpha(alpha), beta(beta),
allow_self_loops(allow_self_loops), at_end(false), degree(0),
current(0, 0)
{
@@ -50,7 +50,7 @@ namespace boost {
pointer operator->() const { return &current; }
out_directed_plod_iterator& operator++()
{
{
using std::pow;
uniform_int<std::size_t> x(0, n-1);
@@ -66,7 +66,7 @@ namespace boost {
}
std::size_t xv = x(*gen);
degree = (xv == 0? 0 : std::size_t(beta * pow(xv, -alpha)));
degree = (xv == 0? 0 : std::size_t(beta * pow(xv, -alpha)));
}
do {
@@ -85,16 +85,16 @@ namespace boost {
}
bool operator==(const out_directed_plod_iterator& other) const
{
return at_end == other.at_end;
{
return at_end == other.at_end;
}
bool operator!=(const out_directed_plod_iterator& other) const
{
return !(*this == other);
{
return !(*this == other);
}
private:
private:
RandomGenerator* gen;
std::size_t n;
double alpha;
@@ -106,7 +106,7 @@ namespace boost {
};
template<typename RandomGenerator>
class undirected_plod_iterator
class undirected_plod_iterator
{
typedef std::vector<std::pair<std::size_t, std::size_t> > out_degrees_t;
@@ -117,11 +117,11 @@ namespace boost {
typedef const value_type* pointer;
typedef std::ptrdiff_t difference_type;
undirected_plod_iterator()
undirected_plod_iterator()
: gen(0), out_degrees(), degrees_left(0), allow_self_loops(false) { }
undirected_plod_iterator(RandomGenerator& gen, std::size_t n,
double alpha, double beta,
undirected_plod_iterator(RandomGenerator& gen, std::size_t n,
double alpha, double beta,
bool allow_self_loops = false)
: gen(&gen), n(n), out_degrees(new out_degrees_t),
degrees_left(0), allow_self_loops(allow_self_loops)
@@ -145,7 +145,7 @@ namespace boost {
pointer operator->() const { return &current; }
undirected_plod_iterator& operator++()
{
{
next();
return *this;
}
@@ -158,8 +158,8 @@ namespace boost {
}
bool operator==(const undirected_plod_iterator& other) const
{
return degrees_left == other.degrees_left;
{
return degrees_left == other.degrees_left;
}
bool operator!=(const undirected_plod_iterator& other) const
@@ -192,7 +192,7 @@ namespace boost {
(*out_degrees)[source] = out_degrees->back();
out_degrees->pop_back();
continue;
}
}
// Select target vertex
target = x(*gen);
@@ -200,7 +200,7 @@ namespace boost {
(*out_degrees)[target] = out_degrees->back();
out_degrees->pop_back();
continue;
} else if (source != target
} else if (source != target
|| (allow_self_loops && (*out_degrees)[source].second > 2)) {
break;
}
@@ -217,7 +217,7 @@ namespace boost {
RandomGenerator* gen;
std::size_t n;
shared_ptr<out_degrees_t> out_degrees;
std::shared_ptr<out_degrees_t> out_degrees;
std::size_t degrees_left;
bool allow_self_loops;
value_type current;
@@ -243,7 +243,7 @@ namespace boost {
public:
plod_iterator() : inherited() { }
plod_iterator(RandomGenerator& gen, std::size_t n,
plod_iterator(RandomGenerator& gen, std::size_t n,
double alpha, double beta, bool allow_self_loops = false)
: inherited(gen, n, alpha, beta, allow_self_loops) { }
};

View File

@@ -15,7 +15,7 @@
#include <vector>
#include <queue>
#include <map>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/assert.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_01.hpp>
@@ -24,7 +24,7 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/test/floating_point_comparison.hpp>
using boost::shared_ptr;
using boost::std::shared_ptr;
using boost::uniform_01;
// Returns floor(log_2(n)), and -1 when n is 0
@@ -76,7 +76,7 @@ generate_permutation_vector(RandomGenerator& gen, std::vector<T>& vertexPermutat
template <typename RandomGenerator, typename T>
std::pair<T,T>
generate_edge(shared_ptr<uniform_01<RandomGenerator> > prob, T n,
generate_edge(std::shared_ptr<uniform_01<RandomGenerator> > prob, T n,
unsigned int SCALE, double a, double b, double c, double d)
{
T u = 0, v = 0;
@@ -213,7 +213,7 @@ namespace boost {
private:
// Parameters
shared_ptr<uniform_01<RandomGenerator> > gen;
std::shared_ptr<uniform_01<RandomGenerator> > gen;
vertices_size_type n;
double a, b, c, d;
int edge;
@@ -328,7 +328,7 @@ namespace boost {
private:
// Parameters
shared_ptr<uniform_01<RandomGenerator> > gen;
std::shared_ptr<uniform_01<RandomGenerator> > gen;
bool permute_vertices;
// Internal data structures
@@ -442,7 +442,7 @@ namespace boost {
private:
// Parameters
shared_ptr<uniform_01<RandomGenerator> > gen;
std::shared_ptr<uniform_01<RandomGenerator> > gen;
// Internal data structures
std::vector<value_type> values;
@@ -576,7 +576,7 @@ namespace boost {
private:
// Parameters
shared_ptr<uniform_01<RandomGenerator> > gen;
std::shared_ptr<uniform_01<RandomGenerator> > gen;
bool bidirectional;
// Internal data structures

View File

@@ -29,10 +29,10 @@ namespace boost {
* Topologies *
***********************************************************/
template<std::size_t Dims>
class convex_topology
class convex_topology
{
public: // For VisualAge C++
struct point
struct point
{
BOOST_STATIC_CONSTANT(std::size_t, dimensions = Dims);
point() { }
@@ -129,7 +129,7 @@ class convex_topology
typedef point point_type;
typedef point_difference point_difference_type;
double distance(point a, point b) const
double distance(point a, point b) const
{
double dist = 0.;
for (std::size_t i = 0; i < Dims; ++i) {
@@ -142,7 +142,7 @@ class convex_topology
return dist;
}
point move_position_toward(point a, double fraction, point b) const
point move_position_toward(point a, double fraction, point b) const
{
point result;
for (std::size_t i = 0; i < Dims; ++i)
@@ -206,15 +206,15 @@ class hypercube_topology : public convex_topology<Dims>
typedef typename convex_topology<Dims>::point_type point_type;
typedef typename convex_topology<Dims>::point_difference_type point_difference_type;
explicit hypercube_topology(double scaling = 1.0)
: gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)),
scaling(scaling)
explicit hypercube_topology(double scaling = 1.0)
: gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)),
scaling(scaling)
{ }
hypercube_topology(RandomNumberGenerator& gen, double scaling = 1.0)
hypercube_topology(RandomNumberGenerator& gen, double scaling = 1.0)
: gen_ptr(), rand(new rand_t(gen)), scaling(scaling) { }
point_type random_point() const
point_type random_point() const
{
point_type p;
for (std::size_t i = 0; i < Dims; ++i)
@@ -268,8 +268,8 @@ class hypercube_topology : public convex_topology<Dims>
}
private:
shared_ptr<RandomNumberGenerator> gen_ptr;
shared_ptr<rand_t> rand;
std::shared_ptr<RandomNumberGenerator> gen_ptr;
std::shared_ptr<rand_t> rand;
double scaling;
};
@@ -280,8 +280,8 @@ class square_topology : public hypercube_topology<2, RandomNumberGenerator>
public:
explicit square_topology(double scaling = 1.0) : inherited(scaling) { }
square_topology(RandomNumberGenerator& gen, double scaling = 1.0)
square_topology(RandomNumberGenerator& gen, double scaling = 1.0)
: inherited(gen, scaling) { }
};
@@ -308,7 +308,7 @@ class rectangle_topology : public convex_topology<2>
typedef typename convex_topology<2>::point_type point_type;
typedef typename convex_topology<2>::point_difference_type point_difference_type;
point_type random_point() const
point_type random_point() const
{
point_type p;
p[0] = (*rand)() * (right - left) + left;
@@ -362,8 +362,8 @@ class rectangle_topology : public convex_topology<2>
}
private:
shared_ptr<RandomNumberGenerator> gen_ptr;
shared_ptr<rand_t> rand;
std::shared_ptr<RandomNumberGenerator> gen_ptr;
std::shared_ptr<rand_t> rand;
double left, top, right, bottom;
};
@@ -374,8 +374,8 @@ class cube_topology : public hypercube_topology<3, RandomNumberGenerator>
public:
explicit cube_topology(double scaling = 1.0) : inherited(scaling) { }
cube_topology(RandomNumberGenerator& gen, double scaling = 1.0)
cube_topology(RandomNumberGenerator& gen, double scaling = 1.0)
: inherited(gen, scaling) { }
};
@@ -389,15 +389,15 @@ class ball_topology : public convex_topology<Dims>
typedef typename convex_topology<Dims>::point_type point_type;
typedef typename convex_topology<Dims>::point_difference_type point_difference_type;
explicit ball_topology(double radius = 1.0)
: gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)),
radius(radius)
explicit ball_topology(double radius = 1.0)
: gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)),
radius(radius)
{ }
ball_topology(RandomNumberGenerator& gen, double radius = 1.0)
ball_topology(RandomNumberGenerator& gen, double radius = 1.0)
: gen_ptr(), rand(new rand_t(gen)), radius(radius) { }
point_type random_point() const
point_type random_point() const
{
point_type p;
double dist_sum;
@@ -457,8 +457,8 @@ class ball_topology : public convex_topology<Dims>
}
private:
shared_ptr<RandomNumberGenerator> gen_ptr;
shared_ptr<rand_t> rand;
std::shared_ptr<RandomNumberGenerator> gen_ptr;
std::shared_ptr<rand_t> rand;
double radius;
};
@@ -469,8 +469,8 @@ class circle_topology : public ball_topology<2, RandomNumberGenerator>
public:
explicit circle_topology(double radius = 1.0) : inherited(radius) { }
circle_topology(RandomNumberGenerator& gen, double radius = 1.0)
circle_topology(RandomNumberGenerator& gen, double radius = 1.0)
: inherited(gen, radius) { }
};
@@ -481,13 +481,13 @@ class sphere_topology : public ball_topology<3, RandomNumberGenerator>
public:
explicit sphere_topology(double radius = 1.0) : inherited(radius) { }
sphere_topology(RandomNumberGenerator& gen, double radius = 1.0)
sphere_topology(RandomNumberGenerator& gen, double radius = 1.0)
: inherited(gen, radius) { }
};
template<typename RandomNumberGenerator = minstd_rand>
class heart_topology
class heart_topology
{
// Heart is defined as the union of three shapes:
// Square w/ corners (+-1000, -1000), (0, 0), (0, -2000)
@@ -495,7 +495,7 @@ class heart_topology
// Circle centered at (500, -500) radius 500*sqrt(2)
// Bounding box (-1000, -2000) - (1000, 500*(sqrt(2) - 1))
struct point
struct point
{
point() { values[0] = 0.0; values[1] = 0.0; }
point(double x, double y) { values[0] = x; values[1] = y; }
@@ -507,7 +507,7 @@ class heart_topology
double values[2];
};
bool in_heart(point p) const
bool in_heart(point p) const
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::abs;
@@ -522,7 +522,7 @@ class heart_topology
return false;
}
bool segment_within_heart(point p1, point p2) const
bool segment_within_heart(point p1, point p2) const
{
// Assumes that p1 and p2 are within the heart
if ((p1[0] < 0) == (p2[0] < 0)) return true; // Same side of symmetry line
@@ -538,13 +538,13 @@ class heart_topology
public:
typedef point point_type;
heart_topology()
heart_topology()
: gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)) { }
heart_topology(RandomNumberGenerator& gen)
heart_topology(RandomNumberGenerator& gen)
: gen_ptr(), rand(new rand_t(gen)) { }
point random_point() const
point random_point() const
{
point result;
do {
@@ -556,7 +556,7 @@ class heart_topology
// Not going to provide clipping to bounding region or distance from boundary
double distance(point a, point b) const
double distance(point a, point b) const
{
if (segment_within_heart(a, b)) {
// Straight line
@@ -567,7 +567,7 @@ class heart_topology
}
}
point move_position_toward(point a, double fraction, point b) const
point move_position_toward(point a, double fraction, point b) const
{
if (segment_within_heart(a, b)) {
// Straight line
@@ -576,10 +576,10 @@ class heart_topology
} else {
double distance_to_point_a = boost::math::hypot(a[0], a[1]);
double distance_to_point_b = boost::math::hypot(b[0], b[1]);
double location_of_point = distance_to_point_a /
double location_of_point = distance_to_point_a /
(distance_to_point_a + distance_to_point_b);
if (fraction < location_of_point)
return point(a[0] * (1 - fraction / location_of_point),
return point(a[0] * (1 - fraction / location_of_point),
a[1] * (1 - fraction / location_of_point));
else
return point(
@@ -589,8 +589,8 @@ class heart_topology
}
private:
shared_ptr<RandomNumberGenerator> gen_ptr;
shared_ptr<rand_t> rand;
std::shared_ptr<RandomNumberGenerator> gen_ptr;
std::shared_ptr<rand_t> rand;
};
} // namespace boost

View File

@@ -393,7 +393,7 @@ template<class T, class VoidPointer>
class intrusive_ptr;
template<class T, class VoidAllocator, class Deleter>
class shared_ptr;
class std::shared_ptr;
template<class T, class VoidAllocator, class Deleter>
class weak_ptr;

View File

@@ -19,7 +19,7 @@
#include <boost/assert.hpp>
#include <boost/interprocess/smart_ptr/weak_ptr.hpp>
#include <boost/interprocess/smart_ptr/shared_ptr.hpp>
#include <boost/interprocess/smart_ptr/std::shared_ptr.hpp>
//!\file
//!Describes an utility to form a shared pointer from this
@@ -27,10 +27,10 @@
namespace boost{
namespace interprocess{
//!This class is used as a base class that allows a shared_ptr to the current
//!This class is used as a base class that allows a std::shared_ptr to the current
//!object to be obtained from within a member function.
//!enable_shared_from_this defines two member functions called shared_from_this
//!that return a shared_ptr<T> and shared_ptr<T const>, depending on constness, to this.
//!that return a std::shared_ptr<T> and std::shared_ptr<T const>, depending on constness, to this.
template<class T, class A, class D>
class enable_shared_from_this
{
@@ -50,16 +50,16 @@ class enable_shared_from_this
/// @endcond
public:
shared_ptr<T, A, D> shared_from_this()
std::shared_ptr<T, A, D> shared_from_this()
{
shared_ptr<T, A, D> p(_internal_weak_this);
std::shared_ptr<T, A, D> p(_internal_weak_this);
BOOST_ASSERT(ipcdetail::to_raw_pointer(p.get()) == this);
return p;
}
shared_ptr<T const, A, D> shared_from_this() const
std::shared_ptr<T const, A, D> shared_from_this() const
{
shared_ptr<T const, A, D> p(_internal_weak_this);
std::shared_ptr<T const, A, D> p(_internal_weak_this);
BOOST_ASSERT(ipcdetail::to_raw_pointer(p.get()) == this);
return p;
}

View File

@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
// This file is the adaptation for Interprocess of boost/shared_ptr.hpp
// This file is the adaptation for Interprocess of boost/std::shared_ptr.hpp
//
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// (C) Copyright Peter Dimov 2001, 2002, 2003
@@ -37,7 +37,7 @@
#include <iosfwd> // for std::basic_ostream
//!\file
//!Describes the smart pointer shared_ptr
//!Describes the smart pointer std::shared_ptr
namespace boost{
namespace interprocess{
@@ -66,11 +66,11 @@ inline void sp_enable_shared_from_this(shared_count<T, VoidAllocator, Deleter> c
} // namespace ipcdetail
//!shared_ptr stores a pointer to a dynamically allocated object.
//!The object pointed to is guaranteed to be deleted when the last shared_ptr pointing to
//!std::shared_ptr stores a pointer to a dynamically allocated object.
//!The object pointed to is guaranteed to be deleted when the last std::shared_ptr pointing to
//!it is destroyed or reset.
//!
//!shared_ptr is parameterized on
//!std::shared_ptr is parameterized on
//!T (the type of the object pointed to), VoidAllocator (the void allocator to be used
//!to allocate the auxiliary data) and Deleter (the deleter whose
//!operator() will be used to delete the object.
@@ -79,18 +79,18 @@ inline void sp_enable_shared_from_this(shared_count<T, VoidAllocator, Deleter> c
//!VoidAllocator::pointer type (that is, if typename VoidAllocator::pointer is
//!offset_ptr<void>, the internal pointer will be offset_ptr<T>).
//!
//!Because the implementation uses reference counting, cycles of shared_ptr
//!Because the implementation uses reference counting, cycles of std::shared_ptr
//!instances will not be reclaimed. For example, if main() holds a
//!shared_ptr to A, which directly or indirectly holds a shared_ptr back
//!to A, A's use count will be 2. Destruction of the original shared_ptr
//!std::shared_ptr to A, which directly or indirectly holds a std::shared_ptr back
//!to A, A's use count will be 2. Destruction of the original std::shared_ptr
//!will leave A dangling with a use count of 1.
//!Use weak_ptr to "break cycles."
template<class T, class VoidAllocator, class Deleter>
class shared_ptr
class std::shared_ptr
{
/// @cond
private:
typedef shared_ptr<T, VoidAllocator, Deleter> this_type;
typedef std::shared_ptr<T, VoidAllocator, Deleter> this_type;
/// @endcond
public:
@@ -111,19 +111,19 @@ class shared_ptr
pointer_traits<typename VoidAllocator::pointer>::template
rebind_pointer<const VoidAllocator>::type const_allocator_pointer;
BOOST_COPYABLE_AND_MOVABLE(shared_ptr)
BOOST_COPYABLE_AND_MOVABLE(std::shared_ptr)
public:
//!Constructs an empty shared_ptr.
//!Constructs an empty std::shared_ptr.
//!Use_count() == 0 && get()== 0.
shared_ptr()
std::shared_ptr()
: m_pn() // never throws
{}
//!Constructs a shared_ptr that owns the pointer p. Auxiliary data will be allocated
//!Constructs a std::shared_ptr that owns the pointer p. Auxiliary data will be allocated
//!with a copy of a and the object will be deleted with a copy of d.
//!Requirements: Deleter and A's copy constructor must not throw.
explicit shared_ptr(const pointer&p, const VoidAllocator &a = VoidAllocator(), const Deleter &d = Deleter())
explicit std::shared_ptr(const pointer&p, const VoidAllocator &a = VoidAllocator(), const Deleter &d = Deleter())
: m_pn(p, a, d)
{
//Check that the pointer passed is of the same type that
@@ -137,55 +137,55 @@ class shared_ptr
ipcdetail::sp_enable_shared_from_this<T, VoidAllocator, Deleter>( m_pn, ipcdetail::to_raw_pointer(p), ipcdetail::to_raw_pointer(p) );
}
//!Copy constructs a shared_ptr. If r is empty, constructs an empty shared_ptr. Otherwise, constructs
//!a shared_ptr that shares ownership with r. Never throws.
shared_ptr(const shared_ptr &r)
//!Copy constructs a std::shared_ptr. If r is empty, constructs an empty std::shared_ptr. Otherwise, constructs
//!a std::shared_ptr that shares ownership with r. Never throws.
std::shared_ptr(const std::shared_ptr &r)
: m_pn(r.m_pn) // never throws
{}
//!Constructs a shared_ptr that shares ownership with other and stores p.
//!Constructs a std::shared_ptr that shares ownership with other and stores p.
//!Postconditions: get() == p && use_count() == r.use_count().
//!Throws: nothing.
shared_ptr(const shared_ptr &other, const pointer &p)
std::shared_ptr(const std::shared_ptr &other, const pointer &p)
: m_pn(other.m_pn, p)
{}
//!If r is empty, constructs an empty shared_ptr. Otherwise, constructs
//!a shared_ptr that shares ownership with r. Never throws.
//!If r is empty, constructs an empty std::shared_ptr. Otherwise, constructs
//!a std::shared_ptr that shares ownership with r. Never throws.
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r)
std::shared_ptr(std::shared_ptr<Y, VoidAllocator, Deleter> const & r)
: m_pn(r.m_pn) // never throws
{}
//!Constructs a shared_ptr that shares ownership with r and stores
//!Constructs a std::shared_ptr that shares ownership with r and stores
//!a copy of the pointer stored in r.
template<class Y>
explicit shared_ptr(weak_ptr<Y, VoidAllocator, Deleter> const & r)
explicit std::shared_ptr(weak_ptr<Y, VoidAllocator, Deleter> const & r)
: m_pn(r.m_pn) // may throw
{}
//!Move-Constructs a shared_ptr that takes ownership of other resource and
//!Move-Constructs a std::shared_ptr that takes ownership of other resource and
//!other is put in default-constructed state.
//!Throws: nothing.
explicit shared_ptr(BOOST_RV_REF(shared_ptr) other)
explicit std::shared_ptr(BOOST_RV_REF(std::shared_ptr) other)
: m_pn()
{ this->swap(other); }
/// @cond
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::static_cast_tag)
std::shared_ptr(std::shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::static_cast_tag)
: m_pn( pointer(static_cast<T*>(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer())))
, r.m_pn)
{}
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::const_cast_tag)
std::shared_ptr(std::shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::const_cast_tag)
: m_pn( pointer(const_cast<T*>(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer())))
, r.m_pn)
{}
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::dynamic_cast_tag)
std::shared_ptr(std::shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::dynamic_cast_tag)
: m_pn( pointer(dynamic_cast<T*>(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer())))
, r.m_pn)
{
@@ -195,26 +195,26 @@ class shared_ptr
}
/// @endcond
//!Equivalent to shared_ptr(r).swap(*this).
//!Equivalent to std::shared_ptr(r).swap(*this).
//!Never throws
template<class Y>
shared_ptr & operator=(shared_ptr<Y, VoidAllocator, Deleter> const & r)
std::shared_ptr & operator=(std::shared_ptr<Y, VoidAllocator, Deleter> const & r)
{
m_pn = r.m_pn; // shared_count::op= doesn't throw
return *this;
}
//!Equivalent to shared_ptr(r).swap(*this).
//!Equivalent to std::shared_ptr(r).swap(*this).
//!Never throws
shared_ptr & operator=(BOOST_COPY_ASSIGN_REF(shared_ptr) r)
std::shared_ptr & operator=(BOOST_COPY_ASSIGN_REF(std::shared_ptr) r)
{
m_pn = r.m_pn; // shared_count::op= doesn't throw
return *this;
}
//!Move-assignment. Equivalent to shared_ptr(other).swap(*this).
//!Move-assignment. Equivalent to std::shared_ptr(other).swap(*this).
//!Never throws
shared_ptr & operator=(BOOST_RV_REF(shared_ptr) other) // never throws
std::shared_ptr & operator=(BOOST_RV_REF(std::shared_ptr) other) // never throws
{
this_type(other).swap(*this);
return *this;
@@ -243,7 +243,7 @@ class shared_ptr
}
template<class Y>
void reset(shared_ptr<Y, VoidAllocator, Deleter> const & r, const pointer &p)
void reset(std::shared_ptr<Y, VoidAllocator, Deleter> const & r, const pointer &p)
{
this_type(r, p).swap(*this);
}
@@ -282,7 +282,7 @@ class shared_ptr
bool unique() const // never throws
{ return m_pn.unique(); }
//!Returns the number of shared_ptr objects, *this included,
//!Returns the number of std::shared_ptr objects, *this included,
//!that share ownership with *this, or an unspecified nonnegative
//!value when *this is empty.
//!use_count() is not necessarily efficient. Use only for
@@ -292,13 +292,13 @@ class shared_ptr
//!Exchanges the contents of the two
//!smart pointers.
void swap(shared_ptr<T, VoidAllocator, Deleter> & other) // never throws
void swap(std::shared_ptr<T, VoidAllocator, Deleter> & other) // never throws
{ m_pn.swap(other.m_pn); }
/// @cond
template<class T2, class A2, class Deleter2>
bool _internal_less(shared_ptr<T2, A2, Deleter2> const & rhs) const
bool _internal_less(std::shared_ptr<T2, A2, Deleter2> const & rhs) const
{ return m_pn < rhs.m_pn; }
const_deleter_pointer get_deleter() const
@@ -309,50 +309,50 @@ class shared_ptr
private:
template<class T2, class A2, class Deleter2> friend class shared_ptr;
template<class T2, class A2, class Deleter2> friend class std::shared_ptr;
template<class T2, class A2, class Deleter2> friend class weak_ptr;
ipcdetail::shared_count<T, VoidAllocator, Deleter> m_pn; // reference counter
/// @endcond
}; // shared_ptr
}; // std::shared_ptr
template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
bool operator==(shared_ptr<T, VoidAllocator, Deleter> const & a, shared_ptr<U, VoidAllocator2, Deleter2> const & b)
bool operator==(std::shared_ptr<T, VoidAllocator, Deleter> const & a, std::shared_ptr<U, VoidAllocator2, Deleter2> const & b)
{ return a.get() == b.get(); }
template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
bool operator!=(shared_ptr<T, VoidAllocator, Deleter> const & a, shared_ptr<U, VoidAllocator2, Deleter2> const & b)
bool operator!=(std::shared_ptr<T, VoidAllocator, Deleter> const & a, std::shared_ptr<U, VoidAllocator2, Deleter2> const & b)
{ return a.get() != b.get(); }
template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
bool operator<(shared_ptr<T, VoidAllocator, Deleter> const & a, shared_ptr<U, VoidAllocator2, Deleter2> const & b)
bool operator<(std::shared_ptr<T, VoidAllocator, Deleter> const & a, std::shared_ptr<U, VoidAllocator2, Deleter2> const & b)
{ return a._internal_less(b); }
template<class T, class VoidAllocator, class Deleter> inline
void swap(shared_ptr<T, VoidAllocator, Deleter> & a, shared_ptr<T, VoidAllocator, Deleter> & b)
void swap(std::shared_ptr<T, VoidAllocator, Deleter> & a, std::shared_ptr<T, VoidAllocator, Deleter> & b)
{ a.swap(b); }
template<class T, class VoidAllocator, class Deleter, class U> inline
shared_ptr<T, VoidAllocator, Deleter> static_pointer_cast(shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::static_cast_tag()); }
std::shared_ptr<T, VoidAllocator, Deleter> static_pointer_cast(std::shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return std::shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::static_cast_tag()); }
template<class T, class VoidAllocator, class Deleter, class U> inline
shared_ptr<T, VoidAllocator, Deleter> const_pointer_cast(shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::const_cast_tag()); }
std::shared_ptr<T, VoidAllocator, Deleter> const_pointer_cast(std::shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return std::shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::const_cast_tag()); }
template<class T, class VoidAllocator, class Deleter, class U> inline
shared_ptr<T, VoidAllocator, Deleter> dynamic_pointer_cast(shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::dynamic_cast_tag()); }
std::shared_ptr<T, VoidAllocator, Deleter> dynamic_pointer_cast(std::shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return std::shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::dynamic_cast_tag()); }
// to_raw_pointer() enables boost::mem_fn to recognize shared_ptr
// to_raw_pointer() enables boost::mem_fn to recognize std::shared_ptr
template<class T, class VoidAllocator, class Deleter> inline
T * to_raw_pointer(shared_ptr<T, VoidAllocator, Deleter> const & p)
T * to_raw_pointer(std::shared_ptr<T, VoidAllocator, Deleter> const & p)
{ return p.get(); }
// operator<<
template<class E, class T, class Y, class VoidAllocator, class Deleter> inline
std::basic_ostream<E, T> & operator<<
(std::basic_ostream<E, T> & os, shared_ptr<Y, VoidAllocator, Deleter> const & p)
(std::basic_ostream<E, T> & os, std::shared_ptr<Y, VoidAllocator, Deleter> const & p)
{ os << p.get(); return os; }
//!Returns the type of a shared pointer
@@ -364,7 +364,7 @@ struct managed_shared_ptr
{
typedef typename ManagedMemory::template allocator<void>::type void_allocator;
typedef typename ManagedMemory::template deleter<T>::type deleter;
typedef shared_ptr< T, void_allocator, deleter> type;
typedef std::shared_ptr< T, void_allocator, deleter> type;
};
//!Returns an instance of a shared pointer constructed
@@ -407,9 +407,9 @@ inline typename managed_shared_ptr<T, ManagedMemory>::type
/// @cond
#if defined(_MSC_VER) && (_MSC_VER < 1400)
// to_raw_pointer() enables boost::mem_fn to recognize shared_ptr
// to_raw_pointer() enables boost::mem_fn to recognize std::shared_ptr
template<class T, class VoidAllocator, class Deleter> inline
T * to_raw_pointer(boost::interprocess::shared_ptr<T, VoidAllocator, Deleter> const & p)
T * to_raw_pointer(boost::interprocess::std::shared_ptr<T, VoidAllocator, Deleter> const & p)
{ return p.get(); }
#endif

View File

@@ -18,7 +18,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/smart_ptr/shared_ptr.hpp>
#include <boost/interprocess/smart_ptr/std::shared_ptr.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/smart_ptr/deleter.hpp>
@@ -31,13 +31,13 @@ namespace boost{
namespace interprocess{
//!The weak_ptr class template stores a "weak reference" to an object
//!that's already managed by a shared_ptr. To access the object, a weak_ptr
//!can be converted to a shared_ptr using the shared_ptr constructor or the
//!member function lock. When the last shared_ptr to the object goes away
//!and the object is deleted, the attempt to obtain a shared_ptr from the
//!that's already managed by a std::shared_ptr. To access the object, a weak_ptr
//!can be converted to a std::shared_ptr using the std::shared_ptr constructor or the
//!member function lock. When the last std::shared_ptr to the object goes away
//!and the object is deleted, the attempt to obtain a std::shared_ptr from the
//!weak_ptr instances that refer to the deleted object will fail: the constructor
//!will throw an exception of type bad_weak_ptr, and weak_ptr::lock will
//!return an empty shared_ptr.
//!return an empty std::shared_ptr.
//!
//!Every weak_ptr meets the CopyConstructible and Assignable requirements
//!of the C++ Standard Library, and so can be used in standard library containers.
@@ -100,9 +100,9 @@ class weak_ptr
weak_ptr(weak_ptr<Y, A, D> const & r)
: m_pn(r.m_pn) // never throws
{
//Construct a temporary shared_ptr so that nobody
//Construct a temporary std::shared_ptr so that nobody
//can destroy the value while constructing this
const shared_ptr<T, A, D> &ref = r.lock();
const std::shared_ptr<T, A, D> &ref = r.lock();
m_pn.set_pointer(ref.get());
}
@@ -114,7 +114,7 @@ class weak_ptr
//!
//!Throws: nothing.
template<class Y>
weak_ptr(shared_ptr<Y, A, D> const & r)
weak_ptr(std::shared_ptr<Y, A, D> const & r)
: m_pn(r.m_pn) // never throws
{}
@@ -127,9 +127,9 @@ class weak_ptr
template<class Y>
weak_ptr & operator=(weak_ptr<Y, A, D> const & r) // never throws
{
//Construct a temporary shared_ptr so that nobody
//Construct a temporary std::shared_ptr so that nobody
//can destroy the value while constructing this
const shared_ptr<T, A, D> &ref = r.lock();
const std::shared_ptr<T, A, D> &ref = r.lock();
m_pn = r.m_pn;
m_pn.set_pointer(ref.get());
return *this;
@@ -142,30 +142,30 @@ class weak_ptr
//!Notes: The implementation is free to meet the effects (and the
//!implied guarantees) via different means, without creating a temporary.
template<class Y>
weak_ptr & operator=(shared_ptr<Y, A, D> const & r) // never throws
weak_ptr & operator=(std::shared_ptr<Y, A, D> const & r) // never throws
{ m_pn = r.m_pn; return *this; }
//!Returns: expired()? shared_ptr<T>(): shared_ptr<T>(*this).
//!Returns: expired()? std::shared_ptr<T>(): std::shared_ptr<T>(*this).
//!
//!Throws: nothing.
shared_ptr<T, A, D> lock() const // never throws
std::shared_ptr<T, A, D> lock() const // never throws
{
// optimization: avoid throw overhead
if(expired()){
return shared_ptr<element_type, A, D>();
return std::shared_ptr<element_type, A, D>();
}
BOOST_TRY{
return shared_ptr<element_type, A, D>(*this);
return std::shared_ptr<element_type, A, D>(*this);
}
BOOST_CATCH(bad_weak_ptr const &){
// Q: how can we get here?
// A: another thread may have invalidated r after the use_count test above.
return shared_ptr<element_type, A, D>();
return std::shared_ptr<element_type, A, D>();
}
BOOST_CATCH_END
}
//!Returns: 0 if *this is empty; otherwise, the number of shared_ptr objects
//!Returns: 0 if *this is empty; otherwise, the number of std::shared_ptr objects
//!that share ownership with *this.
//!
//!Throws: nothing.
@@ -209,7 +209,7 @@ class weak_ptr
private:
template<class T2, class A2, class D2> friend class shared_ptr;
template<class T2, class A2, class D2> friend class std::shared_ptr;
template<class T2, class A2, class D2> friend class weak_ptr;
ipcdetail::weak_count<T, A, D> m_pn; // reference counter

View File

@@ -22,7 +22,7 @@
#include <stdexcept> // logic_error, out_of_range.
#include <boost/checked_delete.hpp>
#include <boost/config.hpp> // BOOST_MSVC, template friends,
#include <boost/detail/workaround.hpp> // BOOST_NESTED_TEMPLATE
#include <boost/detail/workaround.hpp> // BOOST_NESTED_TEMPLATE
#include <boost/iostreams/constants.hpp>
#include <boost/iostreams/detail/access_control.hpp>
#include <boost/iostreams/detail/char_traits.hpp>
@@ -34,7 +34,7 @@
#include <boost/iostreams/traits.hpp> // is_filter.
#include <boost/iostreams/stream_buffer.hpp>
#include <boost/next_prior.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/static_assert.hpp>
#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
@@ -141,7 +141,7 @@ protected:
chain_base(const chain_base& rhs): pimpl_(rhs.pimpl_) { }
public:
// dual_use is a pseudo-mode to facilitate filter writing,
// dual_use is a pseudo-mode to facilitate filter writing,
// not a genuine mode.
BOOST_STATIC_ASSERT((!is_convertible<mode, dual_use>::value));
@@ -150,19 +150,19 @@ public:
// Sets the size of the buffer created for the devices to be added to this
// chain. Does not affect the size of the buffer for devices already
// added.
void set_device_buffer_size(std::streamsize n)
void set_device_buffer_size(std::streamsize n)
{ pimpl_->device_buffer_size_ = n; }
// Sets the size of the buffer created for the filters to be added
// to this chain. Does not affect the size of the buffer for filters already
// added.
void set_filter_buffer_size(std::streamsize n)
void set_filter_buffer_size(std::streamsize n)
{ pimpl_->filter_buffer_size_ = n; }
// Sets the size of the putback buffer for filters and devices to be added
// to this chain. Does not affect the size of the buffer for filters or
// devices already added.
void set_pback_size(std::streamsize n)
void set_pback_size(std::streamsize n)
{ pimpl_->pback_size_ = n; }
//----------Device interface----------------------------------------------//
@@ -189,7 +189,7 @@ public:
T* component(int n) const { return component(n, boost::type<T>()); }
// Deprecated.
template<int N, typename T>
template<int N, typename T>
T* component() const { return component<T>(N); }
#endif
@@ -230,7 +230,7 @@ public:
bool strict_sync();
private:
template<typename T>
void push_impl(const T& t, std::streamsize buffer_size = -1,
void push_impl(const T& t, std::streamsize buffer_size = -1,
std::streamsize pback_size = -1)
{
typedef typename iostreams::category_of<T>::type category;
@@ -331,20 +331,20 @@ private:
links_.front()->BOOST_IOSTREAMS_PUBSYNC();
try {
boost::iostreams::detail::execute_foreach(
links_.rbegin(), links_.rend(),
links_.rbegin(), links_.rend(),
closer(BOOST_IOS::in)
);
} catch (...) {
try {
boost::iostreams::detail::execute_foreach(
links_.begin(), links_.end(),
links_.begin(), links_.end(),
closer(BOOST_IOS::out)
);
} catch (...) { }
throw;
}
boost::iostreams::detail::execute_foreach(
links_.begin(), links_.end(),
links_.begin(), links_.end(),
closer(BOOST_IOS::out)
);
}
@@ -382,7 +382,7 @@ private:
//----------Member data---------------------------------------------------//
private:
shared_ptr<chain_impl> pimpl_;
std::shared_ptr<chain_impl> pimpl_;
};
} // End namespace detail.

View File

@@ -24,7 +24,7 @@
#include <algorithm> // max.
#include <cstring> // memcpy.
#include <exception>
#include <boost/config.hpp> // DEDUCED_TYPENAME,
#include <boost/config.hpp> // DEDUCED_TYPENAME,
#include <boost/iostreams/char_traits.hpp>
#include <boost/iostreams/constants.hpp> // default_filter_buffer_size.
#include <boost/iostreams/detail/adapter/concept_adapter.hpp>
@@ -42,7 +42,7 @@
#include <boost/iostreams/detail/select.hpp>
#include <boost/iostreams/traits.hpp>
#include <boost/iostreams/operations.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/static_assert.hpp>
#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
@@ -54,7 +54,7 @@
namespace boost { namespace iostreams {
struct code_conversion_error : BOOST_IOSTREAMS_FAILURE {
code_conversion_error()
code_conversion_error()
: BOOST_IOSTREAMS_FAILURE("code conversion error")
{ }
};
@@ -91,28 +91,28 @@ Tgt* strncpy_if_same(Tgt* tgt, const Src* src, std::streamsize n)
// Buffer and conversion state for reading.
template<typename Codecvt, typename Alloc>
class conversion_buffer
class conversion_buffer
: public buffer<
BOOST_DEDUCED_TYPENAME detail::codecvt_extern<Codecvt>::type,
Alloc
>
>
{
public:
typedef typename Codecvt::state_type state_type;
conversion_buffer()
conversion_buffer()
: buffer<
BOOST_DEDUCED_TYPENAME detail::codecvt_extern<Codecvt>::type,
Alloc
>(0)
{
reset();
>(0)
{
reset();
}
state_type& state() { return state_; }
void reset()
{
if (this->size())
void reset()
{
if (this->size())
this->set(0, 0);
state_ = state_type();
state_ = state_type();
}
private:
state_type state_;
@@ -128,12 +128,12 @@ struct code_converter_impl {
typedef is_convertible<device_category, input> can_read;
typedef is_convertible<device_category, output> can_write;
typedef is_convertible<device_category, bidirectional> is_bidir;
typedef typename
typedef typename
iostreams::select< // Disambiguation for Tru64.
is_bidir, bidirectional,
can_read, input,
can_write, output
>::type mode;
>::type mode;
typedef typename
mpl::if_<
is_direct<Device>,
@@ -147,10 +147,10 @@ struct code_converter_impl {
code_converter_impl() : cvt_(), flags_(0) { }
~code_converter_impl()
{
try {
if (flags_ & f_open) close();
} catch (...) { /* */ }
{
try {
if (flags_ & f_open) close();
} catch (...) { /* */ }
}
template <class T>
@@ -213,7 +213,7 @@ struct code_converter_impl {
codecvt_holder<Codecvt> cvt_;
storage_type dev_;
double_object<
buffer_type,
buffer_type,
is_double
> buf_;
int flags_;
@@ -232,13 +232,13 @@ struct code_converter_base {
Device, Codecvt, Alloc
> impl_type;
code_converter_base() : pimpl_(new impl_type) { }
shared_ptr<impl_type> pimpl_;
std::shared_ptr<impl_type> pimpl_;
};
template< typename Device,
typename Codecvt = detail::default_codecvt,
template< typename Device,
typename Codecvt = detail::default_codecvt,
typename Alloc = std::allocator<char> >
class code_converter
class code_converter
: protected code_converter_base<Device, Codecvt, Alloc>
{
private:
@@ -252,28 +252,28 @@ private:
typedef typename detail::codecvt_extern<Codecvt>::type extern_type;
typedef typename detail::codecvt_state<Codecvt>::type state_type;
public:
typedef intern_type char_type;
struct category
typedef intern_type char_type;
struct category
: impl_type::mode, device_tag, closable_tag, localizable_tag
{ };
BOOST_STATIC_ASSERT((
is_same<
extern_type,
extern_type,
BOOST_DEDUCED_TYPENAME char_type_of<Device>::type
>::value
));
public:
code_converter() { }
#if BOOST_WORKAROUND(__GNUC__, < 3)
code_converter(code_converter& rhs)
code_converter(code_converter& rhs)
: code_converter_base<Device, Codecvt, Alloc>(rhs)
{ }
code_converter(const code_converter& rhs)
code_converter(const code_converter& rhs)
: code_converter_base<Device, Codecvt, Alloc>(rhs)
{ }
#endif
BOOST_IOSTREAMS_FORWARD( code_converter, open_impl, Device,
BOOST_IOSTREAMS_CONVERTER_PARAMS,
BOOST_IOSTREAMS_CONVERTER_PARAMS,
BOOST_IOSTREAMS_CONVERTER_ARGS )
// fstream-like interface.
@@ -294,9 +294,9 @@ public:
Device* operator->() { return &detail::unwrap_direct(dev()); }
private:
template<typename T> // Used for forwarding.
void open_impl(const T& t BOOST_IOSTREAMS_CONVERTER_PARAMS())
{
impl().open(t BOOST_IOSTREAMS_CONVERTER_ARGS());
void open_impl(const T& t BOOST_IOSTREAMS_CONVERTER_PARAMS())
{
impl().open(t BOOST_IOSTREAMS_CONVERTER_ARGS());
}
const codecvt_type& cvt() { return impl().cvt_.get(); }
@@ -347,7 +347,7 @@ std::streamsize code_converter<Device, Codevt, Alloc>::read
break;
case std::codecvt_base::noconv:
{
std::streamsize amt =
std::streamsize amt =
std::min<std::streamsize>(next - buf.ptr(), n - total);
detail::strncpy_if_same(s + total, buf.ptr(), amt);
total += amt;
@@ -382,7 +382,7 @@ std::streamsize code_converter<Device, Codevt, Alloc>::write
break;
partial = false;
}
// Convert.
std::codecvt_base::result result =
cvt().out( buf.state(),
@@ -399,8 +399,8 @@ std::streamsize code_converter<Device, Codevt, Alloc>::write
break;
case std::codecvt_base::noconv:
{
std::streamsize amt =
std::min<std::streamsize>( nint - total - s,
std::streamsize amt =
std::min<std::streamsize>( nint - total - s,
buf.end() - buf.eptr() );
detail::strncpy_if_same(buf.eptr(), s + total, amt);
total += amt;

View File

@@ -21,7 +21,7 @@
#include <boost/iostreams/detail/ios.hpp> // openmode, seekdir, int types.
#include <boost/iostreams/detail/fstream.hpp>
#include <boost/iostreams/operations.hpp> // seek.
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
// Must come last.
#include <boost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
@@ -46,8 +46,8 @@ public:
std::streamsize read(char_type* s, std::streamsize n);
bool putback(char_type c);
std::streamsize write(const char_type* s, std::streamsize n);
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
BOOST_IOS::openmode which =
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
BOOST_IOS::openmode which =
BOOST_IOS::in | BOOST_IOS::out );
void open( const std::string& path,
BOOST_IOS::openmode mode =
@@ -67,7 +67,7 @@ private:
~impl() { if (file_.is_open()) file_.close(); }
BOOST_IOSTREAMS_BASIC_FILEBUF(Ch) file_;
};
shared_ptr<impl> pimpl_;
std::shared_ptr<impl> pimpl_;
};
typedef basic_file<char> file;
@@ -87,7 +87,7 @@ struct basic_file_source : private basic_file<Ch> {
using basic_file<Ch>::is_open;
using basic_file<Ch>::close;
basic_file_source( const std::string& path,
BOOST_IOS::openmode mode =
BOOST_IOS::openmode mode =
BOOST_IOS::in )
: basic_file<Ch>(path, mode & ~BOOST_IOS::out, BOOST_IOS::in)
{ }
@@ -128,29 +128,29 @@ struct basic_file_sink : private basic_file<Ch> {
typedef basic_file_sink<char> file_sink;
typedef basic_file_sink<wchar_t> wfile_sink;
//------------------Implementation of basic_file------------------------------//
template<typename Ch>
basic_file<Ch>::basic_file
( const std::string& path, BOOST_IOS::openmode mode,
( const std::string& path, BOOST_IOS::openmode mode,
BOOST_IOS::openmode base_mode )
{
{
open(path, mode, base_mode);
}
template<typename Ch>
inline std::streamsize basic_file<Ch>::read
(char_type* s, std::streamsize n)
{
std::streamsize result = pimpl_->file_.sgetn(s, n);
{
std::streamsize result = pimpl_->file_.sgetn(s, n);
return result != 0 ? result : -1;
}
template<typename Ch>
inline bool basic_file<Ch>::putback(char_type c)
{
return !!pimpl_->file_.sputbackc(c);
{
return !!pimpl_->file_.sputbackc(c);
}
template<typename Ch>
@@ -160,15 +160,15 @@ inline std::streamsize basic_file<Ch>::write
template<typename Ch>
std::streampos basic_file<Ch>::seek
( stream_offset off, BOOST_IOS::seekdir way,
( stream_offset off, BOOST_IOS::seekdir way,
BOOST_IOS::openmode )
{ return iostreams::seek(pimpl_->file_, off, way); }
template<typename Ch>
void basic_file<Ch>::open
( const std::string& path, BOOST_IOS::openmode mode,
( const std::string& path, BOOST_IOS::openmode mode,
BOOST_IOS::openmode base_mode )
{
{
pimpl_.reset(new impl(path, mode | base_mode));
}

View File

@@ -25,7 +25,7 @@
#include <boost/iostreams/detail/ios.hpp> // openmode, seekdir, int types.
#include <boost/iostreams/detail/path.hpp>
#include <boost/iostreams/positioning.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
// Must come last.
#include <boost/config/abi_prefix.hpp>
@@ -86,9 +86,9 @@ public:
explicit file_descriptor( const Path& path,
BOOST_IOS::openmode mode =
BOOST_IOS::in | BOOST_IOS::out )
{
{
init();
open(detail::path(path), mode);
open(detail::path(path), mode);
}
// Copy constructor
@@ -135,12 +135,12 @@ private:
void init();
// open overload taking a detail::path
void open( const detail::path& path,
BOOST_IOS::openmode,
void open( const detail::path& path,
BOOST_IOS::openmode,
BOOST_IOS::openmode = BOOST_IOS::openmode(0) );
typedef detail::file_descriptor_impl impl_type;
shared_ptr<impl_type> pimpl_;
std::shared_ptr<impl_type> pimpl_;
};
class BOOST_IOSTREAMS_DECL file_descriptor_source : private file_descriptor {
@@ -293,16 +293,16 @@ public:
#endif
// open overload taking a std::string
void open( const std::string& path,
void open( const std::string& path,
BOOST_IOS::openmode mode = BOOST_IOS::out );
// open overload taking C-style string
void open( const char* path,
void open( const char* path,
BOOST_IOS::openmode mode = BOOST_IOS::out );
// open overload taking a Boost.Filesystem path
template<typename Path>
void open( const Path& path,
void open( const Path& path,
BOOST_IOS::openmode mode = BOOST_IOS::out )
{ open(detail::path(path), mode); }
private:

View File

@@ -26,7 +26,7 @@
#include <boost/iostreams/detail/path.hpp>
#include <boost/iostreams/operations_fwd.hpp>
#include <boost/iostreams/positioning.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/static_assert.hpp>
#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -54,25 +54,25 @@ public:
};
// Bitmask operations for mapped_file_base::mapmode
mapped_file_base::mapmode
mapped_file_base::mapmode
operator|(mapped_file_base::mapmode a, mapped_file_base::mapmode b);
mapped_file_base::mapmode
mapped_file_base::mapmode
operator&(mapped_file_base::mapmode a, mapped_file_base::mapmode b);
mapped_file_base::mapmode
mapped_file_base::mapmode
operator^(mapped_file_base::mapmode a, mapped_file_base::mapmode b);
mapped_file_base::mapmode
mapped_file_base::mapmode
operator~(mapped_file_base::mapmode a);
mapped_file_base::mapmode
mapped_file_base::mapmode
operator|=(mapped_file_base::mapmode& a, mapped_file_base::mapmode b);
mapped_file_base::mapmode
mapped_file_base::mapmode
operator&=(mapped_file_base::mapmode& a, mapped_file_base::mapmode b);
mapped_file_base::mapmode
mapped_file_base::mapmode
operator^=(mapped_file_base::mapmode& a, mapped_file_base::mapmode b);
//------------------Definition of mapped_file_params--------------------------//
@@ -81,8 +81,8 @@ namespace detail {
struct mapped_file_params_base {
mapped_file_params_base()
: flags(static_cast<mapped_file_base::mapmode>(0)),
mode(), offset(0), length(static_cast<std::size_t>(-1)),
: flags(static_cast<mapped_file_base::mapmode>(0)),
mode(), offset(0), length(static_cast<std::size_t>(-1)),
new_file_size(0), hint(0)
{ }
private:
@@ -102,16 +102,16 @@ public:
// This template allows Boost.Filesystem paths to be specified when creating or
// reopening a memory mapped file, without creating a dependence on
// Boost.Filesystem. Possible values of Path include std::string,
// boost::filesystem::path, boost::filesystem::wpath,
// boost::filesystem::path, boost::filesystem::wpath,
// and boost::iostreams::detail::path (used to store either a std::string or a
// std::wstring).
template<typename Path>
struct basic_mapped_file_params
: detail::mapped_file_params_base
struct basic_mapped_file_params
: detail::mapped_file_params_base
{
typedef detail::mapped_file_params_base base_type;
// For wide paths, instantiate basic_mapped_file_params
// For wide paths, instantiate basic_mapped_file_params
// with boost::filesystem::wpath
#ifndef BOOST_IOSTREAMS_NO_WIDE_STREAMS
BOOST_STATIC_ASSERT((!is_same<Path, std::wstring>::value));
@@ -215,7 +215,7 @@ private:
void init();
void open_impl(const param_type& p);
boost::shared_ptr<impl_type> pimpl_;
boost::std::shared_ptr<impl_type> pimpl_;
};
//------------------Definition of mapped_file---------------------------------//
@@ -253,7 +253,7 @@ public:
size_type length = max_length,
stream_offset offset = 0 );
// Constructor taking a list of parameters, including a
// Constructor taking a list of parameters, including a
// std::ios_base::openmode (deprecated)
template<typename Path>
explicit mapped_file( const Path& path,
@@ -283,7 +283,7 @@ public:
size_type length = max_length,
stream_offset offset = 0 );
// open overload taking a list of parameters, including a
// open overload taking a list of parameters, including a
// std::ios_base::openmode (deprecated)
template<typename Path>
void open( const Path& path,
@@ -387,7 +387,7 @@ mapped_file_source::mapped_file_source(const basic_mapped_file_params<Path>& p)
{ init(); open(p); }
template<typename Path>
mapped_file_source::mapped_file_source(
mapped_file_source::mapped_file_source(
const Path& path, size_type length, boost::intmax_t offset)
{ init(); open(path, length, offset); }
@@ -423,14 +423,14 @@ mapped_file::mapped_file(const basic_mapped_file_params<Path>& p)
{ open(p); }
template<typename Path>
mapped_file::mapped_file(
const Path& path, mapmode flags,
mapped_file::mapped_file(
const Path& path, mapmode flags,
size_type length, stream_offset offset )
{ open(path, flags, length, offset); }
template<typename Path>
mapped_file::mapped_file(
const Path& path, BOOST_IOS::openmode mode,
mapped_file::mapped_file(
const Path& path, BOOST_IOS::openmode mode,
size_type length, stream_offset offset )
{ open(path, mode, length, offset); }
@@ -439,8 +439,8 @@ void mapped_file::open(const basic_mapped_file_params<Path>& p)
{ delegate_.open_impl(p); }
template<typename Path>
void mapped_file::open(
const Path& path, mapmode flags,
void mapped_file::open(
const Path& path, mapmode flags,
size_type length, stream_offset offset )
{
param_type p(path);
@@ -451,8 +451,8 @@ void mapped_file::open(
}
template<typename Path>
void mapped_file::open(
const Path& path, BOOST_IOS::openmode mode,
void mapped_file::open(
const Path& path, BOOST_IOS::openmode mode,
size_type length, stream_offset offset )
{
param_type p(path);
@@ -462,7 +462,7 @@ void mapped_file::open(
open(p);
}
inline char* mapped_file::data() const
inline char* mapped_file::data() const
{ return (flags() != readonly) ? const_cast<char*>(delegate_.data()) : 0; }
//------------------Implementation of mapped_file_sink------------------------//
@@ -524,13 +524,13 @@ struct operations<mapped_file>
{
static std::pair<char*, char*>
input_sequence(mapped_file& file)
{
return std::make_pair(file.begin(), file.end());
{
return std::make_pair(file.begin(), file.end());
}
static std::pair<char*, char*>
output_sequence(mapped_file& file)
{
return std::make_pair(file.begin(), file.end());
{
return std::make_pair(file.begin(), file.end());
}
};
@@ -540,28 +540,28 @@ struct operations<mapped_file_sink>
{
static std::pair<char*, char*>
output_sequence(mapped_file_sink& sink)
{
return std::make_pair(sink.begin(), sink.end());
{
return std::make_pair(sink.begin(), sink.end());
}
};
//------------------Definition of mapmode operators---------------------------//
inline mapped_file::mapmode
inline mapped_file::mapmode
operator|(mapped_file::mapmode a, mapped_file::mapmode b)
{
return static_cast<mapped_file::mapmode>
(static_cast<int>(a) | static_cast<int>(b));
}
inline mapped_file::mapmode
inline mapped_file::mapmode
operator&(mapped_file::mapmode a, mapped_file::mapmode b)
{
return static_cast<mapped_file::mapmode>
(static_cast<int>(a) & static_cast<int>(b));
}
inline mapped_file::mapmode
inline mapped_file::mapmode
operator^(mapped_file::mapmode a, mapped_file::mapmode b)
{
return static_cast<mapped_file::mapmode>
@@ -574,19 +574,19 @@ operator~(mapped_file::mapmode a)
return static_cast<mapped_file::mapmode>(~static_cast<int>(a));
}
inline mapped_file::mapmode
inline mapped_file::mapmode
operator|=(mapped_file::mapmode& a, mapped_file::mapmode b)
{
return a = a | b;
}
inline mapped_file::mapmode
inline mapped_file::mapmode
operator&=(mapped_file::mapmode& a, mapped_file::mapmode b)
{
return a = a & b;
}
inline mapped_file::mapmode
inline mapped_file::mapmode
operator^=(mapped_file::mapmode& a, mapped_file::mapmode b)
{
return a = a ^ b;

View File

@@ -20,12 +20,12 @@
// // Consume as many characters as possible from the interval
// // [begin_in, end_in), without exhausting the output range
// // [begin_out, end_out). If flush is true, write as mush output
// // as possible.
// // A return value of true indicates that filter should be called
// // again. More precisely, if flush is false, a return value of
// // as possible.
// // A return value of true indicates that filter should be called
// // again. More precisely, if flush is false, a return value of
// // false indicates that the natural end of stream has been reached
// // and that all filtered data has been forwarded; if flush is
// // true, a return value of false indicates that all filtered data
// // true, a return value of false indicates that all filtered data
// // has been forwarded.
// }
// void close() { /* Reset filter's state. */ }
@@ -57,7 +57,7 @@
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
// Must come last.
#include <boost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
@@ -188,7 +188,7 @@ public:
string_type unconsumed_input() const;
// Give impl access to buffer_type on Tru64
#if !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
#if !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
private:
#endif
typedef detail::buffer<char_type, Alloc> buffer_type;
@@ -266,7 +266,7 @@ private:
int state_;
};
shared_ptr<impl> pimpl_;
std::shared_ptr<impl> pimpl_;
};
BOOST_IOSTREAMS_PIPABLE(symmetric_filter, 2)

View File

@@ -10,11 +10,11 @@
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#endif
#include <algorithm> // copy, min.
#include <algorithm> // copy, min.
#include <boost/assert.hpp>
#include <boost/config.hpp> // BOOST_DEDUCED_TYPENAME.
#include <boost/config.hpp> // BOOST_DEDUCED_TYPENAME.
#include <boost/detail/workaround.hpp> // default_filter_buffer_size.
#include <boost/iostreams/char_traits.hpp>
#include <boost/iostreams/compose.hpp>
@@ -26,7 +26,7 @@
#include <boost/iostreams/detail/functional.hpp> // clear_flags, call_reset
#include <boost/mpl/if.hpp>
#include <boost/ref.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/type_traits/is_convertible.hpp>
// Must come last.
@@ -51,7 +51,7 @@ public:
typedef typename char_type_of<Filter>::type char_type;
typedef typename int_type_of<Filter>::type int_type;
typedef char_traits<char_type> traits_type;
typedef typename
typedef typename
mpl::if_<
is_convertible<
base_category,
@@ -60,15 +60,15 @@ public:
output,
input
>::type mode;
struct category
: mode,
filter_tag,
multichar_tag,
closable_tag
struct category
: mode,
filter_tag,
multichar_tag,
closable_tag
{ };
explicit inverse( const Filter& filter,
std::streamsize buffer_size =
default_filter_buffer_size)
explicit inverse( const Filter& filter,
std::streamsize buffer_size =
default_filter_buffer_size)
: pimpl_(new impl(filter, buffer_size))
{ }
@@ -93,10 +93,10 @@ public:
buf().flush(snk);
}
return snk.second().count() == 0 &&
status == traits_type::eof()
?
status == traits_type::eof()
?
-1
:
:
snk.second().count();
}
@@ -111,7 +111,7 @@ public:
flags() = f_write;
buf().set(0, 0);
}
filtered_array_source src(filter(), array_source(s, n));
for (bool good = true; src.second().count() < n && good; ) {
buf().fill(src);
@@ -133,20 +133,20 @@ private:
filter_ref filter() { return boost::ref(pimpl_->filter_); }
detail::buffer<char_type>& buf() { return pimpl_->buf_; }
int& flags() { return pimpl_->flags_; }
enum flags_ {
f_read = 1, f_write = 2
};
struct impl {
impl(const Filter& filter, std::streamsize n)
impl(const Filter& filter, std::streamsize n)
: filter_(filter), buf_(n), flags_(0)
{ buf_.set(0, 0); }
Filter filter_;
detail::buffer<char_type> buf_;
int flags_;
};
shared_ptr<impl> pimpl_;
std::shared_ptr<impl> pimpl_;
};
//
@@ -157,7 +157,7 @@ private:
//
template<typename Filter>
inverse<Filter> invert(const Filter& f) { return inverse<Filter>(f); }
//----------------------------------------------------------------------------//
} } // End namespaces iostreams, boost.

View File

@@ -26,11 +26,11 @@
#include <boost/mpl/has_xxx.hpp>
#ifdef BOOST_MPL_CFG_NO_HAS_XXX
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
# include <boost/scoped_ptr.hpp>
# include <boost/mpl/bool.hpp>
# include <memory>
#endif
#endif
#include <boost/iterator/detail/config_def.hpp> // must be last #include
@@ -45,7 +45,7 @@ namespace boost
struct indirect_base
{
typedef typename iterator_traits<Iter>::value_type dereferenceable;
typedef iterator_adaptor<
indirect_iterator<Iter, Value, Category, Reference, Difference>
, Iter
@@ -69,7 +69,7 @@ namespace boost
struct indirect_base<int, int, int, int, int> {};
} // namespace detail
template <
class Iterator
, class Value = use_default
@@ -107,14 +107,14 @@ namespace boost
: super_t(y.base())
{}
private:
private:
typename super_t::reference dereference() const
{
# if BOOST_WORKAROUND(__BORLANDC__, < 0x5A0 )
return const_cast<super_t::reference>(**this->base());
# else
return **this->base();
# endif
# endif
}
};

View File

@@ -15,7 +15,7 @@
#include <boost/locale/boundary/boundary_point.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <boost/assert.hpp>
#ifdef BOOST_MSVC
@@ -34,7 +34,7 @@
namespace boost {
namespace locale {
namespace boundary {
///
/// \defgroup boundary Boundary Analysis
@@ -88,7 +88,7 @@ namespace boost {
//
// C++0x requires that string is continious in memory and all known
// string implementations
// do this because of c_str() support.
// do this because of c_str() support.
//
if(linear_iterator_traits<char_type,IteratorType>::is_linear && b!=e)
@@ -117,8 +117,8 @@ namespace boost {
mapping(boundary_type type,
base_iterator begin,
base_iterator end,
std::locale const &loc)
:
std::locale const &loc)
:
index_(new index_type()),
begin_(begin),
end_(end)
@@ -147,12 +147,12 @@ namespace boost {
}
private:
boost::shared_ptr<index_type> index_;
boost::std::shared_ptr<index_type> index_;
base_iterator begin_,end_;
};
template<typename BaseIterator>
class segment_index_iterator :
class segment_index_iterator :
public boost::iterator_facade<
segment_index_iterator<BaseIterator>,
segment<BaseIterator>,
@@ -164,7 +164,7 @@ namespace boost {
typedef BaseIterator base_iterator;
typedef mapping<base_iterator> mapping_type;
typedef segment<base_iterator> segment_type;
segment_index_iterator() : current_(0,0),map_(0)
{
}
@@ -267,13 +267,13 @@ namespace boost {
{
size_t dist=std::distance(map_->begin(),p);
index_type::const_iterator b=map_->index().begin(),e=map_->index().end();
index_type::const_iterator
index_type::const_iterator
boundary_point=std::upper_bound(b,e,break_info(dist));
while(boundary_point != e && (boundary_point->rule & mask_)==0)
boundary_point++;
current_.first = current_.second = boundary_point - b;
if(full_select_) {
while(current_.first > 0) {
current_.first --;
@@ -318,31 +318,31 @@ namespace boost {
bool valid_offset(size_t offset) const
{
return offset == 0
return offset == 0
|| offset == size() // make sure we not acess index[size]
|| (index()[offset].rule & mask_)!=0;
}
size_t size() const
{
return index().size();
}
index_type const &index() const
{
return map_->index();
}
segment_type value_;
std::pair<size_t,size_t> current_;
mapping_type const *map_;
rule_type mask_;
bool full_select_;
};
template<typename BaseIterator>
class boundary_point_index_iterator :
class boundary_point_index_iterator :
public boost::iterator_facade<
boundary_point_index_iterator<BaseIterator>,
boundary_point<BaseIterator>,
@@ -354,7 +354,7 @@ namespace boost {
typedef BaseIterator base_iterator;
typedef mapping<base_iterator> mapping_type;
typedef boundary_point<base_iterator> boundary_point_type;
boundary_point_index_iterator() : current_(0),map_(0)
{
}
@@ -466,22 +466,22 @@ namespace boost {
bool valid_offset(size_t offset) const
{
return offset == 0
return offset == 0
|| offset + 1 >= size() // last and first are always valid regardless of mark
|| (index()[offset].rule & mask_)!=0;
}
size_t size() const
{
return index().size();
}
index_type const &index() const
{
return map_->index();
}
boundary_point_type value_;
size_t current_;
mapping_type const *map_;
@@ -498,10 +498,10 @@ namespace boost {
template<typename BaseIterator>
class boundary_point_index;
///
/// \brief This class holds an index of segments in the text range and allows to iterate over them
/// \brief This class holds an index of segments in the text range and allows to iterate over them
///
/// This class is provides \ref begin() and \ref end() member functions that return bidirectional iterators
/// to the \ref segment objects.
@@ -512,7 +512,7 @@ namespace boost {
/// various masks %as \ref word_any.
/// \n
/// The default is to select any types of boundaries.
/// \n
/// \n
/// For example: using word %boundary analysis, when the provided mask is \ref word_kana then the iterators
/// would iterate only over the words containing Kana letters and \ref word_any would select all types of
/// words excluding ranges that consist of white space and punctuation marks. So iterating over the text
@@ -533,7 +533,7 @@ namespace boost {
/// terminator "!" or "?". But changing \ref full_select() to true, the selected segment would include
/// all the text up to previous valid %boundary point and would return two expected sentences:
/// "Hello!" and "How\nare you?".
///
///
/// This class allows to find a segment according to the given iterator in range using \ref find() member
/// function.
///
@@ -555,7 +555,7 @@ namespace boost {
template<typename BaseIterator>
class segment_index {
public:
///
/// The type of the iterator used to iterate over the original text
///
@@ -591,7 +591,7 @@ namespace boost {
typedef segment<base_iterator> value_type;
///
/// Default constructor.
/// Default constructor.
///
/// \note
///
@@ -610,7 +610,7 @@ namespace boost {
base_iterator begin,
base_iterator end,
rule_type mask,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(mask),
@@ -624,7 +624,7 @@ namespace boost {
segment_index(boundary_type type,
base_iterator begin,
base_iterator end,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(0xFFFFFFFFu),
@@ -655,7 +655,7 @@ namespace boost {
///
segment_index const &operator = (boundary_point_index<base_iterator> const &);
///
/// Create a new index for %boundary analysis \ref boundary_type "type" of the text
/// in range [begin,end) for locale \a loc.
@@ -694,7 +694,7 @@ namespace boost {
}
///
/// Find a first valid segment following a position \a p.
/// Find a first valid segment following a position \a p.
///
/// If \a p is inside a valid segment this segment is selected:
///
@@ -704,7 +704,7 @@ namespace boost {
/// - "t|o be or ", would point to "to",
/// - "to be or| ", would point to end.
///
///
///
/// Preconditions: the segment_index should have a mapping and \a p should be valid iterator
/// to the text in the mapped range.
///
@@ -714,17 +714,17 @@ namespace boost {
{
return iterator(p,&map_,mask_,full_select_);
}
///
/// Get the mask of rules that are used
///
///
rule_type rule() const
{
return mask_;
}
///
/// Set the mask of rules that are used
///
///
void rule(rule_type v)
{
mask_ = v;
@@ -743,7 +743,7 @@ namespace boost {
/// following part "are you?"
///
bool full_select() const
bool full_select() const
{
return full_select_;
}
@@ -761,11 +761,11 @@ namespace boost {
/// following part "are you?"
///
void full_select(bool v)
void full_select(bool v)
{
full_select_ = v;
}
private:
friend class boundary_point_index<base_iterator>;
typedef details::mapping<base_iterator> mapping_type;
@@ -793,14 +793,14 @@ namespace boost {
/// - "Hello! How\n|are you?"
/// - "Hello! How\nare you?|"
///
/// However if \ref rule() is set to \ref sentence_term then the selected %boundary points would be:
/// However if \ref rule() is set to \ref sentence_term then the selected %boundary points would be:
///
/// - "|Hello! How\nare you?"
/// - "Hello! |How\nare you?"
/// - "Hello! How\nare you?|"
///
///
/// Such that a %boundary point defined by a line feed character would be ignored.
///
///
/// This class allows to find a boundary_point according to the given iterator in range using \ref find() member
/// function.
///
@@ -858,9 +858,9 @@ namespace boost {
/// an object that represents the selected \ref boundary_point "boundary point".
///
typedef boundary_point<base_iterator> value_type;
///
/// Default constructor.
/// Default constructor.
///
/// \note
///
@@ -871,7 +871,7 @@ namespace boost {
boundary_point_index() : mask_(0xFFFFFFFFu)
{
}
///
/// Create a segment_index for %boundary analysis \ref boundary_type "type" of the text
/// in range [begin,end) using a rule \a mask for locale \a loc.
@@ -880,7 +880,7 @@ namespace boost {
base_iterator begin,
base_iterator end,
rule_type mask,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(mask)
@@ -893,7 +893,7 @@ namespace boost {
boundary_point_index(boundary_type type,
base_iterator begin,
base_iterator end,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(0xFFFFFFFFu)
@@ -969,7 +969,7 @@ namespace boost {
///
/// - "|to be", would return %boundary point at "|to be",
/// - "t|o be", would point to "to| be"
///
///
/// Preconditions: the boundary_point_index should have a mapping and \a p should be valid iterator
/// to the text in the mapped range.
///
@@ -979,17 +979,17 @@ namespace boost {
{
return iterator(p,&map_,mask_);
}
///
/// Get the mask of rules that are used
///
///
rule_type rule() const
{
return mask_;
}
///
/// Set the mask of rules that are used
///
///
void rule(rule_type v)
{
mask_ = v;
@@ -1002,8 +1002,8 @@ namespace boost {
mapping_type map_;
rule_type mask_;
};
/// \cond INTERNAL
/// \cond INTERNAL
template<typename BaseIterator>
segment_index<BaseIterator>::segment_index(boundary_point_index<BaseIterator> const &other) :
map_(other.map_),
@@ -1011,7 +1011,7 @@ namespace boost {
full_select_(false)
{
}
template<typename BaseIterator>
boundary_point_index<BaseIterator>::boundary_point_index(segment_index<BaseIterator> const &other) :
map_(other.map_),
@@ -1025,7 +1025,7 @@ namespace boost {
map_ = other.map_;
return *this;
}
template<typename BaseIterator>
boundary_point_index<BaseIterator> const &boundary_point_index<BaseIterator>::operator=(segment_index<BaseIterator> const &other)
{
@@ -1033,7 +1033,7 @@ namespace boost {
return *this;
}
/// \endcond
typedef segment_index<std::string::const_iterator> ssegment_index; ///< convenience typedef
typedef segment_index<std::wstring::const_iterator> wssegment_index; ///< convenience typedef
#ifdef BOOST_HAS_CHAR16_T
@@ -1042,7 +1042,7 @@ namespace boost {
#ifdef BOOST_HAS_CHAR32_T
typedef segment_index<std::u32string::const_iterator> u32ssegment_index;///< convenience typedef
#endif
typedef segment_index<char const *> csegment_index; ///< convenience typedef
typedef segment_index<wchar_t const *> wcsegment_index; ///< convenience typedef
#ifdef BOOST_HAS_CHAR16_T
@@ -1060,7 +1060,7 @@ namespace boost {
#ifdef BOOST_HAS_CHAR32_T
typedef boundary_point_index<std::u32string::const_iterator> u32sboundary_point_index;///< convenience typedef
#endif
typedef boundary_point_index<char const *> cboundary_point_index; ///< convenience typedef
typedef boundary_point_index<wchar_t const *> wcboundary_point_index; ///< convenience typedef
#ifdef BOOST_HAS_CHAR16_T

View File

@@ -20,10 +20,10 @@
namespace boost {
template<typename Type>
class shared_ptr;
class std::shared_ptr;
///
/// \brief This is the main namespace that encloses all localization classes
/// \brief This is the main namespace that encloses all localization classes
///
namespace locale {
@@ -39,7 +39,7 @@ namespace boost {
static const uint32_t character_first_facet = char_facet; ///< First facet specific for character type
static const uint32_t character_last_facet = char32_t_facet; ///< Last facet specific for character type
static const uint32_t all_characters = 0xFFFF; ///< Special mask -- generate all
typedef uint32_t character_facet_type; ///<type that specifies the character type that locales can be generated for
static const uint32_t convert_facet = 1 << 0; ///< Generate conversion facets
@@ -49,19 +49,19 @@ namespace boost {
static const uint32_t message_facet = 1 << 4; ///< Generate message facets
static const uint32_t codepage_facet = 1 << 5; ///< Generate character set conversion facets (derived from std::codecvt)
static const uint32_t boundary_facet = 1 << 6; ///< Generate boundary analysis facet
static const uint32_t per_character_facet_first = convert_facet; ///< First facet specific for character
static const uint32_t per_character_facet_last = boundary_facet; ///< Last facet specific for character
static const uint32_t calendar_facet = 1 << 16; ///< Generate boundary analysis facet
static const uint32_t information_facet = 1 << 17; ///< Generate general locale information facet
static const uint32_t non_character_facet_first = calendar_facet; ///< First character independent facet
static const uint32_t non_character_facet_last = information_facet;///< Last character independent facet
static const uint32_t non_character_facet_first = calendar_facet; ///< First character independent facet
static const uint32_t non_character_facet_last = information_facet;///< Last character independent facet
static const uint32_t all_categories = 0xFFFFFFFFu; ///< Generate all of them
typedef uint32_t locale_category_type; ///< a type used for more fine grained generation of facets
///
@@ -75,11 +75,11 @@ namespace boost {
public:
///
/// Create new generator using global localization_backend_manager
/// Create new generator using global localization_backend_manager
///
generator();
///
/// Create new generator using specific localization_backend_manager
/// Create new generator using specific localization_backend_manager
///
generator(localization_backend_manager const &);
@@ -93,7 +93,7 @@ namespace boost {
/// Get types of facets that should be generated, default all
///
locale_category_type categories() const;
///
/// Set the characters type for which the facets should be generated, default all supported
///
@@ -142,13 +142,13 @@ namespace boost {
///
/// - Under the Windows platform the path is treated as a path in the locale's encoding so
/// if you create locale "en_US.windows-1251" then path would be treated as cp1255,
/// and if it is en_US.UTF-8 it is treated as UTF-8. File name is always opened with
/// and if it is en_US.UTF-8 it is treated as UTF-8. File name is always opened with
/// a wide file name as wide file names are the native file name on Windows.
///
/// - Under POSIX platforms all paths passed as-is regardless of encoding as narrow
/// encodings are the native encodings for POSIX platforms.
///
///
///
///
void add_messages_path(std::string const &path);
///
@@ -201,7 +201,7 @@ namespace boost {
{
return generate(id);
}
///
/// Set backend specific option
///
@@ -214,7 +214,7 @@ namespace boost {
private:
void set_all_options(shared_ptr<localization_backend> backend,std::string const &id) const;
void set_all_options(std::shared_ptr<localization_backend> backend,std::string const &id) const;
generator(generator const &);
void operator=(generator const &);
@@ -231,5 +231,5 @@ namespace boost {
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4

View File

@@ -16,7 +16,7 @@
#include <boost/mpi/config.hpp>
#include <boost/mpi/exception.hpp>
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/mpi/datatype.hpp>
#include <utility>
#include <iterator>
@@ -89,7 +89,7 @@ enum comm_create_kind { comm_duplicate, comm_take_ownership, comm_attach };
/**
* INTERNAL ONLY
*
*
* Forward declaration of @c group needed for the @c group
* constructor and accessor.
*/
@@ -436,7 +436,7 @@ class BOOST_MPI_DECL communicator
* @brief Receive an array of values from a remote process.
*
* This routine blocks until it receives an array of values from the
* process @p source with the given @p tag. If the type @c T is
* process @p source with the given @p tag. If the type @c T is
*
* @param source The process that will be sending data. This will
* either be a process rank within the communicator or the
@@ -518,7 +518,7 @@ class BOOST_MPI_DECL communicator
* @c skeleton_proxy objects except that @c isend will not block
* while waiting for the data to be transmitted. Instead, a request
* object will be immediately returned, allowing one to query the
* status of the communication or wait until it has completed.
* status of the communication or wait until it has completed.
*
* The semantics of this routine are equivalent to a non-blocking
* send of a @c packed_skeleton_oarchive storing the skeleton of
@@ -628,7 +628,7 @@ class BOOST_MPI_DECL communicator
* @brief Initiate receipt of an array of values from a remote process.
*
* This routine initiates a receive operation for an array of values
* transmitted by process @p source with the given @p tag.
* transmitted by process @p source with the given @p tag.
*
* @param source The process that will be sending data. This will
* either be a process rank within the communicator or the
@@ -824,9 +824,9 @@ class BOOST_MPI_DECL communicator
#if 0
template<typename Extents>
communicator
with_cartesian_topology(const Extents& extents,
bool periodic = false,
communicator
with_cartesian_topology(const Extents& extents,
bool periodic = false,
bool reorder = false) const;
template<typename DimInputIterator, typename PeriodicInputIterator>
@@ -863,7 +863,7 @@ class BOOST_MPI_DECL communicator
*
* Function object that frees an MPI communicator and deletes the
* memory associated with it. Intended to be used as a deleter with
* shared_ptr.
* std::shared_ptr.
*/
struct comm_free
{
@@ -877,7 +877,7 @@ class BOOST_MPI_DECL communicator
}
};
/**
* INTERNAL ONLY
*
@@ -904,7 +904,7 @@ class BOOST_MPI_DECL communicator
* datatype, so we map directly to that datatype.
*/
template<typename T>
void
void
array_send_impl(int dest, int tag, const T* values, int n, mpl::true_) const;
/**
@@ -915,8 +915,8 @@ class BOOST_MPI_DECL communicator
* data, to be deserialized on the receiver side.
*/
template<typename T>
void
array_send_impl(int dest, int tag, const T* values, int n,
void
array_send_impl(int dest, int tag, const T* values, int n,
mpl::false_) const;
/**
@@ -945,8 +945,8 @@ class BOOST_MPI_DECL communicator
* datatype, so we map directly to that datatype.
*/
template<typename T>
request
array_isend_impl(int dest, int tag, const T* values, int n,
request
array_isend_impl(int dest, int tag, const T* values, int n,
mpl::true_) const;
/**
@@ -957,8 +957,8 @@ class BOOST_MPI_DECL communicator
* data, to be deserialized on the receiver side.
*/
template<typename T>
request
array_isend_impl(int dest, int tag, const T* values, int n,
request
array_isend_impl(int dest, int tag, const T* values, int n,
mpl::false_) const;
/**
@@ -987,7 +987,7 @@ class BOOST_MPI_DECL communicator
* datatype, so we map directly to that datatype.
*/
template<typename T>
status
status
array_recv_impl(int source, int tag, T* values, int n, mpl::true_) const;
/**
@@ -998,7 +998,7 @@ class BOOST_MPI_DECL communicator
* MPI_PACKED. We'll receive it and then deserialize.
*/
template<typename T>
status
status
array_recv_impl(int source, int tag, T* values, int n, mpl::false_) const;
/**
@@ -1027,7 +1027,7 @@ class BOOST_MPI_DECL communicator
* map directly to that datatype.
*/
template<typename T>
request
request
array_irecv_impl(int source, int tag, T* values, int n, mpl::true_) const;
/**
@@ -1038,10 +1038,10 @@ class BOOST_MPI_DECL communicator
* MPI_PACKED. We'll receive it and then deserialize.
*/
template<typename T>
request
request
array_irecv_impl(int source, int tag, T* values, int n, mpl::false_) const;
shared_ptr<MPI_Comm> comm_ptr;
std::shared_ptr<MPI_Comm> comm_ptr;
};
/**
@@ -1070,13 +1070,13 @@ inline bool operator!=(const communicator& comm1, const communicator& comm2)
* Implementation details *
************************************************************************/
// Count elements in a message
template<typename T>
template<typename T>
inline optional<int> status::count() const
{
return count_impl<T>(is_mpi_datatype<T>());
}
template<typename T>
template<typename T>
optional<int> status::count_impl(mpl::true_) const
{
if (m_count != -1)
@@ -1092,7 +1092,7 @@ optional<int> status::count_impl(mpl::true_) const
return m_count = return_value;
}
template<typename T>
template<typename T>
inline optional<int> status::count_impl(mpl::false_) const
{
if (m_count == -1)
@@ -1140,7 +1140,7 @@ communicator::array_send_impl(int dest, int tag, const T* values, int n,
mpl::true_) const
{
BOOST_MPI_CHECK_RESULT(MPI_Send,
(const_cast<T*>(values), n,
(const_cast<T*>(values), n,
get_mpi_datatype<T>(*values),
dest, tag, MPI_Comm(*this)));
}
@@ -1173,7 +1173,7 @@ status communicator::recv_impl(int source, int tag, T& value, mpl::true_) const
status stat;
BOOST_MPI_CHECK_RESULT(MPI_Recv,
(const_cast<T*>(&value), 1,
(const_cast<T*>(&value), 1,
get_mpi_datatype<T>(value),
source, tag, MPI_Comm(*this), &stat.m_status));
return stat;
@@ -1202,13 +1202,13 @@ status communicator::recv(int source, int tag, T& value) const
}
template<typename T>
status
communicator::array_recv_impl(int source, int tag, T* values, int n,
status
communicator::array_recv_impl(int source, int tag, T* values, int n,
mpl::true_) const
{
status stat;
BOOST_MPI_CHECK_RESULT(MPI_Recv,
(const_cast<T*>(values), n,
(const_cast<T*>(values), n,
get_mpi_datatype<T>(*values),
source, tag, MPI_Comm(*this), &stat.m_status));
return stat;
@@ -1216,7 +1216,7 @@ communicator::array_recv_impl(int source, int tag, T* values, int n,
template<typename T>
status
communicator::array_recv_impl(int source, int tag, T* values, int n,
communicator::array_recv_impl(int source, int tag, T* values, int n,
mpl::false_) const
{
// Receive the message
@@ -1255,7 +1255,7 @@ communicator::isend_impl(int dest, int tag, const T& value, mpl::true_) const
{
request req;
BOOST_MPI_CHECK_RESULT(MPI_Isend,
(const_cast<T*>(&value), 1,
(const_cast<T*>(&value), 1,
get_mpi_datatype<T>(value),
dest, tag, MPI_Comm(*this), &req.m_requests[0]));
return req;
@@ -1268,7 +1268,7 @@ template<typename T>
request
communicator::isend_impl(int dest, int tag, const T& value, mpl::false_) const
{
shared_ptr<packed_oarchive> archive(new packed_oarchive(*this));
std::shared_ptr<packed_oarchive> archive(new packed_oarchive(*this));
*archive << value;
request result = isend(dest, tag, *archive);
result.m_data = archive;
@@ -1290,7 +1290,7 @@ communicator::array_isend_impl(int dest, int tag, const T* values, int n,
{
request req;
BOOST_MPI_CHECK_RESULT(MPI_Isend,
(const_cast<T*>(values), n,
(const_cast<T*>(values), n,
get_mpi_datatype<T>(*values),
dest, tag, MPI_Comm(*this), &req.m_requests[0]));
return req;
@@ -1298,10 +1298,10 @@ communicator::array_isend_impl(int dest, int tag, const T* values, int n,
template<typename T>
request
communicator::array_isend_impl(int dest, int tag, const T* values, int n,
communicator::array_isend_impl(int dest, int tag, const T* values, int n,
mpl::false_) const
{
shared_ptr<packed_oarchive> archive(new packed_oarchive(*this));
std::shared_ptr<packed_oarchive> archive(new packed_oarchive(*this));
*archive << n << boost::serialization::make_array(values, n);
request result = isend(dest, tag, *archive);
result.m_data = archive;
@@ -1324,15 +1324,15 @@ namespace detail {
template<typename T>
struct serialized_irecv_data
{
serialized_irecv_data(const communicator& comm, int source, int tag,
serialized_irecv_data(const communicator& comm, int source, int tag,
T& value)
: comm(comm), source(source), tag(tag), ia(comm), value(value)
{
: comm(comm), source(source), tag(tag), ia(comm), value(value)
{
}
void deserialize(status& stat)
{
ia >> value;
void deserialize(status& stat)
{
ia >> value;
stat.m_count = 1;
}
@@ -1347,7 +1347,7 @@ namespace detail {
template<>
struct serialized_irecv_data<packed_iarchive>
{
serialized_irecv_data(const communicator& comm, int source, int tag,
serialized_irecv_data(const communicator& comm, int source, int tag,
packed_iarchive& ia)
: comm(comm), source(source), tag(tag), ia(ia) { }
@@ -1367,10 +1367,10 @@ namespace detail {
template<typename T>
struct serialized_array_irecv_data
{
serialized_array_irecv_data(const communicator& comm, int source, int tag,
serialized_array_irecv_data(const communicator& comm, int source, int tag,
T* values, int n)
: comm(comm), source(source), tag(tag), ia(comm), values(values), n(n)
{
{
}
void deserialize(status& stat);
@@ -1390,26 +1390,26 @@ namespace detail {
// Determine how much data we are going to receive
int count;
ia >> count;
// Deserialize the data in the message
boost::serialization::array<T> arr(values, count > n? n : count);
ia >> arr;
if (count > n) {
boost::throw_exception(
std::range_error("communicator::recv: message receive overflow"));
}
stat.m_count = count;
}
}
template<typename T>
optional<status>
optional<status>
request::handle_serialized_irecv(request* self, request_action action)
{
typedef detail::serialized_irecv_data<T> data_t;
shared_ptr<data_t> data = static_pointer_cast<data_t>(self->m_data);
std::shared_ptr<data_t> data = static_pointer_cast<data_t>(self->m_data);
if (action == ra_wait) {
status stat;
@@ -1421,7 +1421,7 @@ request::handle_serialized_irecv(request* self, request_action action)
data->ia.resize(data->count);
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(data->ia.address(), data->ia.size(), MPI_PACKED,
stat.source(), stat.tag(),
stat.source(), stat.tag(),
MPI_Comm(data->comm), self->m_requests + 1));
}
@@ -1444,11 +1444,11 @@ request::handle_serialized_irecv(request* self, request_action action)
data->ia.resize(data->count);
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(data->ia.address(), data->ia.size(),MPI_PACKED,
stat.source(), stat.tag(),
stat.source(), stat.tag(),
MPI_Comm(data->comm), self->m_requests + 1));
} else
return optional<status>(); // We have not finished yet
}
}
// Check if we have received the message data
BOOST_MPI_CHECK_RESULT(MPI_Test,
@@ -1456,7 +1456,7 @@ request::handle_serialized_irecv(request* self, request_action action)
if (flag) {
data->deserialize(stat);
return stat;
} else
} else
return optional<status>();
} else {
return optional<status>();
@@ -1464,11 +1464,11 @@ request::handle_serialized_irecv(request* self, request_action action)
}
template<typename T>
optional<status>
optional<status>
request::handle_serialized_array_irecv(request* self, request_action action)
{
typedef detail::serialized_array_irecv_data<T> data_t;
shared_ptr<data_t> data = static_pointer_cast<data_t>(self->m_data);
std::shared_ptr<data_t> data = static_pointer_cast<data_t>(self->m_data);
if (action == ra_wait) {
status stat;
@@ -1480,7 +1480,7 @@ request::handle_serialized_array_irecv(request* self, request_action action)
data->ia.resize(data->count);
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(data->ia.address(), data->ia.size(), MPI_PACKED,
stat.source(), stat.tag(),
stat.source(), stat.tag(),
MPI_Comm(data->comm), self->m_requests + 1));
}
@@ -1503,11 +1503,11 @@ request::handle_serialized_array_irecv(request* self, request_action action)
data->ia.resize(data->count);
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(data->ia.address(), data->ia.size(),MPI_PACKED,
stat.source(), stat.tag(),
stat.source(), stat.tag(),
MPI_Comm(data->comm), self->m_requests + 1));
} else
return optional<status>(); // We have not finished yet
}
}
// Check if we have received the message data
BOOST_MPI_CHECK_RESULT(MPI_Test,
@@ -1515,7 +1515,7 @@ request::handle_serialized_array_irecv(request* self, request_action action)
if (flag) {
data->deserialize(stat);
return stat;
} else
} else
return optional<status>();
} else {
return optional<status>();
@@ -1525,12 +1525,12 @@ request::handle_serialized_array_irecv(request* self, request_action action)
// We're receiving a type that has an associated MPI datatype, so we
// map directly to that datatype.
template<typename T>
request
request
communicator::irecv_impl(int source, int tag, T& value, mpl::true_) const
{
request req;
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(const_cast<T*>(&value), 1,
(const_cast<T*>(&value), 1,
get_mpi_datatype<T>(value),
source, tag, MPI_Comm(*this), &req.m_requests[0]));
return req;
@@ -1541,34 +1541,34 @@ request
communicator::irecv_impl(int source, int tag, T& value, mpl::false_) const
{
typedef detail::serialized_irecv_data<T> data_t;
shared_ptr<data_t> data(new data_t(*this, source, tag, value));
std::shared_ptr<data_t> data(new data_t(*this, source, tag, value));
request req;
req.m_data = data;
req.m_handler = request::handle_serialized_irecv<T>;
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(&data->count, 1,
(&data->count, 1,
get_mpi_datatype<std::size_t>(data->count),
source, tag, MPI_Comm(*this), &req.m_requests[0]));
return req;
}
template<typename T>
request
request
communicator::irecv(int source, int tag, T& value) const
{
return this->irecv_impl(source, tag, value, is_mpi_datatype<T>());
}
template<typename T>
request
communicator::array_irecv_impl(int source, int tag, T* values, int n,
request
communicator::array_irecv_impl(int source, int tag, T* values, int n,
mpl::true_) const
{
request req;
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(const_cast<T*>(values), n,
(const_cast<T*>(values), n,
get_mpi_datatype<T>(*values),
source, tag, MPI_Comm(*this), &req.m_requests[0]));
return req;
@@ -1576,17 +1576,17 @@ communicator::array_irecv_impl(int source, int tag, T* values, int n,
template<typename T>
request
communicator::array_irecv_impl(int source, int tag, T* values, int n,
communicator::array_irecv_impl(int source, int tag, T* values, int n,
mpl::false_) const
{
typedef detail::serialized_array_irecv_data<T> data_t;
shared_ptr<data_t> data(new data_t(*this, source, tag, values, n));
std::shared_ptr<data_t> data(new data_t(*this, source, tag, values, n));
request req;
req.m_data = data;
req.m_handler = request::handle_serialized_array_irecv<T>;
BOOST_MPI_CHECK_RESULT(MPI_Irecv,
(&data->count, 1,
(&data->count, 1,
get_mpi_datatype<std::size_t>(data->count),
source, tag, MPI_Comm(*this), &req.m_requests[0]));
@@ -1657,7 +1657,7 @@ communicator::recv<content>(int source, int tag,
content& c) const
{
return recv<const content>(source,tag,c);
}
}
/**
* INTERNAL ONLY

View File

@@ -45,7 +45,7 @@ template<typename T>
request
communicator::isend(int dest, int tag, const skeleton_proxy<T>& proxy) const
{
shared_ptr<packed_skeleton_oarchive>
std::shared_ptr<packed_skeleton_oarchive>
archive(new packed_skeleton_oarchive(*this));
*archive << proxy.object;
@@ -58,13 +58,13 @@ namespace detail {
template<typename T>
struct serialized_irecv_data<const skeleton_proxy<T> >
{
serialized_irecv_data(const communicator& comm, int source, int tag,
serialized_irecv_data(const communicator& comm, int source, int tag,
skeleton_proxy<T> proxy)
: comm(comm), source(source), tag(tag), isa(comm),
: comm(comm), source(source), tag(tag), isa(comm),
ia(isa.get_skeleton()), proxy(proxy) { }
void deserialize(status& stat)
{
void deserialize(status& stat)
{
isa >> proxy.object;
stat.m_count = 1;
}
@@ -84,7 +84,7 @@ namespace detail {
{
typedef serialized_irecv_data<const skeleton_proxy<T> > inherited;
serialized_irecv_data(const communicator& comm, int source, int tag,
serialized_irecv_data(const communicator& comm, int source, int tag,
const skeleton_proxy<T>& proxy)
: inherited(comm, source, tag, proxy) { }
};

View File

@@ -59,7 +59,7 @@ class BOOST_MPI_DECL graph_communicator : public communicator
* underlying MPI_Comm. This operation is used for "casting" from a
* communicator to a graph communicator.
*/
explicit graph_communicator(const shared_ptr<MPI_Comm>& comm_ptr)
explicit graph_communicator(const std::shared_ptr<MPI_Comm>& comm_ptr)
{
#ifndef BOOST_DISABLE_ASSERTS
int status;
@@ -99,7 +99,7 @@ public:
*/
graph_communicator(const MPI_Comm& comm, comm_create_kind kind)
: communicator(comm, kind)
{
{
#ifndef BOOST_DISABLE_ASSERTS
int status;
BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status));
@@ -116,8 +116,8 @@ public:
* resulting communicator will be a NULL communicator.
*
* @param comm The communicator that the new, graph communicator
* will be based on.
*
* will be based on.
*
* @param graph Any type that meets the requirements of the
* Incidence Graph and Vertex List Graph concepts from the Boost Graph
* Library. This structure of this graph will become the topology
@@ -130,8 +130,8 @@ public:
* within the original communicator.
*/
template<typename Graph>
explicit
graph_communicator(const communicator& comm, const Graph& graph,
explicit
graph_communicator(const communicator& comm, const Graph& graph,
bool reorder = false);
/**
@@ -145,7 +145,7 @@ public:
* @param comm The communicator that the new, graph communicator
* will be based on. The ranks in @c rank refer to the processes in
* this communicator.
*
*
* @param graph Any type that meets the requirements of the
* Incidence Graph and Vertex List Graph concepts from the Boost Graph
* Library. This structure of this graph will become the topology
@@ -164,8 +164,8 @@ public:
* within the original communicator.
*/
template<typename Graph, typename RankMap>
explicit
graph_communicator(const communicator& comm, const Graph& graph,
explicit
graph_communicator(const communicator& comm, const Graph& graph,
RankMap rank, bool reorder = false);
protected:
@@ -177,7 +177,7 @@ protected:
*/
template<typename Graph, typename RankMap>
void
setup_graph(const communicator& comm, const Graph& graph, RankMap rank,
setup_graph(const communicator& comm, const Graph& graph, RankMap rank,
bool reorder);
};
@@ -186,16 +186,16 @@ protected:
****************************************************************************/
template<typename Graph>
graph_communicator::graph_communicator(const communicator& comm,
const Graph& graph,
graph_communicator::graph_communicator(const communicator& comm,
const Graph& graph,
bool reorder)
{
this->setup_graph(comm, graph, get(vertex_index, graph), reorder);
}
template<typename Graph, typename RankMap>
graph_communicator::graph_communicator(const communicator& comm,
const Graph& graph,
graph_communicator::graph_communicator(const communicator& comm,
const Graph& graph,
RankMap rank, bool reorder)
{
this->setup_graph(comm, graph, rank, reorder);
@@ -204,7 +204,7 @@ graph_communicator::graph_communicator(const communicator& comm,
template<typename Graph, typename RankMap>
void
graph_communicator::setup_graph(const communicator& comm, const Graph& graph,
graph_communicator::setup_graph(const communicator& comm, const Graph& graph,
RankMap rank, bool reorder)
{
typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor;
@@ -234,7 +234,7 @@ graph_communicator::setup_graph(const communicator& comm, const Graph& graph,
// Create the new communicator
MPI_Comm newcomm;
BOOST_MPI_CHECK_RESULT(MPI_Graph_create,
((MPI_Comm)comm,
((MPI_Comm)comm,
nvertices,
&indices[0],
edges.empty()? (int*)0 : &edges[0],
@@ -254,10 +254,10 @@ namespace detail {
* communicator's graph topology.
*/
class comm_out_edge_iterator
: public iterator_facade<comm_out_edge_iterator,
: public iterator_facade<comm_out_edge_iterator,
std::pair<int, int>,
random_access_traversal_tag,
const std::pair<int, int>&,
const std::pair<int, int>&,
int>
{
public:
@@ -304,10 +304,10 @@ namespace detail {
* communicator's graph topology.
*/
class comm_adj_iterator
: public iterator_facade<comm_adj_iterator,
: public iterator_facade<comm_adj_iterator,
int,
random_access_traversal_tag,
int,
int,
int>
{
public:
@@ -349,10 +349,10 @@ namespace detail {
* topology.
*/
class comm_edge_iterator
: public iterator_facade<comm_edge_iterator,
: public iterator_facade<comm_edge_iterator,
std::pair<int, int>,
forward_traversal_tag,
const std::pair<int, int>&,
const std::pair<int, int>&,
int>
{
public:
@@ -381,9 +381,9 @@ namespace detail {
return edge_index == other.edge_index;
}
void increment()
{
++edge_index;
void increment()
{
++edge_index;
}
shared_array<int> indices;
@@ -478,7 +478,7 @@ int num_edges(const graph_communicator& comm);
/**
* @brief Returns a property map that maps from vertices in a
* communicator's graph topology to their index values.
* communicator's graph topology to their index values.
*
* Since the vertices are ranks in the communicator, the returned
* property map is the identity property map.
@@ -522,16 +522,16 @@ struct graph_traits<mpi::graph_communicator> {
typedef std::pair<int, int> edge_descriptor;
typedef directed_tag directed_category;
typedef disallow_parallel_edge_tag edge_parallel_category;
/**
* INTERNAL ONLY
*/
struct traversal_category
: incidence_graph_tag,
adjacency_graph_tag,
vertex_list_graph_tag,
edge_list_graph_tag
{
: incidence_graph_tag,
adjacency_graph_tag,
vertex_list_graph_tag,
edge_list_graph_tag
{
};
/**

View File

@@ -16,7 +16,7 @@
#define BOOST_MPI_GROUP_HPP
#include <boost/mpi/exception.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/optional.hpp>
#include <vector>
@@ -62,7 +62,7 @@ public:
/**
* @brief Determine the rank of the calling process in the group.
*
*
* This routine is equivalent to @c MPI_Group_rank.
*
* @returns The rank of the calling process in the group, which will
@@ -167,11 +167,11 @@ public:
*
* @returns A new group containing all of the processes in the
* current group except those processes with ranks @c [first, last)
* in the current group.
* in the current group.
*/
template<typename InputIterator>
group exclude(InputIterator first, InputIterator last);
protected:
/**
@@ -179,7 +179,7 @@ protected:
*
* Function object that frees an MPI group and deletes the
* memory associated with it. Intended to be used as a deleter with
* shared_ptr.
* std::shared_ptr.
*/
struct group_free
{
@@ -199,7 +199,7 @@ protected:
* @c group class. When there are no more such instances, the group
* will be automatically freed.
*/
shared_ptr<MPI_Group> group_ptr;
std::shared_ptr<MPI_Group> group_ptr;
};
/**
@@ -223,7 +223,7 @@ BOOST_MPI_DECL bool operator==(const group& g1, const group& g2);
* processes in the same order.
*/
inline bool operator!=(const group& g1, const group& g2)
{
{
return !(g1 == g2);
}
@@ -260,7 +260,7 @@ BOOST_MPI_DECL group operator-(const group& g1, const group& g2);
* Implementation details *
************************************************************************/
template<typename InputIterator, typename OutputIterator>
OutputIterator
OutputIterator
group::translate_ranks(InputIterator first, InputIterator last,
const group& to_group, OutputIterator out)
{
@@ -283,11 +283,11 @@ group::translate_ranks(InputIterator first, InputIterator last,
/**
* INTERNAL ONLY
*
*
* Specialization of translate_ranks that handles the one case where
* we can avoid any memory allocation or copying.
*/
template<>
template<>
BOOST_MPI_DECL int*
group::translate_ranks(int* first, int* last, const group& to_group, int* out);
@@ -306,7 +306,7 @@ group group::include(InputIterator first, InputIterator last)
/**
* INTERNAL ONLY
*
*
* Specialization of group::include that handles the one case where we
* can avoid any memory allocation or copying before creating the
* group.
@@ -328,7 +328,7 @@ group group::exclude(InputIterator first, InputIterator last)
/**
* INTERNAL ONLY
*
*
* Specialization of group::exclude that handles the one case where we
* can avoid any memory allocation or copying before creating the
* group.

View File

@@ -24,7 +24,7 @@ namespace boost { namespace mpi {
*
* Forward declaration of the MPI "group" representation, for use in
* the description of the @c intercommunicator class.
*/
*/
class group;
/**
@@ -45,8 +45,8 @@ class group;
* intercommunicators occurs between the processes in the local group
* and the processes in the remote group; communication within a group
* must use a different (intra-)communicator.
*
*/
*
*/
class BOOST_MPI_DECL intercommunicator : public communicator
{
private:
@@ -59,7 +59,7 @@ private:
* underlying MPI_Comm. This operation is used for "casting" from a
* communicator to an intercommunicator.
*/
explicit intercommunicator(const shared_ptr<MPI_Comm>& cp)
explicit intercommunicator(const std::shared_ptr<MPI_Comm>& cp)
{
this->comm_ptr = cp;
}
@@ -149,7 +149,7 @@ public:
* Merge the local and remote groups in this intercommunicator into
* a new intracommunicator containing the union of the processes in
* both groups. This method is equivalent to @c MPI_Intercomm_merge.
*
*
* @param high Whether the processes in this group should have the
* higher rank numbers than the processes in the other group. Each
* of the processes within a particular group shall have the same

View File

@@ -14,7 +14,7 @@
#include <boost/mpi/config.hpp>
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/mpi/packed_iarchive.hpp>
namespace boost { namespace mpi {
@@ -29,7 +29,7 @@ class communicator;
* receive and will be returned from @c isend or @c irecv,
* respectively.
*/
class BOOST_MPI_DECL request
class BOOST_MPI_DECL request
{
public:
/**
@@ -62,7 +62,7 @@ class BOOST_MPI_DECL request
private:
enum request_action { ra_wait, ra_test, ra_cancel };
typedef optional<status> (*handler_type)(request* self,
typedef optional<status> (*handler_type)(request* self,
request_action action);
/**
@@ -71,7 +71,7 @@ class BOOST_MPI_DECL request
* Handles the non-blocking receive of a serialized value.
*/
template<typename T>
static optional<status>
static optional<status>
handle_serialized_irecv(request* self, request_action action);
/**
@@ -80,7 +80,7 @@ class BOOST_MPI_DECL request
* Handles the non-blocking receive of an array of serialized values.
*/
template<typename T>
static optional<status>
static optional<status>
handle_serialized_array_irecv(request* self, request_action action);
public: // template friends are not portable
@@ -92,7 +92,7 @@ class BOOST_MPI_DECL request
handler_type m_handler;
/// INTERNAL ONLY
shared_ptr<void> m_data;
std::shared_ptr<void> m_data;
friend class communicator;
};

View File

@@ -31,7 +31,7 @@
#include <boost/mpi/detail/forward_skeleton_oarchive.hpp>
#include <boost/mpi/detail/ignore_iprimitive.hpp>
#include <boost/mpi/detail/ignore_oprimitive.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/archive/detail/register_archive.hpp>
namespace boost { namespace mpi {
@@ -197,7 +197,7 @@ public:
}
private:
boost::shared_ptr<detail::mpi_datatype_holder> holder;
boost::std::shared_ptr<detail::mpi_datatype_holder> holder;
};
/** @brief Returns the content of an object, suitable for transmission

View File

@@ -8,7 +8,7 @@
//
// typename pointee<P>::type provides the pointee type of P.
//
// For example, it is T for T* and X for shared_ptr<X>.
// For example, it is T for T* and X for std::shared_ptr<X>.
//
// http://www.boost.org/libs/iterator/doc/pointee.html
//
@@ -20,7 +20,7 @@
# include <boost/mpl/if.hpp>
# include <boost/mpl/eval_if.hpp>
namespace boost {
namespace boost {
namespace detail
{
@@ -34,25 +34,25 @@ namespace detail
struct iterator_pointee
{
typedef typename iterator_traits<Iterator>::value_type value_type;
struct impl
{
template <class T>
static char test(T const&);
static char (& test(value_type&) )[2];
static Iterator& x;
};
BOOST_STATIC_CONSTANT(bool, is_constant = sizeof(impl::test(*impl::x)) == 1);
typedef typename mpl::if_c<
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
::boost::detail::iterator_pointee<Iterator>::is_constant
# else
is_constant
# endif
# endif
, typename add_const<value_type>::type
, value_type
>::type type;
@@ -68,7 +68,7 @@ struct pointee
>
{
};
} // namespace boost
#endif // POINTEE_DWA200415_HPP

View File

@@ -25,7 +25,7 @@
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
@@ -38,7 +38,7 @@ namespace boost { namespace program_options { namespace detail {
for(; i !=e; ++i) {
*i;
}
Syntax conventions:
- config file can not contain positional options
@@ -47,10 +47,10 @@ namespace boost { namespace program_options { namespace detail {
- variable assignments are in the form
name '=' value.
spaces around '=' are trimmed.
- Section names are given in brackets.
- Section names are given in brackets.
The actual option name is constructed by combining current section
name and specified option name, with dot between. If section_name
name and specified option name, with dot between. If section_name
already contains dot at the end, new dot is not inserted. For example:
@verbatim
[gui.accessibility]
@@ -61,8 +61,8 @@ namespace boost { namespace program_options { namespace detail {
TODO: maybe, we should just accept a pointer to options_description
class.
*/
class common_config_file_iterator
*/
class common_config_file_iterator
: public eof_iterator<common_config_file_iterator, option>
{
public:
@@ -74,9 +74,9 @@ namespace boost { namespace program_options { namespace detail {
virtual ~common_config_file_iterator() {}
public: // Method required by eof_iterator
void get();
protected: // Stubs for derived classes
// Obtains next line from the config file
@@ -85,7 +85,7 @@ namespace boost { namespace program_options { namespace detail {
// constructor of this class, but to avoid templating this class
// we'd need polymorphic iterator, which does not exist yet.
virtual bool getline(std::string&) { return false; }
private:
/** Adds another allowed option. If the 'name' ends with
'*', then all options with the same prefix are
@@ -94,7 +94,7 @@ namespace boost { namespace program_options { namespace detail {
void add_option(const char* name);
// Returns true if 's' is a registered option name.
bool allowed_option(const std::string& s) const;
bool allowed_option(const std::string& s) const;
// That's probably too much data for iterator, since
// it will be copied, but let's not bother for now.
@@ -113,20 +113,20 @@ namespace boost { namespace program_options { namespace detail {
found_eof();
}
/** Creates a config file parser for the specified stream.
/** Creates a config file parser for the specified stream.
*/
basic_config_file_iterator(std::basic_istream<charT>& is,
basic_config_file_iterator(std::basic_istream<charT>& is,
const std::set<std::string>& allowed_options,
bool allow_unregistered = false);
bool allow_unregistered = false);
private: // base overrides
bool getline(std::string&);
private: // internal data
shared_ptr<std::basic_istream<charT> > is;
std::shared_ptr<std::basic_istream<charT> > is;
};
typedef basic_config_file_iterator<char> config_file_iterator;
typedef basic_config_file_iterator<wchar_t> wconfig_file_iterator;
@@ -139,12 +139,12 @@ namespace boost { namespace program_options { namespace detail {
template<class charT>
basic_config_file_iterator<charT>::
basic_config_file_iterator(std::basic_istream<charT>& is,
basic_config_file_iterator(std::basic_istream<charT>& is,
const std::set<std::string>& allowed_options,
bool allow_unregistered)
: common_config_file_iterator(allowed_options, allow_unregistered)
{
this->is.reset(&is, null_deleter());
this->is.reset(&is, null_deleter());
get();
}
@@ -173,7 +173,7 @@ namespace boost { namespace program_options { namespace detail {
basic_config_file_iterator<wchar_t>::getline(std::string& s);
#endif
}}}

View File

@@ -13,7 +13,7 @@
#include <boost/program_options/value_semantic.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/any.hpp>
@@ -27,12 +27,12 @@
#if defined(BOOST_MSVC)
# pragma warning (push)
# pragma warning (disable:4251) // class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'boost::program_options::option_description'
# pragma warning (disable:4251) // class 'boost::std::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'boost::program_options::option_description'
#endif
/** Boost namespace */
namespace boost {
namespace boost {
/** Namespace for the library. */
namespace program_options {
@@ -67,7 +67,7 @@ namespace program_options {
So, we have to use plain old pointers. Besides, users are not
expected to use the constructor directly.
The 'name' parameter is interpreted by the following rules:
- if there's no "," character in 'name', it specifies long name
- otherwise, the part before "," specifies long name and the part
@@ -76,7 +76,7 @@ namespace program_options {
option_description(const char* name,
const value_semantic* s);
/** Initializes the class with the passed data.
/** Initializes the class with the passed data.
*/
option_description(const char* name,
const value_semantic* s,
@@ -118,9 +118,9 @@ namespace program_options {
const std::string& description() const;
/// Semantic of option's value
shared_ptr<const value_semantic> semantic() const;
/// Returns the option name, formatted suitably for usage message.
std::shared_ptr<const value_semantic> semantic() const;
/// Returns the option name, formatted suitably for usage message.
std::string format_name() const;
/** Returns the parameter name and properties, formatted suitably for
@@ -128,19 +128,19 @@ namespace program_options {
std::string format_parameter() const;
private:
option_description& set_name(const char* name);
std::string m_short_name, m_long_name, m_description;
// shared_ptr is needed to simplify memory management in
// std::shared_ptr is needed to simplify memory management in
// copy ctor and destructor.
shared_ptr<const value_semantic> m_value_semantic;
std::shared_ptr<const value_semantic> m_value_semantic;
};
class options_description;
/** Class which provides convenient creation syntax to option_description.
*/
/** Class which provides convenient creation syntax to option_description.
*/
class BOOST_PROGRAM_OPTIONS_DECL options_description_easy_init {
public:
options_description_easy_init(options_description* owner);
@@ -152,12 +152,12 @@ namespace program_options {
options_description_easy_init&
operator()(const char* name,
const value_semantic* s);
options_description_easy_init&
operator()(const char* name,
const value_semantic* s,
const char* description);
private:
options_description* owner;
};
@@ -166,14 +166,14 @@ namespace program_options {
/** A set of option descriptions. This provides convenient interface for
adding new option (the add_options) method, and facilities to search
for options by name.
See @ref a_adding_options "here" for option adding interface discussion.
@sa option_description
*/
class BOOST_PROGRAM_OPTIONS_DECL options_description {
public:
static const unsigned m_default_line_length;
/** Creates the instance. */
options_description(unsigned line_length = m_default_line_length,
unsigned min_description_length = m_default_line_length / 2);
@@ -188,11 +188,11 @@ namespace program_options {
unsigned line_length = m_default_line_length,
unsigned min_description_length = m_default_line_length / 2);
/** Adds new variable description. Throws duplicate_variable_error if
either short or long name matches that of already present one.
either short or long name matches that of already present one.
*/
void add(shared_ptr<option_description> desc);
void add(std::shared_ptr<option_description> desc);
/** Adds a group of option description. This has the same
effect as adding all option_descriptions in 'desc'
effect as adding all option_descriptions in 'desc'
individually, except that output operator will show
a separate group.
Returns *this.
@@ -202,29 +202,29 @@ namespace program_options {
public:
/** Returns an object of implementation-defined type suitable for adding
options to options_description. The returned object will
have overloaded operator() with parameter type matching
have overloaded operator() with parameter type matching
'option_description' constructors. Calling the operator will create
new option_description instance and add it.
*/
options_description_easy_init add_options();
const option_description& find(const std::string& name,
bool approx,
const option_description& find(const std::string& name,
bool approx,
bool long_ignore_case = false,
bool short_ignore_case = false) const;
const option_description* find_nothrow(const std::string& name,
const option_description* find_nothrow(const std::string& name,
bool approx,
bool long_ignore_case = false,
bool short_ignore_case = false) const;
const std::vector< shared_ptr<option_description> >& options() const;
const std::vector< std::shared_ptr<option_description> >& options() const;
/** Produces a human readable output of 'desc', listing options,
their descriptions and allowed parameters. Other options_description
instances previously passed to add will be output separately. */
friend BOOST_PROGRAM_OPTIONS_DECL std::ostream& operator<<(std::ostream& os,
friend BOOST_PROGRAM_OPTIONS_DECL std::ostream& operator<<(std::ostream& os,
const options_description& desc);
/** Outputs 'desc' to the specified stream, calling 'f' to output each
@@ -233,7 +233,7 @@ namespace program_options {
private:
typedef std::map<std::string, int>::const_iterator name2index_iterator;
typedef std::pair<name2index_iterator, name2index_iterator>
typedef std::pair<name2index_iterator, name2index_iterator>
approximation_range;
//approximation_range find_approximation(const std::string& prefix) const;
@@ -241,11 +241,11 @@ namespace program_options {
std::string m_caption;
const unsigned m_line_length;
const unsigned m_min_description_length;
// Data organization is chosen because:
// - there could be two names for one option
// - option_add_proxy needs to know the last added option
std::vector< shared_ptr<option_description> > m_options;
std::vector< std::shared_ptr<option_description> > m_options;
// Whether the option comes from one of declared groups.
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(313))
@@ -256,7 +256,7 @@ namespace program_options {
std::vector<bool> belong_to_group;
#endif
std::vector< shared_ptr<options_description> > groups;
std::vector< std::shared_ptr<options_description> > groups;
};

View File

@@ -10,7 +10,7 @@
#include <boost/program_options/config.hpp>
#include <boost/any.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <string>
#include <map>
@@ -31,35 +31,35 @@ namespace boost { namespace program_options {
// forward declaration
/** Stores in 'm' all options that are defined in 'options'.
/** Stores in 'm' all options that are defined in 'options'.
If 'm' already has a non-defaulted value of an option, that value
is not changed, even if 'options' specify some value.
is not changed, even if 'options' specify some value.
*/
BOOST_PROGRAM_OPTIONS_DECL
BOOST_PROGRAM_OPTIONS_DECL
void store(const basic_parsed_options<char>& options, variables_map& m,
bool utf8 = false);
/** Stores in 'm' all options that are defined in 'options'.
/** Stores in 'm' all options that are defined in 'options'.
If 'm' already has a non-defaulted value of an option, that value
is not changed, even if 'options' specify some value.
is not changed, even if 'options' specify some value.
This is wide character variant.
*/
BOOST_PROGRAM_OPTIONS_DECL
void store(const basic_parsed_options<wchar_t>& options,
BOOST_PROGRAM_OPTIONS_DECL
void store(const basic_parsed_options<wchar_t>& options,
variables_map& m);
/** Runs all 'notify' function for options in 'm'. */
BOOST_PROGRAM_OPTIONS_DECL void notify(variables_map& m);
/** Class holding value of option. Contains details about how the
/** Class holding value of option. Contains details about how the
value is set and allows to conveniently obtain the value.
*/
class BOOST_PROGRAM_OPTIONS_DECL variable_value {
public:
variable_value() : m_defaulted(false) {}
variable_value(const boost::any& xv, bool xdefaulted)
: v(xv), m_defaulted(xdefaulted)
variable_value(const boost::any& xv, bool xdefaulted)
: v(xv), m_defaulted(xdefaulted)
{}
/** If stored value if of type T, returns that value. Otherwise,
@@ -92,10 +92,10 @@ namespace boost { namespace program_options {
// they are known only after all sources are stored. By that
// time options_description for the first source might not
// be easily accessible, so we need to store semantic here.
shared_ptr<const value_semantic> m_value_semantic;
std::shared_ptr<const value_semantic> m_value_semantic;
friend BOOST_PROGRAM_OPTIONS_DECL
void store(const basic_parsed_options<char>& options,
void store(const basic_parsed_options<char>& options,
variables_map& m, bool);
friend BOOST_PROGRAM_OPTIONS_DECL class variables_map;
@@ -138,8 +138,8 @@ namespace boost { namespace program_options {
const abstract_variables_map* m_next;
};
/** Concrete variables map which store variables in real map.
/** Concrete variables map which store variables in real map.
This class is derived from std::map<std::string, variable_value>,
so you can use all map operators to examine its content.
*/
@@ -155,8 +155,8 @@ namespace boost { namespace program_options {
{ return abstract_variables_map::operator[](name); }
// Override to clear some extra fields.
void clear();
void clear();
void notify();
private:
@@ -169,10 +169,10 @@ namespace boost { namespace program_options {
std::set<std::string> m_final;
friend BOOST_PROGRAM_OPTIONS_DECL
void store(const basic_parsed_options<char>& options,
void store(const basic_parsed_options<char>& options,
variables_map& xm,
bool utf8);
/** Names of required options, filled by parser which has
access to options_description.
The map values are the "canonical" names for each corresponding option.

View File

@@ -206,9 +206,9 @@ private:
//
struct dynamic_properties
{
typedef std::multimap<std::string, boost::shared_ptr<dynamic_property_map> >
typedef std::multimap<std::string, boost::std::shared_ptr<dynamic_property_map> >
property_maps_type;
typedef boost::function3<boost::shared_ptr<dynamic_property_map>,
typedef boost::function3<boost::std::shared_ptr<dynamic_property_map>,
const std::string&,
const boost::any&,
const boost::any&> generate_fn_type;
@@ -226,7 +226,7 @@ public:
dynamic_properties&
property(const std::string& name, PropertyMap property_map_)
{
boost::shared_ptr<dynamic_property_map> pm(
boost::std::shared_ptr<dynamic_property_map> pm(
boost::static_pointer_cast<dynamic_property_map>(
boost::make_shared<detail::dynamic_property_map_adaptor<PropertyMap> >(property_map_)));
property_maps.insert(property_maps_type::value_type(name, pm));
@@ -246,13 +246,13 @@ public:
{ return property_maps.lower_bound(name); }
void
insert(const std::string& name, boost::shared_ptr<dynamic_property_map> pm)
insert(const std::string& name, boost::std::shared_ptr<dynamic_property_map> pm)
{
property_maps.insert(property_maps_type::value_type(name, pm));
}
template<typename Key, typename Value>
boost::shared_ptr<dynamic_property_map>
boost::std::shared_ptr<dynamic_property_map>
generate(const std::string& name, const Key& key, const Value& value)
{
if(!generate_fn) {
@@ -280,7 +280,7 @@ put(const std::string& name, dynamic_properties& dp, const Key& key,
}
}
boost::shared_ptr<dynamic_property_map> new_map = dp.generate(name, key, value);
boost::std::shared_ptr<dynamic_property_map> new_map = dp.generate(name, key, value);
if (new_map.get()) {
new_map->put(key, value);
dp.insert(name, new_map);
@@ -290,7 +290,7 @@ put(const std::string& name, dynamic_properties& dp, const Key& key,
}
}
#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
template<typename Value, typename Key>
Value
get(const std::string& name, const dynamic_properties& dp, const Key& key)
@@ -333,11 +333,11 @@ get(const std::string& name, const dynamic_properties& dp, const Key& key)
// The easy way to ignore properties.
inline
boost::shared_ptr<boost::dynamic_property_map>
boost::std::shared_ptr<boost::dynamic_property_map>
ignore_other_properties(const std::string&,
const boost::any&,
const boost::any&) {
return boost::shared_ptr<boost::dynamic_property_map>();
return boost::std::shared_ptr<boost::dynamic_property_map>();
}
} // namespace boost

View File

@@ -23,7 +23,7 @@
#include <boost/assert.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/optional.hpp>
#include <boost/graph/parallel/process_group.hpp>
@@ -93,10 +93,10 @@ namespace detail {
template<typename PropertyMap, typename Key, typename Value>
static inline void
do_put(PropertyMap pm, const Key& key, const Value& value)
{
{
using boost::put;
put(pm, key, value);
put(pm, key, value);
}
};
@@ -240,7 +240,7 @@ class distributed_property_map
property_map_put,
/** A request to retrieve a particular value in a property
* map. The message contains a key. The owner of that key will
* map. The message contains a key. The owner of that key will
* reply with a value.
*/
property_map_get,
@@ -377,7 +377,7 @@ class distributed_property_map
reference operator[](const key_type& key) const
{
owner_local_pair p = get(data->global, key);
if (p.first == process_id(data->process_group)) {
return data->storage[p.second];
} else {
@@ -397,11 +397,11 @@ class distributed_property_map
* \internal
*
*/
void
void
request_put(process_id_type p, const key_type& k, const value_type& v) const
{
send(data->process_group, p, property_map_put,
boost::parallel::detail::make_untracked_pair(k, v));
{
send(data->process_group, p, property_map_put,
boost::parallel::detail::make_untracked_pair(k, v));
}
/** Access the ghost cell for the given key.
@@ -419,11 +419,11 @@ class distributed_property_map
struct data_t
{
data_t(const ProcessGroup& pg, const GlobalMap& global,
data_t(const ProcessGroup& pg, const GlobalMap& global,
const StorageMap& pm, const function1<value_type, key_type>& dv,
bool has_default_resolver)
: process_group(pg), global(global), storage(pm),
ghost_cells(), max_ghost_cells(1000000), get_default_value(dv),
: process_group(pg), global(global), storage(pm),
ghost_cells(), max_ghost_cells(1000000), get_default_value(dv),
has_default_resolver(has_default_resolver), model(cm_forward) { }
/// The process group
@@ -437,7 +437,7 @@ class distributed_property_map
StorageMap storage;
/// The ghost cells
shared_ptr<ghost_cells_type> ghost_cells;
std::shared_ptr<ghost_cells_type> ghost_cells;
/// The maximum number of ghost cells we are permitted to hold. If
/// zero, we are permitted to have an infinite number of ghost
@@ -478,7 +478,7 @@ class distributed_property_map
};
friend struct data_t;
shared_ptr<data_t> data;
std::shared_ptr<data_t> data;
private:
// Prunes the least recently used ghost cells until we have @c
@@ -493,36 +493,36 @@ class distributed_property_map
template<typename Reduce>
struct handle_message
{
explicit handle_message(const shared_ptr<data_t>& data,
explicit handle_message(const std::shared_ptr<data_t>& data,
const Reduce& reduce = Reduce())
: data_ptr(data), reduce(reduce) { }
void operator()(process_id_type source, int tag);
/// Individual message handlers
void
handle_put(int source, int tag,
const boost::parallel::detail::untracked_pair<key_type, value_type>& data,
void
handle_put(int source, int tag,
const boost::parallel::detail::untracked_pair<key_type, value_type>& data,
trigger_receive_context);
value_type
handle_get(int source, int tag, const key_type& data,
handle_get(int source, int tag, const key_type& data,
trigger_receive_context);
void
handle_multiget(int source, int tag,
handle_multiget(int source, int tag,
const std::vector<key_type>& data,
trigger_receive_context);
void
handle_multiget_reply
(int source, int tag,
(int source, int tag,
const std::vector<boost::parallel::detail::untracked_pair<key_type, value_type> >& msg,
trigger_receive_context);
void
handle_multiput
(int source, int tag,
(int source, int tag,
const std::vector<unsafe_pair<local_key_type, value_type> >& data,
trigger_receive_context);
@@ -537,7 +537,7 @@ class distributed_property_map
bidirectional consistency. */
struct on_synchronize
{
explicit on_synchronize(const shared_ptr<data_t>& data) : data_ptr(data) { }
explicit on_synchronize(const std::shared_ptr<data_t>& data) : data_ptr(data) { }
void operator()();
@@ -581,7 +581,7 @@ get(const PBGL_DISTRIB_PMAP& pm,
{
using boost::get;
typename property_traits<GlobalMap>::value_type p =
typename property_traits<GlobalMap>::value_type p =
get(pm.data->global, key);
if (p.first == process_id(pm.data->process_group)) {
@@ -609,13 +609,13 @@ put(const PBGL_DISTRIB_PMAP& pm,
{
using boost::put;
typename property_traits<GlobalMap>::value_type p =
typename property_traits<GlobalMap>::value_type p =
get(pm.data->global, key);
if (p.first == process_id(pm.data->process_group)) {
put(pm.data->storage, p.second, value);
} else {
if (pm.data->model & cm_forward)
if (pm.data->model & cm_forward)
pm.request_put(p.first, key, value);
pm.cell(key, false) = value;
@@ -637,7 +637,7 @@ local_put(const PBGL_DISTRIB_PMAP& pm,
{
using boost::put;
typename property_traits<GlobalMap>::value_type p =
typename property_traits<GlobalMap>::value_type p =
get(pm.data->global, key);
if (p.first == process_id(pm.data->process_group))
@@ -669,7 +669,7 @@ synchronize(PBGL_DISTRIB_PMAP& pm)
/// Create a distributed property map.
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
inline distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
StorageMap storage)
{
typedef distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
@@ -680,10 +680,10 @@ make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
/**
* \overload
*/
template<typename ProcessGroup, typename GlobalMap, typename StorageMap,
template<typename ProcessGroup, typename GlobalMap, typename StorageMap,
typename Reduce>
inline distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
StorageMap storage, Reduce reduce)
{
typedef distributed_property_map<ProcessGroup, GlobalMap, StorageMap>

View File

@@ -15,7 +15,7 @@
#include <boost/property_map/property_map.hpp>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
namespace boost { namespace parallel {
@@ -29,7 +29,7 @@ public:
typedef readable_property_map_tag category;
template<typename ProcessGroup>
global_index_map(ProcessGroup pg, value_type num_local_indices,
global_index_map(ProcessGroup pg, value_type num_local_indices,
IndexMap index_map, GlobalMap global)
: index_map(index_map), global(global)
{
@@ -37,7 +37,7 @@ public:
starting_index.reset(new std::vector<value_type>(num_processes(pg) + 1));
send(pg, 0, 0, num_local_indices);
synchronize(pg);
// Populate starting_index in all processes
if (process_id(pg) == 0) {
(*starting_index)[0] = 0;
@@ -55,7 +55,7 @@ public:
}
}
friend inline value_type
friend inline value_type
get(const global_index_map& gim, const key_type& x)
{
using boost::get;
@@ -64,7 +64,7 @@ public:
}
private:
shared_ptr<std::vector<value_type> > starting_index;
std::shared_ptr<std::vector<value_type> > starting_index;
IndexMap index_map;
GlobalMap global;
};

View File

@@ -41,7 +41,7 @@ PBGL_DISTRIB_PMAP::~distributed_property_map() { }
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
template<typename Reduce>
void
void
PBGL_DISTRIB_PMAP::set_reduce(const Reduce& reduce)
{
typedef handle_message<Reduce> Handler;
@@ -69,7 +69,7 @@ void PBGL_DISTRIB_PMAP::prune_ghost_cells() const
// We need to flush values when we evict them.
boost::parallel::detail::untracked_pair<key_type, value_type> const& victim
= data->ghost_cells->back();
send(data->process_group, get(data->global, victim.first).first,
send(data->process_group, get(data->global, victim.first).first,
property_map_put, victim);
}
@@ -83,11 +83,11 @@ typename PBGL_DISTRIB_PMAP::value_type&
PBGL_DISTRIB_PMAP::cell(const key_type& key, bool request_if_missing) const
{
// Index by key
ghost_cells_key_index_type const& key_index
ghost_cells_key_index_type const& key_index
= data->ghost_cells->template get<1>();
// Search for the ghost cell by key, and project back to the sequence
iterator ghost_cell
iterator ghost_cell
= data->ghost_cells->template project<0>(key_index.find(key));
if (ghost_cell == data->ghost_cells->end()) {
value_type value;
@@ -97,13 +97,13 @@ PBGL_DISTRIB_PMAP::cell(const key_type& key, bool request_if_missing) const
value = data->get_default_value(key);
else if (request_if_missing)
// Request the actual value of this key from its owner
send_oob_with_reply(data->process_group, get(data->global, key).first,
send_oob_with_reply(data->process_group, get(data->global, key).first,
property_map_get, key, value);
else
value = value_type();
// Create a ghost cell containing the new value
ghost_cell
ghost_cell
= data->ghost_cells->push_front(std::make_pair(key, value)).first;
// If we need to, prune the ghost cells
@@ -129,12 +129,12 @@ template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
template<typename Reduce>
void
PBGL_DISTRIB_PMAP::handle_message<Reduce>::
handle_put(int /*source*/, int /*tag*/,
handle_put(int /*source*/, int /*tag*/,
const boost::parallel::detail::untracked_pair<key_type, value_type>& req, trigger_receive_context)
{
using boost::get;
shared_ptr<data_t> data(data_ptr);
std::shared_ptr<data_t> data(data_ptr);
owner_local_pair p = get(data->global, req.first);
BOOST_ASSERT(p.first == process_id(data->process_group));
@@ -149,12 +149,12 @@ template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
template<typename Reduce>
typename PBGL_DISTRIB_PMAP::value_type
PBGL_DISTRIB_PMAP::handle_message<Reduce>::
handle_get(int source, int /*tag*/, const key_type& key,
handle_get(int source, int /*tag*/, const key_type& key,
trigger_receive_context)
{
using boost::get;
shared_ptr<data_t> data(data_ptr);
std::shared_ptr<data_t> data(data_ptr);
BOOST_ASSERT(data);
owner_local_pair p = get(data->global, key);
@@ -168,7 +168,7 @@ PBGL_DISTRIB_PMAP::handle_message<Reduce>::
handle_multiget(int source, int tag, const std::vector<key_type>& keys,
trigger_receive_context)
{
shared_ptr<data_t> data(data_ptr);
std::shared_ptr<data_t> data(data_ptr);
BOOST_ASSERT(data);
typedef boost::parallel::detail::untracked_pair<key_type, value_type> key_value;
@@ -190,15 +190,15 @@ template<typename Reduce>
void
PBGL_DISTRIB_PMAP::handle_message<Reduce>::
handle_multiget_reply
(int source, int tag,
(int source, int tag,
const std::vector<boost::parallel::detail::untracked_pair<key_type, value_type> >& msg,
trigger_receive_context)
{
shared_ptr<data_t> data(data_ptr);
std::shared_ptr<data_t> data(data_ptr);
BOOST_ASSERT(data);
// Index by key
ghost_cells_key_index_type const& key_index
ghost_cells_key_index_type const& key_index
= data->ghost_cells->template get<1>();
std::size_t n = msg.size();
@@ -217,13 +217,13 @@ template<typename Reduce>
void
PBGL_DISTRIB_PMAP::handle_message<Reduce>::
handle_multiput
(int source, int tag,
(int source, int tag,
const std::vector<unsafe_pair<local_key_type, value_type> >& values,
trigger_receive_context)
{
using boost::get;
shared_ptr<data_t> data(data_ptr);
std::shared_ptr<data_t> data(data_ptr);
BOOST_ASSERT(data);
std::size_t n = values.size();
@@ -247,11 +247,11 @@ setup_triggers(process_group_type& pg)
simple_trigger(pg, property_map_put, this, &handle_message::handle_put);
simple_trigger(pg, property_map_get, this, &handle_message::handle_get);
simple_trigger(pg, property_map_multiget, this,
simple_trigger(pg, property_map_multiget, this,
&handle_message::handle_multiget);
simple_trigger(pg, property_map_multiget_reply, this,
simple_trigger(pg, property_map_multiget_reply, this,
&handle_message::handle_multiget_reply);
simple_trigger(pg, property_map_multiput, this,
simple_trigger(pg, property_map_multiput, this,
&handle_message::handle_multiput);
}
@@ -261,7 +261,7 @@ PBGL_DISTRIB_PMAP
::on_synchronize::operator()()
{
int stage=0; // we only get called at the start now
shared_ptr<data_t> data(data_ptr);
std::shared_ptr<data_t> data(data_ptr);
BOOST_ASSERT(data);
// Determine in which stage backward consistency messages should be sent.
@@ -371,7 +371,7 @@ void PBGL_DISTRIB_PMAP::data_t::refresh_ghost_cells()
for (process_size_type p = (id + 1) % n ; p != id ; p = (p + 1) % n) {
if (!keys[p].empty())
send(process_group, p, property_map_multiget, keys[p]);
}
}
}
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>

View File

@@ -11,29 +11,29 @@
#define VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
#include <boost/property_map/property_map.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <vector>
namespace boost {
template<typename T, typename IndexMap = identity_property_map>
class vector_property_map
: public boost::put_get_helper<
typename std::iterator_traits<
: public boost::put_get_helper<
typename std::iterator_traits<
typename std::vector<T>::iterator >::reference,
vector_property_map<T, IndexMap> >
{
public:
typedef typename property_traits<IndexMap>::key_type key_type;
typedef T value_type;
typedef typename std::iterator_traits<
typedef typename std::iterator_traits<
typename std::vector<T>::iterator >::reference reference;
typedef boost::lvalue_property_map_tag category;
vector_property_map(const IndexMap& index = IndexMap())
: store(new std::vector<T>()), index(index)
{}
vector_property_map(unsigned initial_size,
vector_property_map(unsigned initial_size,
const IndexMap& index = IndexMap())
: store(new std::vector<T>(initial_size)), index(index)
{}
@@ -57,15 +57,15 @@ namespace boost {
{
return store->end();
}
IndexMap& get_index_map() { return index; }
const IndexMap& get_index_map() const { return index; }
public:
// Copy ctor absent, default semantics is OK.
// Assignment operator absent, default semantics is OK.
// CONSIDER: not sure that assignment to 'index' is correct.
reference operator[](const key_type& v) const {
typename property_traits<IndexMap>::value_type i = get(index, v);
if (static_cast<unsigned>(i) >= store->size()) {
@@ -74,16 +74,16 @@ namespace boost {
return (*store)[i];
}
private:
// Conceptually, we have a vector of infinite size. For practical
// Conceptually, we have a vector of infinite size. For practical
// purposes, we start with an empty vector and grow it as needed.
// Note that we cannot store pointer to vector here -- we cannot
// store pointer to data, because if copy of property map resizes
// the vector, the pointer to data will be invalidated.
// the vector, the pointer to data will be invalidated.
// I wonder if class 'pmap_ref' is simply needed.
shared_ptr< std::vector<T> > store;
std::shared_ptr< std::vector<T> > store;
IndexMap index;
};
template<typename T, typename IndexMap>
vector_property_map<T, IndexMap>
make_vector_property_map(IndexMap index)
@@ -103,15 +103,15 @@ namespace boost {
* This specialization of @ref vector_property_map builds a
* distributed vector property map given the local index maps
* generated by distributed graph types that automatically have index
* properties.
* properties.
*
* This specialization is useful when creating external distributed
* property maps via the same syntax used to create external
* sequential property maps.
*/
template<typename T, typename ProcessGroup, typename GlobalMap,
template<typename T, typename ProcessGroup, typename GlobalMap,
typename StorageMap>
class vector_property_map<T,
class vector_property_map<T,
local_property_map<ProcessGroup, GlobalMap,
StorageMap> >
: public parallel::distributed_property_map<
@@ -119,7 +119,7 @@ class vector_property_map<T,
{
typedef vector_property_map<T, StorageMap> local_iterator_map;
typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
local_iterator_map> inherited;
typedef local_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type;
@@ -129,7 +129,7 @@ public:
: inherited(index.process_group(), index.global(),
local_iterator_map(index.base())) { }
vector_property_map(unsigned inital_size,
vector_property_map(unsigned inital_size,
const index_map_type& index = index_map_type())
: inherited(index.process_group(), index.global(),
local_iterator_map(inital_size, index.base())) { }
@@ -140,31 +140,31 @@ public:
* This specialization of @ref vector_property_map builds a
* distributed vector property map given the local index maps
* generated by distributed graph types that automatically have index
* properties.
* properties.
*
* This specialization is useful when creating external distributed
* property maps via the same syntax used to create external
* sequential property maps.
*/
template<typename T, typename ProcessGroup, typename GlobalMap,
template<typename T, typename ProcessGroup, typename GlobalMap,
typename StorageMap>
class vector_property_map<
T,
T,
parallel::distributed_property_map<
ProcessGroup,
GlobalMap,
StorageMap
>
>
>
: public parallel::distributed_property_map<
ProcessGroup, GlobalMap, vector_property_map<T, StorageMap> >
{
typedef vector_property_map<T, StorageMap> local_iterator_map;
typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
local_iterator_map> inherited;
typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
StorageMap>
index_map_type;
@@ -173,7 +173,7 @@ public:
: inherited(index.process_group(), index.global(),
local_iterator_map(index.base())) { }
vector_property_map(unsigned inital_size,
vector_property_map(unsigned inital_size,
const index_map_type& index = index_map_type())
: inherited(index.process_group(), index.global(),
local_iterator_map(inital_size, index.base())) { }

View File

@@ -19,9 +19,9 @@
namespace boost
{
/////////////////////////////////////////////////////////////////////////
// Clonable concept
// Clonable concept
/////////////////////////////////////////////////////////////////////////
template< class T >
inline T* new_clone( const T& r )
{
@@ -43,13 +43,13 @@ namespace boost
return r ? new_clone( *r ) : 0;
}
//
//
// @remark: to make new_clone() work
// with scope_ptr/shared_ptr ect.
// with scope_ptr/std::shared_ptr ect.
// simply overload for those types
// in the appropriate namespace.
//
//
template< class T >
inline void delete_clone( const T* r )
{
@@ -59,7 +59,7 @@ namespace boost
/////////////////////////////////////////////////////////////////////////
// CloneAllocator concept
/////////////////////////////////////////////////////////////////////////
struct heap_clone_allocator
{
template< class U >
@@ -77,7 +77,7 @@ namespace boost
};
struct view_clone_allocator
{
template< class U >

View File

@@ -16,12 +16,12 @@
namespace boost {
// You'll see shared_ptr mentioned in this header because we need to
// You'll see std::shared_ptr mentioned in this header because we need to
// note which types are shared_ptrs in their registrations, to
// implement special shared_ptr handling for rvalue conversions.
template <class T> class shared_ptr;
// implement special std::shared_ptr handling for rvalue conversions.
template <class T> class std::shared_ptr;
namespace python { namespace converter {
namespace python { namespace converter {
struct registration;
@@ -64,23 +64,23 @@ namespace detail
register_shared_ptr0(...)
{
}
template <class T>
inline void
register_shared_ptr0(shared_ptr<T>*)
register_shared_ptr0(std::shared_ptr<T>*)
{
registry::lookup_shared_ptr(type_id<shared_ptr<T> >());
registry::lookup_shared_ptr(type_id<std::shared_ptr<T> >());
}
template <class T>
inline void
register_shared_ptr1(T const volatile*)
{
detail::register_shared_ptr0((T*)0);
}
template <class T>
inline registration const&
inline registration const&
registry_lookup2(T&(*)())
{
detail::register_shared_ptr1((T*)0);
@@ -88,13 +88,13 @@ namespace detail
}
template <class T>
inline registration const&
inline registration const&
registry_lookup1(type<T>)
{
return registry_lookup2((T(*)())0);
}
inline registration const&
inline registration const&
registry_lookup1(type<const volatile void>)
{
detail::register_shared_ptr1((void*)0);

View File

@@ -15,7 +15,7 @@
# include <boost/detail/workaround.hpp>
namespace boost { namespace python { namespace converter {
namespace boost { namespace python { namespace converter {
struct lvalue_from_python_chain
{
@@ -36,7 +36,7 @@ struct BOOST_PYTHON_DECL registration
public: // member functions
explicit registration(type_info target, bool is_shared_ptr = false);
~registration();
// Convert the appropriately-typed data to Python
PyObject* to_python(void const volatile*) const;
@@ -44,7 +44,7 @@ struct BOOST_PYTHON_DECL registration
// exception if no class has been registered.
PyTypeObject* get_class_object() const;
// Return common denominator of the python class objects,
// Return common denominator of the python class objects,
// convertable to target. Inspects the m_class_object and the value_chains.
PyTypeObject const* expected_from_python_type() const;
PyTypeObject const* to_python_target_type() const;
@@ -57,7 +57,7 @@ struct BOOST_PYTHON_DECL registration
// The chain of eligible from_python converters when an rvalue is acceptable
rvalue_from_python_chain* rvalue_chain;
// The class object associated with this type
PyTypeObject* m_class_object;
@@ -66,14 +66,14 @@ struct BOOST_PYTHON_DECL registration
PyTypeObject const* (*m_to_python_target_type)();
// True iff this type is a shared_ptr. Needed for special rvalue
// True iff this type is a std::shared_ptr. Needed for special rvalue
// from_python handling.
const bool is_shared_ptr;
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
private:
void operator=(registration); // This is not defined, and just keeps MWCW happy.
# endif
# endif
};
//

View File

@@ -21,12 +21,12 @@ namespace registry
BOOST_PYTHON_DECL registration const& lookup(type_info);
// Get the registration corresponding to the type, creating it if
// necessary. Use this first when the type is a shared_ptr.
// necessary. Use this first when the type is a std::shared_ptr.
BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info);
// Return a pointer to the corresponding registration, if one exists
BOOST_PYTHON_DECL registration const* query(type_info);
BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0);
// Insert an lvalue from_python converter
@@ -39,7 +39,7 @@ namespace registry
, type_info
, PyTypeObject const* (*expected_pytype)() = 0
);
// Insert an rvalue from_python converter at the tail of the
// chain. Used for implicit conversions
BOOST_PYTHON_DECL void push_back(

View File

@@ -13,16 +13,16 @@
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
# include <boost/python/converter/pytype_function.hpp>
#endif
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
namespace boost { namespace python { namespace converter {
namespace boost { namespace python { namespace converter {
template <class T>
struct shared_ptr_from_python
{
shared_ptr_from_python()
{
converter::registry::insert(&convertible, &construct, type_id<shared_ptr<T> >()
converter::registry::insert(&convertible, &construct, type_id<std::shared_ptr<T> >()
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
, &converter::expected_from_python_type_direct<T>::get_pytype
#endif
@@ -34,26 +34,26 @@ struct shared_ptr_from_python
{
if (p == Py_None)
return p;
return converter::get_lvalue_from_python(p, registered<T>::converters);
}
static void construct(PyObject* source, rvalue_from_python_stage1_data* data)
{
void* const storage = ((converter::rvalue_from_python_storage<shared_ptr<T> >*)data)->storage.bytes;
void* const storage = ((converter::rvalue_from_python_storage<std::shared_ptr<T> >*)data)->storage.bytes;
// Deal with the "None" case.
if (data->convertible == source)
new (storage) shared_ptr<T>();
new (storage) std::shared_ptr<T>();
else
{
boost::shared_ptr<void> hold_convertible_ref_count(
boost::std::shared_ptr<void> hold_convertible_ref_count(
(void*)0, shared_ptr_deleter(handle<>(borrowed(source))) );
// use aliasing constructor
new (storage) shared_ptr<T>(
new (storage) std::shared_ptr<T>(
hold_convertible_ref_count,
static_cast<T*>(data->convertible));
}
data->convertible = storage;
}
};

View File

@@ -7,20 +7,20 @@
# include <boost/python/refcount.hpp>
# include <boost/python/converter/shared_ptr_deleter.hpp>
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
# include <boost/get_pointer.hpp>
namespace boost { namespace python { namespace converter {
namespace boost { namespace python { namespace converter {
template <class T>
PyObject* shared_ptr_to_python(shared_ptr<T> const& x)
PyObject* shared_ptr_to_python(std::shared_ptr<T> const& x)
{
if (!x)
return python::detail::none();
else if (shared_ptr_deleter* d = boost::get_deleter<shared_ptr_deleter>(x))
return incref( get_pointer( d->owner ) );
else
return converter::registered<shared_ptr<T> const&>::converters.to_python(&x);
return converter::registered<std::shared_ptr<T> const&>::converters.to_python(&x);
}
}}} // namespace boost::python::converter

View File

@@ -6,12 +6,12 @@
# define IS_SHARED_PTR_DWA2003224_HPP
# include <boost/python/detail/is_xxx.hpp>
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
namespace boost { namespace python { namespace detail {
namespace boost { namespace python { namespace detail {
BOOST_PYTHON_IS_XXX_DEF(std::shared_ptr, std::shared_ptr, 1)
BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1)
}}} // namespace boost::python::detail
#endif // IS_SHARED_PTR_DWA2003224_HPP

View File

@@ -6,12 +6,12 @@
# define VALUE_IS_SHARED_PTR_DWA2003224_HPP
# include <boost/python/detail/value_is_xxx.hpp>
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
namespace boost { namespace python { namespace detail {
namespace boost { namespace python { namespace detail {
BOOST_PYTHON_VALUE_IS_XXX_DEF(std::shared_ptr, std::shared_ptr, 1)
BOOST_PYTHON_VALUE_IS_XXX_DEF(shared_ptr, shared_ptr, 1)
}}} // namespace boost::python::detail
#endif // VALUE_IS_SHARED_PTR_DWA2003224_HPP

View File

@@ -11,7 +11,7 @@
# include <boost/python/type_id.hpp>
# include <cstddef>
namespace boost { namespace python {
namespace boost { namespace python {
// Base class for all holders
struct BOOST_PYTHON_DECL instance_holder : private noncopyable
@@ -19,13 +19,13 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable
public:
instance_holder();
virtual ~instance_holder();
// return the next holder in a chain
instance_holder* next() const;
// When the derived holder actually holds by [smart] pointer and
// null_ptr_only is set, only report that the type is held when
// the pointer is null. This is needed for proper shared_ptr
// the pointer is null. This is needed for proper std::shared_ptr
// support, to prevent holding shared_ptrs from being found when
// converting from python so that we can use the conversion method
// that always holds the Python object.
@@ -34,7 +34,7 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable
void install(PyObject* inst) throw();
// These functions should probably be located elsewhere.
// Allocate storage for an object of the given size at the given
// offset in the Python instance<> object if bytes are available
// there. Otherwise allocate size bytes of heap memory.

View File

@@ -7,12 +7,12 @@
# include <boost/python/type_id.hpp>
namespace boost { namespace python { namespace objects {
namespace boost { namespace python { namespace objects {
// Given a type_id, find the instance data which corresponds to it, or
// return 0 in case no such type is held. If null_shared_ptr_only is
// true and the type being sought is a shared_ptr, only find an
// instance if it turns out to be NULL. Needed for shared_ptr rvalue
// true and the type being sought is a std::shared_ptr, only find an
// instance if it turns out to be NULL. Needed for std::shared_ptr rvalue
// from_python support.
BOOST_PYTHON_DECL void* find_instance_impl(PyObject*, type_info, bool null_shared_ptr_only = false);

View File

@@ -6,7 +6,7 @@
# define INHERITANCE_DWA200216_HPP
# include <boost/python/type_id.hpp>
# include <boost/shared_ptr.hpp>
# include <boost/std::shared_ptr.hpp>
# include <boost/mpl/if.hpp>
# include <boost/type_traits/is_polymorphic.hpp>
# include <boost/type_traits/is_base_and_derived.hpp>
@@ -88,7 +88,7 @@ struct dynamic_cast_generator
return dynamic_cast<Target*>(
static_cast<Source*>(source));
}
};
template <class Source, class Target>

View File

@@ -23,9 +23,9 @@
# include <boost/mpl/bool.hpp>
# if defined(__ICL) && __ICL < 600
# include <boost/shared_ptr.hpp>
# else
# if defined(__ICL) && __ICL < 600
# include <boost/std::shared_ptr.hpp>
# else
# include <memory>
# endif
@@ -57,7 +57,7 @@ struct to_python_indirect
else
return this->execute(*ptr, mpl::false_());
}
template <class U>
inline PyObject* execute(U const& x, mpl::false_) const
{
@@ -84,9 +84,9 @@ namespace detail
// can't use auto_ptr with Intel 5 and VC6 Dinkum library
// for some reason. We get link errors against the auto_ptr
// copy constructor.
# if defined(__ICL) && __ICL < 600
typedef boost::shared_ptr<T> smart_pointer;
# else
# if defined(__ICL) && __ICL < 600
typedef boost::std::shared_ptr<T> smart_pointer;
# else
typedef std::auto_ptr<T> smart_pointer;
# endif
typedef objects::pointer_holder<smart_pointer, T> holder_t;

Some files were not shown because too many files have changed in this diff Show More