Skip to content

Commit ac5c9b3

Browse files
committed
Merge remote-tracking branch 'deanberris/master' into merge-std
2 parents a926ad4 + 51adc9e commit ac5c9b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1449
-1438
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ libs/mime/test/mime-roundtrip
1010
bin/
1111
tests/
1212
_build
13+
CPP-NETLIB.*
14+
CMakeScripts/
15+
*.cmake
1316
*~

CMakeLists.txt

+17-7
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ else()
2424
endif()
2525
set(Boost_USE_MULTITHREADED ON)
2626
if(CPP-NETLIB_BUILD_TESTS)
27-
set(Boost_COMPONENTS unit_test_framework system regex date_time thread chrono filesystem program_options )
27+
set(Boost_COMPONENTS unit_test_framework system regex date_time filesystem program_options )
2828
else()
29-
set(Boost_COMPONENTS system regex date_time thread chrono filesystem program_options )
29+
set(Boost_COMPONENTS system regex date_time filesystem program_options )
3030
endif()
3131
find_package( Boost 1.51 REQUIRED ${Boost_COMPONENTS} )
3232
find_package( OpenSSL )
@@ -45,7 +45,6 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
4545
INCLUDE(CheckCXXCompilerFlag)
4646
CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD0X)
4747
CHECK_CXX_COMPILER_FLAG(-std=c++11 HAVE_STD11)
48-
4948
if (HAVE_STD11)
5049
set(CMAKE_CXX_FLAGS -std=c++11)
5150
elseif (HAVE_STD0X)
@@ -54,12 +53,23 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
5453
message(FATAL_ERROR "No advanced standard C++ support (-std=c++0x and -std=c++11 not defined).")
5554
endif()
5655
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
57-
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
58-
set(CMAKE_CXX_LINK_FLAGS "-std=c++11 -stdlib=libc++")
59-
message("C++ Flags: ${CMAKE_CXX_FLAGS} link flags: ${CMAKE_CXX_LINK_FLAGS}")
56+
INCLUDE(CheckCXXCompilerFlag)
57+
CHECK_CXX_COMPILER_FLAG(-std=c++11 HAVE_STD11)
58+
if (HAVE_STD11)
59+
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
60+
set(CMAKE_CXX_LINK_FLAGS "-std=c++11 -stdlib=libc++")
61+
else()
62+
message(FATAL_ERROR "No C++11 support for Clang version. Please upgrade Clang to a version supporting C++11.")
63+
endif()
64+
add_definitions(
65+
-DASIO_HAS_MOVE -DASIO_HAS_VARIADIC_TEMPLATES -DASIO_HAS_STD_SYSTEM_ERROR
66+
-DASIO_ERROR_CATEGORY_NOEXCEPT=noexcept -DASIO_HAS_STD_ARRAY
67+
-DASIO_HAS_STD_SHARED_PTR -DASIO_HAS_STD_ATOMIC -DASIO_HAS_STD_CHRONO
68+
-DASIO_HAS_STD_ADDRESSOFF -DASIO_HAS_STD_FUNCTION -DASIO_HAS_STD_TYPE_TRAITS)
6069
endif()
6170

62-
71+
message("C++ Compiler ID: ${CMAKE_CXX_COMPILER_ID}")
72+
message("C++ Flags: ${CMAKE_CXX_FLAGS} link flags: ${CMAKE_CXX_LINK_FLAGS}")
6373
if (Boost_FOUND)
6474
if (MSVC)
6575
add_definitions(-D_SCL_SECURE_NO_WARNINGS)

include/network/message/directives/detail/string_value.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <network/traits/string.hpp>
1111
#include <network/support/is_async.hpp>
1212
#include <network/support/is_sync.hpp>
13-
#include <boost/thread/future.hpp>
13+
#include <future>
1414
#include <boost/type_traits/is_same.hpp>
1515
#include <boost/mpl/if.hpp>
1616
#include <boost/mpl/or.hpp>

include/network/message/message.hpp

+45-48
Original file line numberDiff line numberDiff line change
@@ -9,71 +9,68 @@
99

