2014-04-08 20:42:07 +08:00
|
|
|
/**
|
|
|
|
|
* Callbacks.h
|
|
|
|
|
*
|
|
|
|
|
* Class storing deferred callbacks of different type.
|
|
|
|
|
*
|
2017-03-08 20:32:51 +08:00
|
|
|
* @copyright 2014 - 2017 Copernica BV
|
2014-04-08 20:42:07 +08:00
|
|
|
*/
|
|
|
|
|
|
2016-04-06 22:49:39 +08:00
|
|
|
/**
|
|
|
|
|
* Include guard
|
|
|
|
|
*/
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2016-06-23 20:42:50 +08:00
|
|
|
/**
|
|
|
|
|
* Dependencies
|
|
|
|
|
*/
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
2014-04-08 20:42:07 +08:00
|
|
|
/**
|
|
|
|
|
* Set up namespace
|
|
|
|
|
*/
|
|
|
|
|
namespace AMQP {
|
|
|
|
|
|
2016-06-23 20:42:50 +08:00
|
|
|
/**
|
|
|
|
|
* Forward declarations
|
|
|
|
|
*/
|
|
|
|
|
class Message;
|
|
|
|
|
class MetaData;
|
|
|
|
|
|
2014-04-08 20:42:07 +08:00
|
|
|
/**
|
2014-04-15 16:43:33 +08:00
|
|
|
* All the callbacks that are supported
|
2016-06-23 20:42:50 +08:00
|
|
|
*
|
2014-04-15 16:43:33 +08:00
|
|
|
* When someone registers a callback function for certain events, it should
|
|
|
|
|
* match one of the following signatures.
|
2014-04-08 20:42:07 +08:00
|
|
|
*/
|
2014-04-15 16:43:33 +08:00
|
|
|
using SuccessCallback = std::function<void()>;
|
|
|
|
|
using ErrorCallback = std::function<void(const char *message)>;
|
|
|
|
|
using FinalizeCallback = std::function<void()>;
|
2014-07-31 18:58:13 +08:00
|
|
|
using EmptyCallback = std::function<void()>;
|
2016-06-23 20:42:50 +08:00
|
|
|
using BeginCallback = std::function<void()>;
|
|
|
|
|
using HeaderCallback = std::function<void(const MetaData &metaData)>;
|
|
|
|
|
using DataCallback = std::function<void(const char *data, size_t size)>;
|
2017-03-08 20:32:51 +08:00
|
|
|
using MessageCallback = std::function<void(const Message &message, uint64_t deliveryTag, bool redelivered)>;
|
2016-06-23 20:42:50 +08:00
|
|
|
using CompleteCallback = std::function<void(uint64_t deliveryTag, bool redelivered)>;
|
2014-04-15 16:43:33 +08:00
|
|
|
using QueueCallback = std::function<void(const std::string &name, uint32_t messagecount, uint32_t consumercount)>;
|
|
|
|
|
using DeleteCallback = std::function<void(uint32_t deletedmessages)>;
|
2014-08-28 16:02:01 +08:00
|
|
|
using SizeCallback = std::function<void(uint32_t messagecount)>;
|
2014-04-15 17:39:52 +08:00
|
|
|
using ConsumeCallback = std::function<void(const std::string &consumer)>;
|
2014-04-15 16:43:33 +08:00
|
|
|
using CancelCallback = std::function<void(const std::string &consumer)>;
|
2014-04-08 20:42:07 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* End namespace
|
|
|
|
|
*/
|
|
|
|
|
}
|