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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)

PROJECT(SimpleAmqpClient)

Expand Down Expand Up @@ -117,6 +117,7 @@ SET(SAC_LIB_SRCS

ADD_LIBRARY(SimpleAmqpClient ${SAC_LIB_SRCS})
TARGET_LINK_LIBRARIES(SimpleAmqpClient ${Rabbitmqc_LIBRARY} ${Boost_LIBRARIES} ${SOCKET_LIBRARY})
TARGET_COMPILE_FEATURES(SimpleAmqpClient PUBLIC cxx_std_11)

if (WIN32)
set_target_properties(SimpleAmqpClient PROPERTIES VERSION ${SAC_VERSION} OUTPUT_NAME SimpleAmqpClient.${SAC_SOVERSION})
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ instance of this class.

AmqpClient::Channel::ptr_t connection = AmqpClient::Channel::Create("localhost");

All classes have a typedef ptr_t which is equivalent to boost::shared_ptr<> of the
All classes have a typedef ptr_t which is equivalent to std::shared_ptr<> of the
containing class. All classes also have a Create() method does the job creating a new
ptr_t using boost::make_shared<>(). It is recommended that you use these methods
ptr_t using std::make_shared<>(). It is recommended that you use these methods
to construct objects in the library.

Commands dealing with declaring/binding/unbinding/deleting exchanges and queues are
Expand Down
8 changes: 4 additions & 4 deletions src/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Channel::ptr_t Channel::CreateFromUri(const std::string &uri, int frame_max) {
amqp_connection_info info;
amqp_default_connection_info(&info);

boost::shared_ptr<char> uri_dup =
boost::shared_ptr<char>(strdup(uri.c_str()), free);
std::shared_ptr<char> uri_dup =
std::shared_ptr<char>(strdup(uri.c_str()), free);

if (0 != amqp_parse_url(uri_dup.get(), &info)) {
throw BadUriException();
Expand All @@ -91,8 +91,8 @@ Channel::ptr_t Channel::CreateSecureFromUri(
amqp_connection_info info;
amqp_default_connection_info(&info);

boost::shared_ptr<char> uri_dup =
boost::shared_ptr<char>(strdup(uri.c_str()), free);
std::shared_ptr<char> uri_dup =
std::shared_ptr<char>(strdup(uri.c_str()), free);

if (0 != amqp_parse_url(uri_dup.get(), &info)) {
throw BadUriException();
Expand Down
12 changes: 6 additions & 6 deletions src/SimpleAmqpClient/BasicMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#include "SimpleAmqpClient/Util.h"

#include <boost/cstdint.hpp>
#include <boost/make_shared.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>

#include <memory>
#include <string>

#ifdef _MSC_VER
Expand All @@ -54,14 +54,14 @@ class BasicMessageImpl;

class SIMPLEAMQPCLIENT_EXPORT BasicMessage : boost::noncopyable {
public:
typedef boost::shared_ptr<BasicMessage> ptr_t;
typedef std::shared_ptr<BasicMessage> ptr_t;

enum delivery_mode_t { dm_nonpersistent = 1, dm_persistent = 2 };

/**
* Create a new empty BasicMessage object
*/
static ptr_t Create() { return boost::make_shared<BasicMessage>(); }
static ptr_t Create() { return std::make_shared<BasicMessage>(); }

/**
* Create a new BasicMessage object
Expand All @@ -70,7 +70,7 @@ class SIMPLEAMQPCLIENT_EXPORT BasicMessage : boost::noncopyable {
* @returns a new BasicMessage object
*/
static ptr_t Create(const std::string &body) {
return boost::make_shared<BasicMessage>(body);
return std::make_shared<BasicMessage>(body);
}

/**
Expand All @@ -85,7 +85,7 @@ class SIMPLEAMQPCLIENT_EXPORT BasicMessage : boost::noncopyable {
*/
static ptr_t Create(amqp_bytes_t_ &body,
amqp_basic_properties_t_ *properties) {
return boost::make_shared<BasicMessage>(body, properties);
return std::make_shared<BasicMessage>(body, properties);
}

BasicMessage();
Expand Down
23 changes: 13 additions & 10 deletions src/SimpleAmqpClient/Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#include "SimpleAmqpClient/Util.h"

#include <boost/cstdint.hpp>
#include <boost/make_shared.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>

#include <memory>
#include <string>
#include <vector>

Expand All @@ -58,7 +58,7 @@ class ChannelImpl;
*/
class SIMPLEAMQPCLIENT_EXPORT Channel : boost::noncopyable {
public:
typedef boost::shared_ptr<Channel> ptr_t;
typedef std::shared_ptr<Channel> ptr_t;

static const std::string EXCHANGE_TYPE_DIRECT;
static const std::string EXCHANGE_TYPE_FANOUT;
Expand Down Expand Up @@ -87,8 +87,8 @@ class SIMPLEAMQPCLIENT_EXPORT Channel : boost::noncopyable {
const std::string &username = "guest",
const std::string &password = "guest",
const std::string &vhost = "/", int frame_max = 131072) {
return boost::make_shared<Channel>(host, port, username, password, vhost,
frame_max);
return std::make_shared<Channel>(host, port, username, password, vhost,
frame_max);
}

protected:
Expand Down Expand Up @@ -141,8 +141,8 @@ class SIMPLEAMQPCLIENT_EXPORT Channel : boost::noncopyable {
ssl_params.path_to_client_cert = path_to_client_cert;
ssl_params.verify_hostname = verify_hostname;

return boost::make_shared<Channel>(host, port, username, password, vhost,
frame_max, ssl_params);
return std::make_shared<Channel>(host, port, username, password, vhost,
frame_max, ssl_params);
}

/**
Expand Down Expand Up @@ -532,12 +532,15 @@ class SIMPLEAMQPCLIENT_EXPORT Channel : boost::noncopyable {
* overload
* doesn't require the Envelope object to Acknowledge
*
* Note that ack'ing multiple message is scoped messages delivered on a given AMQP channel.
* SimpleAmqpClient uses one channel per consumer, so multiple ack means all un-ack'd messages
* Note that ack'ing multiple message is scoped messages delivered on a given
* AMQP channel.
* SimpleAmqpClient uses one channel per consumer, so multiple ack means all
* un-ack'd messages
* up to and including the current message id for a given consumer.
*
* @param delivery_info
* @param multiple if true, ack all messages up to this delivery tag, if false ack only this delivery tag
* @param multiple if true, ack all messages up to this delivery tag, if false
* ack only this delivery tag
*/
void BasicAck(const Envelope::DeliveryInfo &info, bool multiple);

Expand Down
13 changes: 6 additions & 7 deletions src/SimpleAmqpClient/Envelope.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
#include "SimpleAmqpClient/Util.h"

#include <boost/cstdint.hpp>
#include <boost/make_shared.hpp>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>

#include <memory>
#include <string>

#ifdef _MSC_VER
Expand All @@ -47,7 +46,7 @@ namespace AmqpClient {

class SIMPLEAMQPCLIENT_EXPORT Envelope : boost::noncopyable {
public:
typedef boost::shared_ptr<Envelope> ptr_t;
typedef std::shared_ptr<Envelope> ptr_t;

/**
* Creates an new envelope object
Expand All @@ -59,17 +58,17 @@ class SIMPLEAMQPCLIENT_EXPORT Envelope : boost::noncopyable {
* @param redelivered a flag indicating whether the message consumed as a
* result of a redelivery
* @param routing_key the routing key that the message was published with
* @returns a boost::shared_ptr to an envelope object
* @returns a std::shared_ptr to an envelope object
*/
static ptr_t Create(const BasicMessage::ptr_t message,
const std::string &consumer_tag,
const boost::uint64_t delivery_tag,
const std::string &exchange, bool redelivered,
const std::string &routing_key,
const boost::uint16_t delivery_channel) {
return boost::make_shared<Envelope>(message, consumer_tag, delivery_tag,
exchange, redelivered, routing_key,
delivery_channel);
return std::make_shared<Envelope>(message, consumer_tag, delivery_tag,
exchange, redelivered, routing_key,
delivery_channel);
}

explicit Envelope(const BasicMessage::ptr_t message,
Expand Down
4 changes: 2 additions & 2 deletions src/SimpleAmqpClient/TableImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include "SimpleAmqpClient/Table.h"

#include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/variant/variant.hpp>

#include <memory>
#include <string>
#include <vector>

Expand All @@ -42,7 +42,7 @@
namespace AmqpClient {
namespace Detail {

typedef boost::shared_ptr<amqp_pool_t> amqp_pool_ptr_t;
typedef std::shared_ptr<amqp_pool_t> amqp_pool_ptr_t;

struct void_t {};

Expand Down
4 changes: 2 additions & 2 deletions src/TableImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ amqp_table_t TableValueImpl::CreateAmqpTable(const Table &table,
return AMQP_EMPTY_TABLE;
}

pool = boost::shared_ptr<amqp_pool_t>(new amqp_pool_t, free_pool);
pool = std::shared_ptr<amqp_pool_t>(new amqp_pool_t, free_pool);
init_amqp_pool(pool.get(), 1024);

return CreateAmqpTableInner(table, *pool.get());
Expand Down Expand Up @@ -298,7 +298,7 @@ amqp_table_t TableValueImpl::CopyTable(const amqp_table_t &table,
return AMQP_EMPTY_TABLE;
}

pool = boost::shared_ptr<amqp_pool_t>(new amqp_pool_t, free_pool);
pool = std::shared_ptr<amqp_pool_t>(new amqp_pool_t, free_pool);
init_amqp_pool(pool.get(), 1024);

return CopyTableInner(table, *pool.get());
Expand Down