2014-05-29 00:25:28 +08:00
|
|
|
#ifndef qamqp_global_h__
|
|
|
|
|
#define qamqp_global_h__
|
|
|
|
|
|
2014-06-12 02:38:42 +08:00
|
|
|
#include <QMetaType>
|
|
|
|
|
|
2014-06-10 07:26:30 +08:00
|
|
|
#define AMQP_SCHEME "amqp"
|
|
|
|
|
#define AMQP_SSCHEME "amqps"
|
|
|
|
|
#define AMQP_PORT 5672
|
|
|
|
|
#define AMQP_HOST "localhost"
|
|
|
|
|
#define AMQP_VHOST "/"
|
|
|
|
|
#define AMQP_LOGIN "guest"
|
|
|
|
|
#define AMQP_PSWD "guest"
|
|
|
|
|
|
|
|
|
|
#define AMQP_FRAME_MAX 131072
|
|
|
|
|
#define AMQP_FRAME_MIN_SIZE 4096
|
2014-05-29 00:25:28 +08:00
|
|
|
|
2014-07-22 03:17:04 +08:00
|
|
|
#define AMQP_BASIC_CONTENT_TYPE_FLAG (1 << 15)
|
|
|
|
|
#define AMQP_BASIC_CONTENT_ENCODING_FLAG (1 << 14)
|
|
|
|
|
#define AMQP_BASIC_HEADERS_FLAG (1 << 13)
|
|
|
|
|
#define AMQP_BASIC_DELIVERY_MODE_FLAG (1 << 12)
|
|
|
|
|
#define AMQP_BASIC_PRIORITY_FLAG (1 << 11)
|
|
|
|
|
#define AMQP_BASIC_CORRELATION_ID_FLAG (1 << 10)
|
|
|
|
|
#define AMQP_BASIC_REPLY_TO_FLAG (1 << 9)
|
|
|
|
|
#define AMQP_BASIC_EXPIRATION_FLAG (1 << 8)
|
|
|
|
|
#define AMQP_BASIC_MESSAGE_ID_FLAG (1 << 7)
|
|
|
|
|
#define AMQP_BASIC_TIMESTAMP_FLAG (1 << 6)
|
|
|
|
|
#define AMQP_BASIC_TYPE_FLAG (1 << 5)
|
|
|
|
|
#define AMQP_BASIC_USER_ID_FLAG (1 << 4)
|
|
|
|
|
#define AMQP_BASIC_APP_ID_FLAG (1 << 3)
|
|
|
|
|
#define AMQP_BASIC_CLUSTER_ID_FLAG (1 << 2)
|
|
|
|
|
|
2014-05-29 03:33:15 +08:00
|
|
|
#define QAMQP_VERSION "0.3.0"
|
2014-05-29 00:25:28 +08:00
|
|
|
|
|
|
|
|
#define AMQP_CONNECTION_FORCED 320
|
|
|
|
|
|
2014-05-29 03:33:15 +08:00
|
|
|
#ifdef QAMQP_SHARED
|
|
|
|
|
# ifdef QAMQP_BUILD
|
|
|
|
|
# define QAMQP_EXPORT Q_DECL_EXPORT
|
|
|
|
|
# else
|
|
|
|
|
# define QAMQP_EXPORT Q_DECL_IMPORT
|
|
|
|
|
# endif
|
|
|
|
|
#else
|
|
|
|
|
# define QAMQP_EXPORT
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-06-07 01:46:08 +08:00
|
|
|
#define qAmqpDebug if (qgetenv("QAMQP_DEBUG").isEmpty()); else qDebug
|
|
|
|
|
|
2014-06-12 01:44:30 +08:00
|
|
|
namespace QAMQP {
|
|
|
|
|
|
2014-08-04 04:39:31 +08:00
|
|
|
enum ValueType
|
|
|
|
|
{
|
|
|
|
|
Invalid = -1,
|
2014-07-22 03:17:04 +08:00
|
|
|
|
2014-08-04 04:39:31 +08:00
|
|
|
// basic AMQP types
|
|
|
|
|
Boolean,
|
|
|
|
|
ShortUint,
|
|
|
|
|
LongUint,
|
|
|
|
|
LongLongUint,
|
|
|
|
|
ShortString,
|
|
|
|
|
LongString,
|
|
|
|
|
|
|
|
|
|
// field-value types
|
|
|
|
|
ShortShortInt,
|
|
|
|
|
ShortShortUint,
|
|
|
|
|
ShortInt,
|
|
|
|
|
LongInt,
|
|
|
|
|
LongLongInt,
|
|
|
|
|
Float,
|
|
|
|
|
Double,
|
|
|
|
|
Decimal,
|
|
|
|
|
Array,
|
|
|
|
|
Timestamp,
|
|
|
|
|
Hash,
|
|
|
|
|
Bytes,
|
|
|
|
|
Void
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum Error
|
|
|
|
|
{
|
2014-06-12 01:44:30 +08:00
|
|
|
NoError = 0,
|
|
|
|
|
ContentTooLargeError = 311,
|
2014-06-24 03:36:03 +08:00
|
|
|
UnroutableKey = 312,
|
2014-06-12 01:44:30 +08:00
|
|
|
NoConsumersError = 313,
|
|
|
|
|
ConnectionForcedError = 320,
|
|
|
|
|
InvalidPathError = 402,
|
|
|
|
|
AccessRefusedError = 403,
|
|
|
|
|
NotFoundError = 404,
|
|
|
|
|
ResourceLockedError = 405,
|
|
|
|
|
PreconditionFailedError = 406,
|
|
|
|
|
FrameError = 501,
|
|
|
|
|
SyntaxError = 502,
|
|
|
|
|
CommandInvalidError = 503,
|
|
|
|
|
ChannelError = 504,
|
|
|
|
|
UnexpectedFrameError = 505,
|
|
|
|
|
ResourceError = 506,
|
|
|
|
|
NotAllowedError = 530,
|
|
|
|
|
NotImplementedError = 540,
|
|
|
|
|
InternalError = 541
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace QAMQP
|
|
|
|
|
|
2014-06-12 02:38:42 +08:00
|
|
|
Q_DECLARE_METATYPE(QAMQP::Error);
|
|
|
|
|
|
2014-05-29 00:25:28 +08:00
|
|
|
#endif // qamqp_global_h__
|