activemq-cpp-3.3.0

src/main/activemq/wireformat/WireFormat.h

Go to the documentation of this file.
00001 
00018 #ifndef _ACTIVEMQ_WIREFORMAT_WIREFORMAT_H_
00019 #define _ACTIVEMQ_WIREFORMAT_WIREFORMAT_H_
00020 
00021 #include <activemq/wireformat/WireFormatNegotiator.h>
00022 
00023 #include <decaf/io/DataInputStream.h>
00024 #include <decaf/io/DataOutputStream.h>
00025 #include <decaf/io/IOException.h>
00026 #include <decaf/lang/Pointer.h>
00027 
00028 #include <activemq/util/Config.h>
00029 #include <activemq/commands/Command.h>
00030 #include <activemq/transport/Transport.h>
00031 
00032 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
00033 
00034 namespace activemq{
00035 namespace wireformat{
00036 
00037     using decaf::lang::Pointer;
00038 
00045     class AMQCPP_API WireFormat {
00046     public:
00047 
00048         virtual ~WireFormat() {}
00049 
00063         virtual void marshal( const Pointer<commands::Command>& command,
00064                               const activemq::transport::Transport* transport,
00065                               decaf::io::DataOutputStream* out ) = 0;
00066 
00081         virtual Pointer<commands::Command> unmarshal( const activemq::transport::Transport* transport,
00082                                                       decaf::io::DataInputStream* in ) = 0;
00083 
00090         virtual void setVersion( int version ) = 0;
00091 
00097         virtual int getVersion() const = 0;
00098 
00104         virtual bool hasNegotiator() const = 0;
00105 
00115         virtual bool inReceive() const = 0;
00116 
00128         virtual Pointer<transport::Transport> createNegotiator(
00129             const Pointer<transport::Transport>& transport ) = 0;
00130 
00131     };
00132 
00133 }}
00134 
00135 #endif /*_ACTIVEMQ_WIREFORMAT_WIREFORMAT_H_*/