00001 #ifndef QPID_AMQP_0_10_STRUCTS_H
00002 #define QPID_AMQP_0_10_STRUCTS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028
00029
00030 #include "qpid/amqp_0_10/specification_fwd.h"
00031 #include "qpid/amqp_0_10/Map.h"
00032 #include "qpid/amqp_0_10/Array.h"
00033 #include "qpid/amqp_0_10/Struct.h"
00034 #include "qpid/amqp_0_10/UnknownStruct.h"
00035 #include "qpid/amqp_0_10/Packer.h"
00036
00037 namespace qpid {
00038 namespace amqp_0_10 {
00039
00040
00041 namespace connection {
00042
00043
00044 }
00045
00046
00047 namespace session {
00048
00049
00050 struct Header
00051 {
00052 Bit sync;
00053
00054 static const char* NAME;
00055 static const uint8_t SIZE=1;
00056 static const uint8_t PACK=1;
00057 static const uint8_t CODE=0;
00058 static const uint8_t CLASS_CODE=session::CODE;
00059 static const char* CLASS_NAME;
00060 explicit Header(Bit sync_=Bit());
00061 template <class S> void serialize(S& s) {
00062 s(sync);
00063 }
00064
00065 };
00066 inline SizedPacker<Header> serializable(Header& x) { return SizedPacker<Header>(x); }
00067 std::ostream& operator << (std::ostream&, const Header&);
00068 bool operator==(const Header&, const Header&);
00069
00070 struct CommandFragment
00071 {
00072 SequenceNo commandId;
00073 ByteRanges byteRanges;
00074
00075 static const char* NAME;
00076 static const uint8_t SIZE=0;
00077 static const uint8_t PACK=0;
00078 static const uint8_t CODE=0;
00079 static const uint8_t CLASS_CODE=session::CODE;
00080 static const char* CLASS_NAME;
00081 explicit CommandFragment(
00082 const SequenceNo& commandId_=SequenceNo(),
00083 const ByteRanges& byteRanges_=ByteRanges()
00084 );
00085 template <class S> void serialize(S& s) {
00086 s(commandId)(byteRanges);
00087 }
00088
00089 };
00090 std::ostream& operator << (std::ostream&, const CommandFragment&);
00091 bool operator==(const CommandFragment&, const CommandFragment&);
00092
00093 }
00094
00095
00096 namespace execution {
00097
00098
00099 }
00100
00101
00102 namespace message {
00103
00104
00105 struct DeliveryProperties:
00106 public Struct
00107 {
00108 Bit discardUnroutable;
00109 Bit immediate;
00110 Bit redelivered;
00111 DeliveryPriority priority;
00112 DeliveryMode deliveryMode;
00113 Uint64 ttl;
00114 Datetime timestamp;
00115 Datetime expiration;
00116 exchange::Name exchange;
00117 Str8 routingKey;
00118 ResumeId resumeId;
00119 Uint64 resumeTtl;
00120
00121 static const char* NAME;
00122 static const uint8_t SIZE=4;
00123 static const uint8_t PACK=2;
00124 static const uint8_t CODE=0x1;
00125 static const uint8_t CLASS_CODE=message::CODE;
00126 static const char* CLASS_NAME;
00127 explicit DeliveryProperties(
00128 Bit discardUnroutable_=Bit(),
00129 Bit immediate_=Bit(),
00130 Bit redelivered_=Bit(),
00131 const message::DeliveryPriority& priority_=message::DeliveryPriority(),
00132 const message::DeliveryMode& deliveryMode_=message::DeliveryMode(),
00133 Uint64 ttl_=Uint64(),
00134 const Datetime& timestamp_=Datetime(),
00135 const Datetime& expiration_=Datetime(),
00136 const exchange::Name& exchange_=exchange::Name(),
00137 const Str8& routingKey_=Str8(),
00138 const message::ResumeId& resumeId_=message::ResumeId(),
00139 Uint64 resumeTtl_=Uint64()
00140 );
00141 void accept(Visitor&);
00142 void accept(ConstVisitor&) const;
00143 template <class S> void serialize(S& s) {
00144 s(discardUnroutable)(immediate)(redelivered)(priority)(deliveryMode)(ttl)(timestamp)(expiration)(exchange)(routingKey)(resumeId)(resumeTtl);
00145 }
00146
00147 };
00148 inline SizedPacker<DeliveryProperties> serializable(DeliveryProperties& x) { return SizedPacker<DeliveryProperties>(x); }
00149 std::ostream& operator << (std::ostream&, const DeliveryProperties&);
00150 bool operator==(const DeliveryProperties&, const DeliveryProperties&);
00151
00152 struct FragmentProperties:
00153 public Struct
00154 {
00155 Bit first;
00156 Bit last;
00157 Uint64 fragmentSize;
00158
00159 static const char* NAME;
00160 static const uint8_t SIZE=4;
00161 static const uint8_t PACK=2;
00162 static const uint8_t CODE=0x2;
00163 static const uint8_t CLASS_CODE=message::CODE;
00164 static const char* CLASS_NAME;
00165 explicit FragmentProperties(
00166 Bit first_=Bit(),
00167 Bit last_=Bit(),
00168 Uint64 fragmentSize_=Uint64()
00169 );
00170 void accept(Visitor&);
00171 void accept(ConstVisitor&) const;
00172 template <class S> void serialize(S& s) {
00173 s(first)(last)(fragmentSize);
00174 }
00175
00176 };
00177 inline SizedPacker<FragmentProperties> serializable(FragmentProperties& x) { return SizedPacker<FragmentProperties>(x); }
00178 std::ostream& operator << (std::ostream&, const FragmentProperties&);
00179 bool operator==(const FragmentProperties&, const FragmentProperties&);
00180
00181 struct ReplyTo
00182 {
00183 exchange::Name exchange;
00184 Str8 routingKey;
00185
00186 static const char* NAME;
00187 static const uint8_t SIZE=2;
00188 static const uint8_t PACK=2;
00189 static const uint8_t CODE=0;
00190 static const uint8_t CLASS_CODE=message::CODE;
00191 static const char* CLASS_NAME;
00192 explicit ReplyTo(
00193 const exchange::Name& exchange_=exchange::Name(),
00194 const Str8& routingKey_=Str8()
00195 );
00196 template <class S> void serialize(S& s) {
00197 s(exchange)(routingKey);
00198 }
00199
00200 };
00201 inline SizedPacker<ReplyTo> serializable(ReplyTo& x) { return SizedPacker<ReplyTo>(x); }
00202 std::ostream& operator << (std::ostream&, const ReplyTo&);
00203 bool operator==(const ReplyTo&, const ReplyTo&);
00204
00205 struct MessageProperties:
00206 public Struct
00207 {
00208 Uint64 contentLength;
00209 Uuid messageId;
00210 Vbin16 correlationId;
00211 ReplyTo replyTo;
00212 Str8 contentType;
00213 Str8 contentEncoding;
00214 Vbin16 userId;
00215 Vbin16 appId;
00216 Map applicationHeaders;
00217
00218 static const char* NAME;
00219 static const uint8_t SIZE=4;
00220 static const uint8_t PACK=2;
00221 static const uint8_t CODE=0x3;
00222 static const uint8_t CLASS_CODE=message::CODE;
00223 static const char* CLASS_NAME;
00224 explicit MessageProperties(
00225 Uint64 contentLength_=Uint64(),
00226 const Uuid& messageId_=Uuid(),
00227 const Vbin16& correlationId_=Vbin16(),
00228 const message::ReplyTo& replyTo_=message::ReplyTo(),
00229 const Str8& contentType_=Str8(),
00230 const Str8& contentEncoding_=Str8(),
00231 const Vbin16& userId_=Vbin16(),
00232 const Vbin16& appId_=Vbin16(),
00233 const Map& applicationHeaders_=Map()
00234 );
00235 void accept(Visitor&);
00236 void accept(ConstVisitor&) const;
00237 template <class S> void serialize(S& s) {
00238 s(contentLength)(messageId)(correlationId)(replyTo)(contentType)(contentEncoding)(userId)(appId)(applicationHeaders);
00239 }
00240
00241 };
00242 inline SizedPacker<MessageProperties> serializable(MessageProperties& x) { return SizedPacker<MessageProperties>(x); }
00243 std::ostream& operator << (std::ostream&, const MessageProperties&);
00244 bool operator==(const MessageProperties&, const MessageProperties&);
00245
00246 struct Acquired:
00247 public Struct
00248 {
00249 session::Commands transfers;
00250
00251 static const char* NAME;
00252 static const uint8_t SIZE=4;
00253 static const uint8_t PACK=2;
00254 static const uint8_t CODE=0x4;
00255 static const uint8_t CLASS_CODE=message::CODE;
00256 static const char* CLASS_NAME;
00257 explicit Acquired(const session::Commands& transfers_=session::Commands());
00258 void accept(Visitor&);
00259 void accept(ConstVisitor&) const;
00260 template <class S> void serialize(S& s) {
00261 s(transfers);
00262 }
00263
00264 };
00265 inline SizedPacker<Acquired> serializable(Acquired& x) { return SizedPacker<Acquired>(x); }
00266 std::ostream& operator << (std::ostream&, const Acquired&);
00267 bool operator==(const Acquired&, const Acquired&);
00268
00269 struct MessageResumeResult:
00270 public Struct
00271 {
00272 Uint64 offset;
00273
00274 static const char* NAME;
00275 static const uint8_t SIZE=4;
00276 static const uint8_t PACK=2;
00277 static const uint8_t CODE=0x5;
00278 static const uint8_t CLASS_CODE=message::CODE;
00279 static const char* CLASS_NAME;
00280 explicit MessageResumeResult(Uint64 offset_=Uint64());
00281 void accept(Visitor&);
00282 void accept(ConstVisitor&) const;
00283 template <class S> void serialize(S& s) {
00284 s(offset);
00285 }
00286
00287 };
00288 inline SizedPacker<MessageResumeResult> serializable(MessageResumeResult& x) { return SizedPacker<MessageResumeResult>(x); }
00289 std::ostream& operator << (std::ostream&, const MessageResumeResult&);
00290 bool operator==(const MessageResumeResult&, const MessageResumeResult&);
00291
00292 }
00293
00294
00295 namespace tx {
00296
00297
00298 }
00299
00300
00301 namespace dtx {
00302
00303
00304 struct XaResult:
00305 public Struct
00306 {
00307 XaStatus status;
00308
00309 static const char* NAME;
00310 static const uint8_t SIZE=4;
00311 static const uint8_t PACK=2;
00312 static const uint8_t CODE=0x1;
00313 static const uint8_t CLASS_CODE=dtx::CODE;
00314 static const char* CLASS_NAME;
00315 explicit XaResult(const dtx::XaStatus& status_=dtx::XaStatus());
00316 void accept(Visitor&);
00317 void accept(ConstVisitor&) const;
00318 template <class S> void serialize(S& s) {
00319 s(status);
00320 }
00321
00322 };
00323 inline SizedPacker<XaResult> serializable(XaResult& x) { return SizedPacker<XaResult>(x); }
00324 std::ostream& operator << (std::ostream&, const XaResult&);
00325 bool operator==(const XaResult&, const XaResult&);
00326
00327 struct Xid:
00328 public Struct
00329 {
00330 Uint32 format;
00331 Vbin8 globalId;
00332 Vbin8 branchId;
00333
00334 static const char* NAME;
00335 static const uint8_t SIZE=4;
00336 static const uint8_t PACK=2;
00337 static const uint8_t CODE=0x4;
00338 static const uint8_t CLASS_CODE=dtx::CODE;
00339 static const char* CLASS_NAME;
00340 explicit Xid(
00341 Uint32 format_=Uint32(),
00342 const Vbin8& globalId_=Vbin8(),
00343 const Vbin8& branchId_=Vbin8()
00344 );
00345 void accept(Visitor&);
00346 void accept(ConstVisitor&) const;
00347 template <class S> void serialize(S& s) {
00348 s(format)(globalId)(branchId);
00349 }
00350
00351 };
00352 inline SizedPacker<Xid> serializable(Xid& x) { return SizedPacker<Xid>(x); }
00353 std::ostream& operator << (std::ostream&, const Xid&);
00354 bool operator==(const Xid&, const Xid&);
00355
00356 struct GetTimeoutResult:
00357 public Struct
00358 {
00359 Uint32 timeout;
00360
00361 static const char* NAME;
00362 static const uint8_t SIZE=4;
00363 static const uint8_t PACK=2;
00364 static const uint8_t CODE=0x2;
00365 static const uint8_t CLASS_CODE=dtx::CODE;
00366 static const char* CLASS_NAME;
00367 explicit GetTimeoutResult(Uint32 timeout_=Uint32());
00368 void accept(Visitor&);
00369 void accept(ConstVisitor&) const;
00370 template <class S> void serialize(S& s) {
00371 s(timeout);
00372 }
00373
00374 };
00375 inline SizedPacker<GetTimeoutResult> serializable(GetTimeoutResult& x) { return SizedPacker<GetTimeoutResult>(x); }
00376 std::ostream& operator << (std::ostream&, const GetTimeoutResult&);
00377 bool operator==(const GetTimeoutResult&, const GetTimeoutResult&);
00378
00379 struct RecoverResult:
00380 public Struct
00381 {
00382 ArrayDomain<dtx::Xid> inDoubt;
00383
00384 static const char* NAME;
00385 static const uint8_t SIZE=4;
00386 static const uint8_t PACK=2;
00387 static const uint8_t CODE=0x3;
00388 static const uint8_t CLASS_CODE=dtx::CODE;
00389 static const char* CLASS_NAME;
00390 explicit RecoverResult(const ArrayDomain<dtx::Xid> & inDoubt_=ArrayDomain<dtx::Xid> ());
00391 void accept(Visitor&);
00392 void accept(ConstVisitor&) const;
00393 template <class S> void serialize(S& s) {
00394 s(inDoubt);
00395 }
00396
00397 };
00398 inline SizedPacker<RecoverResult> serializable(RecoverResult& x) { return SizedPacker<RecoverResult>(x); }
00399 std::ostream& operator << (std::ostream&, const RecoverResult&);
00400 bool operator==(const RecoverResult&, const RecoverResult&);
00401
00402 }
00403
00404
00405 namespace exchange {
00406
00407
00408 struct ExchangeQueryResult:
00409 public Struct
00410 {
00411 Str8 type;
00412 Bit durable;
00413 Bit notFound;
00414 Map arguments;
00415
00416 static const char* NAME;
00417 static const uint8_t SIZE=4;
00418 static const uint8_t PACK=2;
00419 static const uint8_t CODE=0x1;
00420 static const uint8_t CLASS_CODE=exchange::CODE;
00421 static const char* CLASS_NAME;
00422 explicit ExchangeQueryResult(
00423 const Str8& type_=Str8(),
00424 Bit durable_=Bit(),
00425 Bit notFound_=Bit(),
00426 const Map& arguments_=Map()
00427 );
00428 void accept(Visitor&);
00429 void accept(ConstVisitor&) const;
00430 template <class S> void serialize(S& s) {
00431 s(type)(durable)(notFound)(arguments);
00432 }
00433
00434 };
00435 inline SizedPacker<ExchangeQueryResult> serializable(ExchangeQueryResult& x) { return SizedPacker<ExchangeQueryResult>(x); }
00436 std::ostream& operator << (std::ostream&, const ExchangeQueryResult&);
00437 bool operator==(const ExchangeQueryResult&, const ExchangeQueryResult&);
00438
00439 struct ExchangeBoundResult:
00440 public Struct
00441 {
00442 Bit exchangeNotFound;
00443 Bit queueNotFound;
00444 Bit queueNotMatched;
00445 Bit keyNotMatched;
00446 Bit argsNotMatched;
00447
00448 static const char* NAME;
00449 static const uint8_t SIZE=4;
00450 static const uint8_t PACK=2;
00451 static const uint8_t CODE=0x2;
00452 static const uint8_t CLASS_CODE=exchange::CODE;
00453 static const char* CLASS_NAME;
00454 explicit ExchangeBoundResult(
00455 Bit exchangeNotFound_=Bit(),
00456 Bit queueNotFound_=Bit(),
00457 Bit queueNotMatched_=Bit(),
00458 Bit keyNotMatched_=Bit(),
00459 Bit argsNotMatched_=Bit()
00460 );
00461 void accept(Visitor&);
00462 void accept(ConstVisitor&) const;
00463 template <class S> void serialize(S& s) {
00464 s(exchangeNotFound)(queueNotFound)(queueNotMatched)(keyNotMatched)(argsNotMatched);
00465 }
00466
00467 };
00468 inline SizedPacker<ExchangeBoundResult> serializable(ExchangeBoundResult& x) { return SizedPacker<ExchangeBoundResult>(x); }
00469 std::ostream& operator << (std::ostream&, const ExchangeBoundResult&);
00470 bool operator==(const ExchangeBoundResult&, const ExchangeBoundResult&);
00471
00472 }
00473
00474
00475 namespace queue {
00476
00477
00478 struct QueueQueryResult:
00479 public Struct
00480 {
00481 Name queue;
00482 exchange::Name alternateExchange;
00483 Bit durable;
00484 Bit exclusive;
00485 Bit autoDelete;
00486 Map arguments;
00487 Uint32 messageCount;
00488 Uint32 subscriberCount;
00489
00490 static const char* NAME;
00491 static const uint8_t SIZE=4;
00492 static const uint8_t PACK=2;
00493 static const uint8_t CODE=0x1;
00494 static const uint8_t CLASS_CODE=queue::CODE;
00495 static const char* CLASS_NAME;
00496 explicit QueueQueryResult(
00497 const queue::Name& queue_=queue::Name(),
00498 const exchange::Name& alternateExchange_=exchange::Name(),
00499 Bit durable_=Bit(),
00500 Bit exclusive_=Bit(),
00501 Bit autoDelete_=Bit(),
00502 const Map& arguments_=Map(),
00503 Uint32 messageCount_=Uint32(),
00504 Uint32 subscriberCount_=Uint32()
00505 );
00506 void accept(Visitor&);
00507 void accept(ConstVisitor&) const;
00508 template <class S> void serialize(S& s) {
00509 s(queue)(alternateExchange)(durable)(exclusive)(autoDelete)(arguments)(messageCount)(subscriberCount);
00510 }
00511
00512 };
00513 inline SizedPacker<QueueQueryResult> serializable(QueueQueryResult& x) { return SizedPacker<QueueQueryResult>(x); }
00514 std::ostream& operator << (std::ostream&, const QueueQueryResult&);
00515 bool operator==(const QueueQueryResult&, const QueueQueryResult&);
00516
00517 }
00518
00519
00520 namespace file {
00521
00522
00523 struct FileProperties:
00524 public Struct
00525 {
00526 Str8 contentType;
00527 Str8 contentEncoding;
00528 Map headers;
00529 Uint8 priority;
00530 Str8 replyTo;
00531 Str8 messageId;
00532 Str8 filename;
00533 Datetime timestamp;
00534 Str8 clusterId;
00535
00536 static const char* NAME;
00537 static const uint8_t SIZE=4;
00538 static const uint8_t PACK=2;
00539 static const uint8_t CODE=0x1;
00540 static const uint8_t CLASS_CODE=file::CODE;
00541 static const char* CLASS_NAME;
00542 explicit FileProperties(
00543 const Str8& contentType_=Str8(),
00544 const Str8& contentEncoding_=Str8(),
00545 const Map& headers_=Map(),
00546 Uint8 priority_=Uint8(),
00547 const Str8& replyTo_=Str8(),
00548 const Str8& messageId_=Str8(),
00549 const Str8& filename_=Str8(),
00550 const Datetime& timestamp_=Datetime(),
00551 const Str8& clusterId_=Str8()
00552 );
00553 void accept(Visitor&);
00554 void accept(ConstVisitor&) const;
00555 template <class S> void serialize(S& s) {
00556 s(contentType)(contentEncoding)(headers)(priority)(replyTo)(messageId)(filename)(timestamp)(clusterId);
00557 }
00558
00559 };
00560 inline SizedPacker<FileProperties> serializable(FileProperties& x) { return SizedPacker<FileProperties>(x); }
00561 std::ostream& operator << (std::ostream&, const FileProperties&);
00562 bool operator==(const FileProperties&, const FileProperties&);
00563
00564 }
00565
00566
00567 namespace stream {
00568
00569
00570 struct StreamProperties:
00571 public Struct
00572 {
00573 Str8 contentType;
00574 Str8 contentEncoding;
00575 Map headers;
00576 Uint8 priority;
00577 Datetime timestamp;
00578
00579 static const char* NAME;
00580 static const uint8_t SIZE=4;
00581 static const uint8_t PACK=2;
00582 static const uint8_t CODE=0x1;
00583 static const uint8_t CLASS_CODE=stream::CODE;
00584 static const char* CLASS_NAME;
00585 explicit StreamProperties(
00586 const Str8& contentType_=Str8(),
00587 const Str8& contentEncoding_=Str8(),
00588 const Map& headers_=Map(),
00589 Uint8 priority_=Uint8(),
00590 const Datetime& timestamp_=Datetime()
00591 );
00592 void accept(Visitor&);
00593 void accept(ConstVisitor&) const;
00594 template <class S> void serialize(S& s) {
00595 s(contentType)(contentEncoding)(headers)(priority)(timestamp);
00596 }
00597
00598 };
00599 inline SizedPacker<StreamProperties> serializable(StreamProperties& x) { return SizedPacker<StreamProperties>(x); }
00600 std::ostream& operator << (std::ostream&, const StreamProperties&);
00601 bool operator==(const StreamProperties&, const StreamProperties&);
00602
00603 }
00604
00605
00606 }}
00607
00608 #endif