00001 #ifndef QPID_BROKER_CONNECTION_H
00002 #define QPID_BROKER_CONNECTION_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "qpid/sys/ConnectionCodec.h"
00025 #include "qpid/sys/ConnectionOutputHandler.h"
00026 #include "qpid/sys/Mutex.h"
00027 #include "Connection.h"
00028 #include "qpid/broker/Connection.h"
00029 #include <queue>
00030
00031 namespace qpid {
00032 namespace sys { class ProtocolAccess; }
00033 namespace broker { class Broker; }
00034 namespace amqp_0_10 {
00035
00036
00037 class Connection : public sys::ConnectionCodec,
00038 public sys::ConnectionOutputHandler
00039 {
00040 std::queue<framing::AMQFrame> frameQueue;
00041 bool frameQueueClosed;
00042 mutable sys::Mutex frameQueueLock;
00043 sys::OutputControl& output;
00044 broker::Connection::shared_ptr connection;
00045 std::string identifier;
00046 bool initialized;
00047 bool isClient;
00048
00049 public:
00050 Connection(sys::OutputControl&, broker::Broker&, const std::string& id, bool isClient = false, sys::ProtocolAccess* a =0);
00051 size_t decode(const char* buffer, size_t size);
00052 size_t encode(const char* buffer, size_t size);
00053 bool isClosed() const;
00054 bool canEncode();
00055 void activateOutput();
00056 void closed();
00057 void close();
00058 void send(framing::AMQFrame&);
00059 framing::ProtocolVersion getVersion() const;
00060 };
00061
00062 }}
00063
00064 #endif