Skip to content

Commit

Permalink
boost version fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca committed Aug 28, 2019
1 parent f83d2bb commit d59acec
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ option(COMPILE_SCRIPTBUILDER "Compile the UI for creating the test" ON)
set(Boost_NO_BOOST_CMAKE ON)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREAD ON)
set(BOOST_MIN_VERSION "1.64.0")
set(BOOST_MIN_VERSION "1.65.0")

find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS filesystem system)
find_package(pugixml REQUIRED)
Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- [4. Installation](#4-installation)
- [4.1. External library](#41-external-library)
- [4.2. Prerequisite Linux](#42-prerequisite-linux)
- [4.2.1. Boost](#421-boost)
- [4.2.1. Pugixml](#421-pugixml)
- [4.2.1. Numpy](#421-numpy)
- [4.3. Prerequisite Windows](#43-prerequisite-windows)
Expand Down Expand Up @@ -57,8 +56,8 @@ The main idea of BlockTest is to adopt testing methodologies and best practices

# 4. Installation

Supported OS: Linux Ubuntu 18.10 and Windows 10.
Boost library version must be >=1.66.
Supported OS: Linux Ubuntu 18.04 and Windows 10.
Boost library version must be >=1.65.

## 4.1. External library

Expand All @@ -71,15 +70,8 @@ The following library are used in blocktest:
## 4.2. Prerequisite Linux

```bash
sudo apt-get install -y cmake libboost-all-dev libpugixml-dev qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5opengl5-dev libqcustomplot-dev
sudo apt-get install -y cmake libboost1.65-all-dev libpugixml-dev qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5opengl5-dev libqcustomplot-dev
```

### 4.2.1. Boost
Note that if the boost library installed is not ver>=1.66 follow the boost installation guide:

https://www.boost.org/doc/libs/1_71_0/more/getting_started/unix-variants.html


### 4.2.1. Pugixml

Install pugi:
Expand Down
3 changes: 2 additions & 1 deletion src/blocktestrunner/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
#include <chrono>

using namespace std::literals::chrono_literals;

Connection::Connection(boost::asio::io_context& io_context): socket_(io_context)
Connection::Connection(boost::asio::io_service& io_service): socket_(io_service)
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/blocktestrunner/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ class Connection : public boost::enable_shared_from_this<Connection>
public:
typedef boost::shared_ptr<Connection> pointer;

static pointer create(boost::asio::io_context& io_context){
return pointer(new Connection(io_context));
static pointer create(boost::asio::io_service& io_service){
return pointer(new Connection(io_service));
}

tcp::socket& socket();

void start();

private:
Connection(boost::asio::io_context& io_context);
Connection(boost::asio::io_service& io_service);

void handleWrite(const boost::system::error_code& err,size_t bytes_transferred);
void handleRead(const boost::system::error_code& err,size_t bytes_transferred);
Expand Down
4 changes: 1 addition & 3 deletions src/blocktestrunner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
#include "blockTestRunner.h"
#include "server.h"

using namespace std::literals::chrono_literals;

int main(int argc,char* argv[]) noexcept
{
boost::asio::io_context io;
boost::asio::io_service io;
Server comServer(io);
comServer.init();

Expand Down
3 changes: 2 additions & 1 deletion src/blocktestrunner/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#include <string>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <chrono>

using namespace std::literals::chrono_literals;

Server::Server(boost::asio::io_context& io):io_(io),acceptor_(io, tcp::endpoint(tcp::v4(), 9876))
Server::Server(boost::asio::io_service& io):io_(io),acceptor_(io, tcp::endpoint(tcp::v4(), 9876))
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/blocktestrunner/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ using boost::asio::ip::tcp;
class Server
{
public:
Server(boost::asio::io_context& io);
Server(boost::asio::io_service& io);
void init();
private:
const unsigned int port_{9876};
boost::asio::io_context& io_;
boost::asio::io_service& io_;
tcp::acceptor acceptor_;
Connection::pointer newConnection_;

Expand Down

0 comments on commit d59acec

Please sign in to comment.