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

gen/qpid/framing/ExchangeDeclareBody.h

Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_EXCHANGEDECLAREBODY_H
00002 #define QPID_FRAMING_EXCHANGEDECLAREBODY_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 #include "qpid/framing/AMQMethodBody.h"
00031 #include "qpid/framing/AMQP_ServerOperations.h"
00032 #include "qpid/framing/MethodBodyConstVisitor.h"
00033 #include "qpid/framing/ModelMethod.h"
00034 
00035 #include <ostream>
00036 #include "qpid/framing/amqp_types_full.h"
00037 
00038 namespace qpid {
00039 namespace framing {
00040 
00041 class ExchangeDeclareBody : public ModelMethod {
00042     string exchange;
00043     string type;
00044     string alternateExchange;
00045     FieldTable arguments;
00046     uint16_t flags;
00047 public:
00048     static const ClassId CLASS_ID = 0x7;
00049     static const MethodId METHOD_ID = 0x1;
00050     ExchangeDeclareBody(
00051         ProtocolVersion, const string& _exchange,
00052         const string& _type,
00053         const string& _alternateExchange,
00054         bool _passive,
00055         bool _durable,
00056         bool _autoDelete,
00057         const FieldTable& _arguments) : 
00058         exchange(_exchange),
00059         type(_type),
00060         alternateExchange(_alternateExchange),
00061         arguments(_arguments),
00062         flags(0){
00063         setPassive(_passive);
00064         setDurable(_durable);
00065         setAutoDelete(_autoDelete);
00066         flags |= (1 << 8);
00067         flags |= (1 << 9);
00068         flags |= (1 << 10);
00069         flags |= (1 << 14);
00070     }
00071     ExchangeDeclareBody(ProtocolVersion=ProtocolVersion())  : flags(0) {}
00072     
00073     void setExchange(const string& _exchange);
00074     const string& getExchange() const;
00075     bool hasExchange() const;
00076     void clearExchangeFlag();
00077     void setType(const string& _type);
00078     const string& getType() const;
00079     bool hasType() const;
00080     void clearTypeFlag();
00081     void setAlternateExchange(const string& _alternateExchange);
00082     const string& getAlternateExchange() const;
00083     bool hasAlternateExchange() const;
00084     void clearAlternateExchangeFlag();
00085     void setPassive(bool _passive);
00086     bool getPassive() const;
00087     void setDurable(bool _durable);
00088     bool getDurable() const;
00089     void setAutoDelete(bool _autoDelete);
00090     bool getAutoDelete() const;
00091     void setArguments(const FieldTable& _arguments);
00092     const FieldTable& getArguments() const;
00093     FieldTable& getArguments();
00094     bool hasArguments() const;
00095     void clearArgumentsFlag();
00096     typedef void ResultType;
00097 
00098     template <class T> ResultType invoke(T& invocable) const {
00099         return invocable.declare(getExchange(), getType(), getAlternateExchange(), getPassive(), getDurable(), getAutoDelete(), getArguments());
00100     }
00101 
00102     using  AMQMethodBody::accept;
00103     void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00104     boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00105 
00106     ClassId amqpClassId() const { return CLASS_ID; }
00107     MethodId amqpMethodId() const { return METHOD_ID; }
00108     bool isContentBearing() const { return  false; }
00109     bool resultExpected() const { return  false; }
00110     bool responseExpected() const { return  false; }
00111     void encode(Buffer&) const;
00112     void decode(Buffer&, uint32_t=0);
00113     void encodeStructBody(Buffer&) const;
00114     void decodeStructBody(Buffer&, uint32_t=0);
00115     uint32_t encodedSize() const;
00116     uint32_t bodySize() const;
00117     void print(std::ostream& out) const;
00118 }; /* class ExchangeDeclareBody */
00119 
00120 }}
00121 #endif  

Qpid C++ API Reference
Generated on Tue Dec 8 15:39:35 2009 for Qpid C++ Client API by doxygen 1.4.7