1010
#include <string>
1111
#include <map>
12-
#include <boost/function.hpp>
12+
#include <functional>
1313
#include <network/message/message_base.hpp>
1414
#include <boost/shared_container_iterator.hpp>
1515

1616
namespace network {
1717

18-
struct message_pimpl;
18+
struct message_pimpl;
1919

20-
// The common message type.
21-
struct message : message_base {
22-
// Nested types
23-
typedef boost::iterator_range<
20+
// The common message type.
21+
struct message : message_base {
22+
// Nested types
23+
typedef boost::iterator_range<
2424
std::multimap<std::string, std::string>::const_iterator>
2525
headers_range;
2626

27-
// Constructors
28-
message();
29-
message(message const & other);
27+
// Constructors
28+
message();
29+
message(message const & other);
30+
message(message && other) = default;
3031

31-
// Assignment
32-
message & operator=(message other);
32+
// Assignment
33+
message& operator=(message const &other);
34+
message& operator=(message &&other);
3335

34-
// Mutators
35-
virtual void set_destination(std::string const & destination);
36-
virtual void set_source(std::string const & source);
37-
virtual void append_header(std::string const & name,
38-
std::string const & value);
39-
virtual void remove_headers(std::string const & name);
40-
virtual void remove_headers();
41-
virtual void set_body(std::string const & body);
42-
virtual void append_body(std::string const & data);
36+
// Mutators
37+
virtual void set_destination(std::string const & destination);
38+
virtual void set_source(std::string const & source);
39+
virtual void append_header(std::string const & name,
40+
std::string const & value);
41+
virtual void remove_headers(std::string const & name);
42+
virtual void remove_headers();
43+
virtual void set_body(std::string const & body);
44+
virtual void append_body(std::string const & data);
4345

44-
// Retrievers
45-
virtual void get_destination(std::string & destination) const;
46-
virtual void get_source(std::string & source) const;
47-
virtual void get_headers(
48-
boost::function<void(std::string const &, std::string const &)> inserter) const;
49-
virtual void get_headers(
50-
std::string const & name,
51-
boost::function<void(std::string const &, std::string const &)> inserter) const;
52-
virtual void get_headers(
53-
boost::function<bool(std::string const &, std::string const &)> predicate,
54-
boost::function<void(std::string const &, std::string const &)> inserter) const;
55-
virtual void get_body(std::string & body) const;
56-
virtual void get_body(
57-
boost::function<void(boost::iterator_range<char const *>)> chunk_reader,
58-
size_t size) const;
46+
// Retrievers
47+
virtual void get_destination(std::string & destination) const;
48+
virtual void get_source(std::string & source) const;
49+
virtual void get_headers(std::function<void(std::string const &, std::string const &)> inserter) const;
50+
virtual void get_headers(std::string const & name,
51+
std::function<void(std::string const &, std::string const &)> inserter) const;
52+
virtual void get_headers(std::function<bool(std::string const &, std::string const &)> predicate,
53+
std::function<void(std::string const &, std::string const &)> inserter) const;
54+
virtual void get_body(std::string & body) const;
55+
virtual void get_body(std::function<void(std::string::const_iterator, size_t)> chunk_reader, size_t size) const;
5956

60-
void swap(message & other);
57+
void swap(message & other);
6158

62-
// Destructor
63-
virtual ~message();
64-
private:
65-
message_pimpl * pimpl;
66-
};
59+
// Destructor
60+
virtual ~message();
61+
private:
62+
message_pimpl * pimpl;
63+
};
6764

68-
inline void swap(message & left, message & right) {
65+
inline void swap(message & left, message & right) {
6966
left.swap(right);
70-
}
67+
}
7168

72-
template <class Directive>
73-
message_base & operator<< (message_base & msg, Directive directive) {
74-
directive(msg);
75-
return msg;
76-
}
69+
template <class Directive>
70+
message_base & operator<< (message_base & msg, Directive directive) {
71+
directive(msg);
72+
return msg;
73+
}
7774

7875
} // namespace network
7976

0 commit comments

Comments
 (0)