00001 #ifndef QPID_AMQP_0_10_COMMAND_H
00002 #define QPID_AMQP_0_10_COMMAND_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "Control.h"
00026 #include "qpid/amqp_0_10/structs.h"
00027
00028 namespace qpid {
00029 namespace amqp_0_10 {
00030
00031 struct CommandVisitor;
00032 struct ConstCommandVisitor;
00033 struct CommandHolder;
00034 struct Command
00035 : public Action,
00036 public Visitable<CommandVisitor, ConstCommandVisitor, CommandHolder>
00037 {
00038 using Action::getCommand;
00039 Command* getCommand() { return this; }
00040 uint8_t getCode() const;
00041 uint8_t getClassCode() const;
00042 const char* getName() const;
00043 const char* getClassName() const;
00044
00045 session::Header sessionHeader;
00046 };
00047
00048 std::ostream& operator<<(std::ostream&, const Command&);
00049
00050 template <class T>
00051 struct CommandPacker : Packer<T> {
00052 CommandPacker(T& t) : Packer<T>(t) {}
00053
00054 template <class S> void serialize(S& s) {
00055 s(this->data.sessionHeader);
00056 Packer<T>::serialize(s);
00057 }
00058 };
00059
00060 }}
00061
00062 #endif