00001 #ifndef _framing_Correlator_h
00002 #define _framing_Correlator_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "qpid/shared_ptr.h"
00023 #include "qpid/framing/AMQResponseBody.h"
00024 #include <boost/function.hpp>
00025 #include <map>
00026
00027 namespace qpid {
00028 namespace framing {
00029
00035 class Correlator
00036 {
00037 public:
00038 typedef shared_ptr<AMQResponseBody> ResponsePtr;
00039 typedef boost::function<void (ResponsePtr)> Action;
00040
00045 void request(RequestId id, Action doOnResponse);
00046
00051 bool response(shared_ptr<AMQResponseBody>);
00052
00057 void mark(RequestId mark);
00058
00059 private:
00060 typedef std::map<RequestId, Action> Actions;
00061 Actions actions;
00062 };
00063
00064 }}
00065
00066
00067
00068 #endif