00001 #ifndef _sys_ProtocolFactory_h
00002 #define _sys_ProtocolFactory_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 "qpid/sys/IntegerTypes.h"
00026 #include "qpid/SharedObject.h"
00027 #include "ConnectionCodec.h"
00028 #include <boost/function.hpp>
00029
00030 namespace qpid {
00031 namespace sys {
00032
00033 class Poller;
00034
00035 class ProtocolFactory : public qpid::SharedObject<ProtocolFactory>
00036 {
00037 public:
00038 typedef boost::function2<void, int, std::string> ConnectFailedCallback;
00039
00040 virtual ~ProtocolFactory() = 0;
00041 virtual uint16_t getPort() const = 0;
00042 virtual std::string getHost() const = 0;
00043 virtual void accept(boost::shared_ptr<Poller>, ConnectionCodec::Factory*) = 0;
00044 virtual void connect(
00045 boost::shared_ptr<Poller>,
00046 const std::string& host, int16_t port,
00047 ConnectionCodec::Factory* codec,
00048 ConnectFailedCallback failed) = 0;
00049 };
00050
00051 inline ProtocolFactory::~ProtocolFactory() {}
00052
00053 }}
00054
00055
00056
00057 #endif