Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 2.8)
project(Libiqxmlrpc)
set(Libiqxmlrpc_VERSION 0.13.6)

set(CMAKE_CXX_STANDARD 11)
set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(libiqxmlrpc)

option(build_tests "Build tests?" OFF)
Expand Down
6 changes: 0 additions & 6 deletions doc/libiqxmlrpc.doxygen.in
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,6 @@ HTML_FOOTER =

HTML_STYLESHEET =

# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.

HTML_ALIGN_MEMBERS = NO

# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
Expand Down
4 changes: 2 additions & 2 deletions libiqxmlrpc/api_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "sysinc.h"

#if defined(WIN32) || defined(__MINGW32__)
#if defined(_WIN32) || defined(__MINGW32__)
#define LIBIQXMLRPC_DLL
#endif // WIN32 || __MINGW32__
#endif // _WIN32 || __MINGW32__

#ifdef LIBIQXMLRPC_DLL
#if defined(LIBIQXMLRPC_COMPILATION) && defined(DLL_EXPORT)
Expand Down
12 changes: 9 additions & 3 deletions libiqxmlrpc/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "client_conn.h"
#include "client_opts.h"

#include <memory>

namespace iqxmlrpc {

//
Expand All @@ -21,14 +23,14 @@ class Client_base::Impl {
opts(addr, uri, vhost) {}

Client_options opts;
boost::scoped_ptr<Client_connection> conn_cache;
std::unique_ptr<Client_connection> conn_cache;
};

//
// Auto_conn
//

class Auto_conn: boost::noncopyable {
class Auto_conn {
public:
Auto_conn( Client_base::Impl& client_impl, Client_base& client ):
client_impl_(client_impl)
Expand All @@ -45,6 +47,10 @@ class Auto_conn: boost::noncopyable {
conn_ptr_ = tmp_conn_.get();
}
}
Auto_conn(const Auto_conn&) = delete;
Auto_conn(Auto_conn&&) = delete;
Auto_conn& operator=(const Auto_conn&) = delete;
Auto_conn& operator=(Auto_conn&&) = delete;

~Auto_conn()
{
Expand Down Expand Up @@ -74,7 +80,7 @@ class Auto_conn: boost::noncopyable {
}

Client_base::Impl& client_impl_;
boost::scoped_ptr<Client_connection> tmp_conn_;
std::unique_ptr<Client_connection> tmp_conn_;
Client_connection* conn_ptr_;
};

Expand Down
11 changes: 8 additions & 3 deletions libiqxmlrpc/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#include "response.h"

#include <boost/optional.hpp>
#include <boost/scoped_ptr.hpp>

#include <memory>

namespace iqxmlrpc {

Expand All @@ -22,13 +23,17 @@ class Client_connection;

//! Client base class.
//! It is responsible for performing RPC calls and connection management.
class LIBIQXMLRPC_API Client_base: boost::noncopyable {
class LIBIQXMLRPC_API Client_base {
public:
Client_base(
const iqnet::Inet_addr& addr,
const std::string& uri,
const std::string& vhost
);
Client_base(const Client_base&) = delete;
Client_base(Client_base&&) = delete;
Client_base& operator=(const Client_base&) = delete;
Client_base& operator=(Client_base&&) = delete;

virtual ~Client_base();

Expand Down Expand Up @@ -69,7 +74,7 @@ class LIBIQXMLRPC_API Client_base: boost::noncopyable {
friend class Auto_conn;
class Impl;

boost::scoped_ptr<Impl> impl_;
std::unique_ptr<Impl> impl_;
};

#ifdef _MSC_VER
Expand Down
6 changes: 4 additions & 2 deletions libiqxmlrpc/client_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "client_opts.h"
#include "http.h"

#include <memory>

namespace iqxmlrpc {

Client_connection::Client_connection():
Expand All @@ -22,7 +24,7 @@ Response Client_connection::process_session( const Request& req, const XHeaders&

std::string req_xml_str( dump_request(req) );

std::auto_ptr<Request_header> req_h(
std::unique_ptr<Request_header> req_h(
new Request_header(
decorate_uri(),
opts().vhost(),
Expand All @@ -38,7 +40,7 @@ Response Client_connection::process_session( const Request& req, const XHeaders&
req_p.set_keep_alive( opts().keep_alive() );

// Received packet
std::auto_ptr<Packet> res_p( do_process_session(req_p.dump()) );
std::unique_ptr<Packet> res_p( do_process_session(req_p.dump()) );

const Response_header* res_h =
static_cast<const Response_header*>(res_p->header());
Expand Down
2 changes: 1 addition & 1 deletion libiqxmlrpc/connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace iqnet {

#if defined(WIN32)
#if defined(_WIN32)
#define IQXMLRPC_INPROGRESS WSAEWOULDBLOCK
#else
#define IQXMLRPC_INPROGRESS EINPROGRESS
Expand Down
8 changes: 5 additions & 3 deletions libiqxmlrpc/dispatcher_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "method.h"

#include <boost/noncopyable.hpp>

namespace iqxmlrpc {

#ifdef _MSC_VER
Expand All @@ -20,12 +18,16 @@ namespace iqxmlrpc {
* register_method operation and optionally system one, which holds
* server's built-in methods
*/
class LIBIQXMLRPC_API Method_dispatcher_manager: boost::noncopyable {
class LIBIQXMLRPC_API Method_dispatcher_manager {
class Impl;
Impl* impl_;

public:
Method_dispatcher_manager();
Method_dispatcher_manager(const Method_dispatcher_manager&) = delete;
Method_dispatcher_manager(Method_dispatcher_manager&&) = delete;
Method_dispatcher_manager& operator=(const Method_dispatcher_manager&) = delete;
Method_dispatcher_manager& operator=(Method_dispatcher_manager&&) = delete;
~Method_dispatcher_manager();

//! Registers method factory in default method dispatcher.
Expand Down
11 changes: 6 additions & 5 deletions libiqxmlrpc/executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#include <memory>

using namespace iqxmlrpc;
typedef boost::mutex::scoped_lock scoped_lock;
typedef std::lock_guard<std::mutex> scoped_lock;
typedef std::unique_lock<std::mutex> unique_lock;

Executor::Executor( Method* m, Server* s, Server_connection* cb ):
method(m),
Expand Down Expand Up @@ -43,7 +44,7 @@ void Executor::interrupt_server()
void Serial_executor::execute( const Param_list& params )
{
try {
std::auto_ptr<Value> result(new Value(0));
std::unique_ptr<Value> result(new Value(0));
method->process_execution( interceptors, params, *result.get() );
schedule_response( Response(result.release()) );
}
Expand Down Expand Up @@ -95,7 +96,7 @@ void Pool_executor_factory::Pool_thread::operator ()()

for(;;)
{
scoped_lock lk(pool->req_queue_lock);
unique_lock lk(pool->req_queue_lock);

if (pool->req_queue.empty())
{
Expand Down Expand Up @@ -145,7 +146,7 @@ Executor* Pool_executor_factory::create(

iqnet::Reactor_base* Pool_executor_factory::create_reactor()
{
return new iqnet::Reactor<boost::mutex>;
return new iqnet::Reactor<std::mutex>;
}


Expand Down Expand Up @@ -211,7 +212,7 @@ void Pool_executor::execute( const Param_list& params_ )
void Pool_executor::process_actual_execution()
{
try {
std::auto_ptr<Value> result(new Value(0));
std::unique_ptr<Value> result(new Value(0));
method->process_execution( interceptors, params, *result.get() );
schedule_response( Response(result.release()) );
}
Expand Down
15 changes: 8 additions & 7 deletions libiqxmlrpc/executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
#pragma warning(disable: 4275)
#endif

#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/thread.hpp> // thread_group
#include <condition_variable>
#include <mutex>
#include <thread>

#ifdef _MSC_VER
#pragma warning(pop)
Expand Down Expand Up @@ -46,7 +47,7 @@ struct Serial_executor_traits
struct Pool_executor_traits
{
typedef Pool_executor_factory Executor_factory;
typedef boost::mutex Lock;
typedef std::mutex Lock;
};

//! Abstract executor class. Defines the policy for method execution.
Expand Down Expand Up @@ -134,11 +135,11 @@ class LIBIQXMLRPC_API Pool_executor_factory: public Executor_factory_base {

// Objects Pool_thread works with
std::deque<Pool_executor*> req_queue;
boost::mutex req_queue_lock;
boost::condition req_queue_cond;
std::mutex req_queue_lock;
std::condition_variable req_queue_cond;

bool in_destructor;
boost::mutex destructor_lock;
std::mutex destructor_lock;

public:
Pool_executor_factory(unsigned num_threads);
Expand Down
4 changes: 2 additions & 2 deletions libiqxmlrpc/http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void Request_header::get_authinfo(std::string& user, std::string& pw) const
if (v[0] != "basic")
throw Unauthorized();

boost::scoped_ptr<Binary_data> bin_authinfo( Binary_data::from_base64(v[1]) );
std::unique_ptr<Binary_data> bin_authinfo( Binary_data::from_base64(v[1]) );
std::string data = bin_authinfo->get_data();

size_t colon_it = data.find_first_of(":");
Expand All @@ -324,7 +324,7 @@ void Request_header::get_authinfo(std::string& user, std::string& pw) const
void Request_header::set_authinfo(const std::string& u, const std::string& p)
{
std::string h = u + ":" + p;
boost::scoped_ptr<Binary_data> bin_authinfo( Binary_data::from_data(h) );
std::unique_ptr<Binary_data> bin_authinfo( Binary_data::from_data(h) );
set_option( names::authorization, "Basic " + bin_authinfo->get_base64() );
}

Expand Down
4 changes: 2 additions & 2 deletions libiqxmlrpc/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include "xheaders.h"

#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>

#include <map>
#include <memory>
#include <string>

namespace iqxmlrpc {
Expand Down Expand Up @@ -149,7 +149,7 @@ class LIBIQXMLRPC_API Response_header: public Header {
//! HTTP packet: Header + Content.
class LIBIQXMLRPC_API Packet {
protected:
boost::shared_ptr<http::Header> header_;
std::shared_ptr<http::Header> header_;
std::string content_;

public:
Expand Down
4 changes: 3 additions & 1 deletion libiqxmlrpc/http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "connector.h"
#include "reactor.h"

#include <memory>

namespace iqxmlrpc
{

Expand All @@ -19,7 +21,7 @@ class LIBIQXMLRPC_API Http_client_connection:
public iqxmlrpc::Client_connection,
public iqnet::Connection
{
std::auto_ptr<iqnet::Reactor_base> reactor;
std::unique_ptr<iqnet::Reactor_base> reactor;
std::string out_str;
http::Packet* resp_packet;

Expand Down
4 changes: 3 additions & 1 deletion libiqxmlrpc/https_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <boost/lexical_cast.hpp>

#include <memory>

using namespace iqnet;

namespace iqxmlrpc {
Expand Down Expand Up @@ -45,7 +47,7 @@ Https_proxy_client_connection::Https_proxy_client_connection(
Client_connection(),
Connection( s ),
reactor( new Reactor<Null_lock> ),
resp_packet(0),
resp_packet(nullptr),
non_blocking(nb)
{
sock.set_non_blocking( nb );
Expand Down
8 changes: 4 additions & 4 deletions libiqxmlrpc/https_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "reactor.h"
#include "ssl_connection.h"

#include <boost/scoped_ptr.hpp>
#include <memory>

namespace iqxmlrpc
{
Expand All @@ -32,8 +32,8 @@ class LIBIQXMLRPC_API Https_proxy_client_connection:

void setup_tunnel();

boost::scoped_ptr<iqnet::Reactor_base> reactor;
boost::scoped_ptr<http::Packet> resp_packet;
std::unique_ptr<iqnet::Reactor_base> reactor;
std::unique_ptr<http::Packet> resp_packet;
bool non_blocking;
std::string out_str;
};
Expand All @@ -43,7 +43,7 @@ class LIBIQXMLRPC_API Https_client_connection:
public iqxmlrpc::Client_connection,
public iqnet::ssl::Reaction_connection
{
std::auto_ptr<iqnet::Reactor_base> reactor;
std::unique_ptr<iqnet::Reactor_base> reactor;
http::Packet* resp_packet;
std::string out_str;
bool established;
Expand Down
2 changes: 1 addition & 1 deletion libiqxmlrpc/inet_addr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ std::string get_host_name()
}


#if defined(WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__)
#define IQXMLRPC_GETHOSTBYNAME(_h) \
hent = ::gethostbyname( _h ); \
if( !hent ) { \
Expand Down
4 changes: 2 additions & 2 deletions libiqxmlrpc/inet_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#include "api_export.h"

#include <memory>
#include <string>
#include <boost/shared_ptr.hpp>

//! Object-oriented networking/multithreading infrastructure.
namespace iqnet
Expand All @@ -28,7 +28,7 @@ std::string LIBIQXMLRPC_API get_host_name();
/*! A wrapper for sockaddr_in system structure. */
class LIBIQXMLRPC_API Inet_addr {
struct Impl;
boost::shared_ptr<Impl> impl_;
std::shared_ptr<Impl> impl_;

public:
//! Does nothing.
Expand Down
Loading