Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
FlowControl.h
Go to the documentation of this file.
1 #ifndef QPID_CLIENT_FLOWCONTROL_H
2 #define QPID_CLIENT_FLOWCONTROL_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  */
24 
25 #include <qpid/sys/IntegerTypes.h>
26 
27 namespace qpid {
28 namespace client {
29 
49 struct FlowControl {
50  static const uint32_t UNLIMITED=0xFFFFFFFF;
51  FlowControl(uint32_t messages_=0, uint32_t bytes_=0, bool window_=false)
52  : messages(messages_), bytes(bytes_), window(window_) {}
53 
54  static FlowControl messageCredit(uint32_t messages_) { return FlowControl(messages_,UNLIMITED,false); }
55  static FlowControl messageWindow(uint32_t messages_) { return FlowControl(messages_,UNLIMITED,true); }
56  static FlowControl byteCredit(uint32_t bytes_) { return FlowControl(UNLIMITED,bytes_,false); }
57  static FlowControl byteWindow(uint32_t bytes_) { return FlowControl(UNLIMITED,bytes_,true); }
58  static FlowControl unlimited() { return FlowControl(UNLIMITED, UNLIMITED, false); }
59  static FlowControl zero() { return FlowControl(0, 0, false); }
60 
66  bool window;
67 
68  bool operator==(const FlowControl& x) {
69  return messages == x.messages && bytes == x.bytes && window == x.window;
70  };
71 };
72 
73 }} // namespace qpid::client
74 
75 #endif

Qpid C++ API Reference
Generated on Thu Sep 26 2013 for Qpid C++ Client API by doxygen 1.8.3.1