qpid/framing/QueueQueryResult.h Source File

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qpid/framing/QueueQueryResult.h
Go to the documentation of this file.

    00001 #ifndef QPID_FRAMING_QUEUEQUERYRESULT_H
    00002 #define QPID_FRAMING_QUEUEQUERYRESULT_H
    00003 /*
    00004  *
    00005  * Licensed to the Apache Software Foundation (ASF) under one
    00006  * or more contributor license agreements.  See the NOTICE file
    00007  * distributed with this work for additional information
    00008  * regarding copyright ownership.  The ASF licenses this file
    00009  * to you under the Apache License, Version 2.0 (the
    00010  * "License"); you may not use this file except in compliance
    00011  * with the License.  You may obtain a copy of the License at
    00012  *
    00013  *   http://www.apache.org/licenses/LICENSE-2.0
    00014  *
    00015  * Unless required by applicable law or agreed to in writing,
    00016  * software distributed under the License is distributed on an
    00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    00018  * KIND, either express or implied.  See the License for the
    00019  * specific language governing permissions and limitations
    00020  * under the License.
    00021  *
    00022  */
    00023
    00028
    00029
    00030
    00031 #include <ostream>
    00032 #include "qpid/framing/amqp_types_full.h"
    00033 #include "qpid/CommonImportExport.h"
    00034
    00035 namespace qpid {
    00036 namespace framing {
    00037
    00038 class QPID_COMMON_CLASS_EXTERN QueueQueryResult  {
    00039     std::string queue;
    00040     std::string alternateExchange;
    00041     FieldTable arguments;
    00042     uint32_t messageCount;
    00043     uint32_t subscriberCount;
    00044     uint16_t flags;
    00045 public:
    00046     static const uint16_t TYPE = 2049;
    00047     QueueQueryResult(
    00048         const std::string& _queue,
    00049         const std::string& _alternateExchange,
    00050         bool _durable,
    00051         bool _exclusive,
    00052         bool _autoDelete,
    00053         const FieldTable& _arguments,
    00054         uint32_t _messageCount,
    00055         uint32_t _subscriberCount) :
    00056         queue(_queue),
    00057         alternateExchange(_alternateExchange),
    00058         arguments(_arguments),
    00059         messageCount(_messageCount),
    00060         subscriberCount(_subscriberCount),
    00061         flags(0){
    00062         setDurable(_durable);
    00063         setExclusive(_exclusive);
    00064         setAutoDelete(_autoDelete);
    00065         flags |= (1 << 8);
    00066         flags |= (1 << 9);
    00067         flags |= (1 << 13);
    00068         flags |= (1 << 14);
    00069         flags |= (1 << 15);
    00070     }
    00071     QueueQueryResult()  : messageCount(0), subscriberCount(0), flags(0) {}
    00072
    00073     QPID_COMMON_EXTERN void setQueue(const std::string& _queue);
    00074     QPID_COMMON_EXTERN const std::string& getQueue() const;
    00075     QPID_COMMON_EXTERN bool hasQueue() const;
    00076     QPID_COMMON_EXTERN void clearQueueFlag();
    00077     QPID_COMMON_EXTERN void setAlternateExchange(const std::string& _alternateExchange);
    00078     QPID_COMMON_EXTERN const std::string& getAlternateExchange() const;
    00079     QPID_COMMON_EXTERN bool hasAlternateExchange() const;
    00080     QPID_COMMON_EXTERN void clearAlternateExchangeFlag();
    00081     QPID_COMMON_EXTERN void setDurable(bool _durable);
    00082     QPID_COMMON_EXTERN bool getDurable() const;
    00083     QPID_COMMON_EXTERN void setExclusive(bool _exclusive);
    00084     QPID_COMMON_EXTERN bool getExclusive() const;
    00085     QPID_COMMON_EXTERN void setAutoDelete(bool _autoDelete);
    00086     QPID_COMMON_EXTERN bool getAutoDelete() const;
    00087     QPID_COMMON_EXTERN void setArguments(const FieldTable& _arguments);
    00088     QPID_COMMON_EXTERN const FieldTable& getArguments() const;
    00089     QPID_COMMON_EXTERN FieldTable& getArguments();
    00090     QPID_COMMON_EXTERN bool hasArguments() const;
    00091     QPID_COMMON_EXTERN void clearArgumentsFlag();
    00092     QPID_COMMON_EXTERN void setMessageCount(uint32_t _messageCount);
    00093     QPID_COMMON_EXTERN uint32_t getMessageCount() const;
    00094     QPID_COMMON_EXTERN bool hasMessageCount() const;
    00095     QPID_COMMON_EXTERN void clearMessageCountFlag();
    00096     QPID_COMMON_EXTERN void setSubscriberCount(uint32_t _subscriberCount);
    00097     QPID_COMMON_EXTERN uint32_t getSubscriberCount() const;
    00098     QPID_COMMON_EXTERN bool hasSubscriberCount() const;
    00099     QPID_COMMON_EXTERN void clearSubscriberCountFlag();
    00100     QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream&, const QueueQueryResult&);
    00101     QPID_COMMON_EXTERN void encode(Buffer&) const;
    00102     QPID_COMMON_EXTERN void decode(Buffer&, uint32_t=0);
    00103     QPID_COMMON_EXTERN void encodeStructBody(Buffer&) const;
    00104     QPID_COMMON_EXTERN void decodeStructBody(Buffer&, uint32_t=0);
    00105     QPID_COMMON_EXTERN uint32_t encodedSize() const;
    00106     QPID_COMMON_EXTERN uint32_t bodySize() const;
    00107     QPID_COMMON_EXTERN void print(std::ostream& out) const;
    00108 }; /* class QueueQueryResult */
    00109
    00110 }}
    00111 #endif