Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
MessageReplayTracker.h
Go to the documentation of this file.
1 #ifndef QPID_CLIENT_MESSAGEREPLAYTRACKER_H
2 #define QPID_CLIENT_MESSAGEREPLAYTRACKER_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
25 #include "qpid/client/Message.h"
27 #include <list>
28 #include <string>
29 
30 namespace qpid {
31 namespace client {
32 
38 {
39  public:
41  QPID_CLIENT_EXTERN void send(const Message& message, const std::string& destination = "");
42  QPID_CLIENT_EXTERN void init(AsyncSession session);
43  QPID_CLIENT_EXTERN void replay(AsyncSession session);
44  QPID_CLIENT_EXTERN void setFlushInterval(uint interval);
45  QPID_CLIENT_EXTERN uint getFlushInterval();
46  QPID_CLIENT_EXTERN void checkCompletion();
47 
48  template <class F> void foreach(F& f) {
49  for (std::list<ReplayRecord>::const_iterator i = buffer.begin(); i != buffer.end(); i++) {
50  f(i->message);
51  }
52  }
53 
54  private:
55  struct ReplayRecord
56  {
57  Completion status;
58  Message message;
59  std::string destination;
60 
61  ReplayRecord(const Message& message, const std::string& destination);
62  void send(MessageReplayTracker&);
63  bool isComplete();
64  };
65 
66  AsyncSession session;
67  uint flushInterval;
68  uint count;
69  std::list<ReplayRecord> buffer;
70 };
71 }} // namespace qpid::client
72 
73 #endif

Qpid C++ API Reference
Generated on Thu Nov 15 2012 for Qpid C++ Client API by doxygen 1.8.1.2