Skip to content

Commit 14998e6

Browse files
committed
changed to c++17 and boost 1.70
1 parent 0e9e8fa commit 14998e6

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ add_library(Database
129129
)
130130

131131

132-
set (CMAKE_CXX_STANDARD 14)
133-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++14 -D__STRICT_ANSI__")
132+
set (CMAKE_CXX_STANDARD 17)
133+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++17 -D__STRICT_ANSI__")
134134

135135
find_package (Threads)
136136
find_package(libbsoncxx)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# iotdb_mongodb_odl_server
22

33
This is a [odl](https://www.mongodb.com/initiatives/data-as-a-service) based on mongodb.
4-
This app created with [Boost c++ libraries](https://www.boost.org/) , [mongo database](https://www.mongodb.com/) and [c++ 2014 standards](https://en.wikipedia.org/wiki/C%2B%2B14) .I'm developing this application only on linux and I don't know if it works on windows too and I don't care too.
4+
This app created with [Boost c++ libraries](https://www.boost.org/) , [mongo database](https://www.mongodb.com/) and [c++ 2017 standards](https://en.wikipedia.org/wiki/C%2B%2B17) .I'm developing this application only on linux and I don't know if it works on windows too and I don't care too.
55
After completing this project, I will upload it at [iotdb.ir](iotdb.ir)
66

77
## Getting Started
@@ -12,7 +12,7 @@ These instructions will get you a copy of the project up and running on your loc
1212

1313
* [mongodb instalation](https://docs.mongodb.com/manual/administration/install-on-linux/)
1414
* [cmake instalation](https://cmake.org/install/)
15-
* [Boost instalation](https://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html)
15+
* [Boost instalation](https://www.boost.org/doc/libs/1_70_0/more/getting_started/unix-variants.html)
1616
* [MONGOCXX instalation](http://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/)
1717

1818
### Installing

src/server/server.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,21 @@ void server::operator()(boost::system::error_code ec, std::size_t length)
3333
// hoisting it outside the coroutine. An alternative approach would be
3434
// to
3535
// check the value of ec after each yield for an asynchronous operation.
36-
if (!ec) {
36+
if (!ec)
37+
{
3738
// On reentering a coroutine, control jumps to the location of the
3839
// last
3940
// yield or fork. The argument to the "reenter" pseudo-keyword can
4041
// be a
4142
// pointer or reference to an object of type coroutine.
4243
reenter(this)
4344
{
44-
// Loop to accept incoming connections.
45-
do {
45+
// Loop to accept incoming connections.
46+
do
47+
{
4648
// Create a new socket for the next incoming connection.
4749
socket_.reset(
48-
new tcp::socket(acceptor_->get_io_service()));
50+
new tcp::socket(acceptor_->get_executor()));
4951

5052
// Accept a new connection. The "yield" pseudo-keyword
5153
// saves the current
@@ -83,9 +85,10 @@ void server::operator()(boost::system::error_code ec, std::size_t length)
8385
buffer_.reset(new boost::array<char, 8192>);
8486
request_.reset(new request);
8587

86-
// Loop until a complete request (or an invalid one) has
87-
// been received.
88-
do {
88+
// Loop until a complete request (or an invalid one) has
89+
// been received.
90+
do
91+
{
8992
// Receive some more data. When control resumes at the
9093
// following line,
9194
// the ec and length parameters reflect the result of
@@ -107,13 +110,15 @@ void server::operator()(boost::system::error_code ec, std::size_t length)
107110
// Create the reply object that will be sent back to the client.
108111
reply_.reset(new reply);
109112

110-
if (valid_request_) {
113+
if (valid_request_)
114+
{
111115
// A valid request was received. Call the user-supplied
112116
// function object
113117
// to process the request and compose a reply.
114118
request_handler_(*request_, *reply_);
115119
}
116-
else {
120+
else
121+
{
117122
// The request was invalid.
118123
*reply_ = reply::stock_reply(reply::bad_request);
119124
}
@@ -135,5 +140,5 @@ void server::operator()(boost::system::error_code ec, std::size_t length)
135140

136141
#include "unyield.hpp" // Disable the pseudo-keywords reenter, yield and fork.
137142

138-
} // namespace server4
143+
} // namespace server
139144
} // namespace http

0 commit comments

Comments
 (0)