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

gen/qpid/framing/ExecutionExceptionBody.h

Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_EXECUTIONEXCEPTIONBODY_H
00002 #define QPID_FRAMING_EXECUTIONEXCEPTIONBODY_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 ExecutionExceptionBody : public ModelMethod {
00042     uint16_t errorCode;
00043     SequenceNumber commandId;
00044     uint8_t classCode;
00045     uint8_t commandCode;
00046     uint8_t fieldIndex;
00047     string description;
00048     FieldTable errorInfo;
00049     uint16_t flags;
00050 public:
00051     static const ClassId CLASS_ID = 0x3;
00052     static const MethodId METHOD_ID = 0x3;
00053     ExecutionExceptionBody(
00054         ProtocolVersion, uint16_t _errorCode,
00055         const SequenceNumber& _commandId,
00056         uint8_t _classCode,
00057         uint8_t _commandCode,
00058         uint8_t _fieldIndex,
00059         const string& _description,
00060         const FieldTable& _errorInfo) : 
00061         errorCode(_errorCode),
00062         commandId(_commandId),
00063         classCode(_classCode),
00064         commandCode(_commandCode),
00065         fieldIndex(_fieldIndex),
00066         description(_description),
00067         errorInfo(_errorInfo),
00068         flags(0){
00069         flags |= (1 << 8);
00070         flags |= (1 << 9);
00071         flags |= (1 << 10);
00072         flags |= (1 << 11);
00073         flags |= (1 << 12);
00074         flags |= (1 << 13);
00075         flags |= (1 << 14);
00076     }
00077     ExecutionExceptionBody(ProtocolVersion=ProtocolVersion())  : errorCode(0), classCode(0), commandCode(0), fieldIndex(0), flags(0) {}
00078     
00079     void setErrorCode(uint16_t _errorCode);
00080     uint16_t getErrorCode() const;
00081     bool hasErrorCode() const;
00082     void clearErrorCodeFlag();
00083     void setCommandId(const SequenceNumber& _commandId);
00084     SequenceNumber getCommandId() const;
00085     bool hasCommandId() const;
00086     void clearCommandIdFlag();
00087     void setClassCode(uint8_t _classCode);
00088     uint8_t getClassCode() const;
00089     bool hasClassCode() const;
00090     void clearClassCodeFlag();
00091     void setCommandCode(uint8_t _commandCode);
00092     uint8_t getCommandCode() const;
00093     bool hasCommandCode() const;
00094     void clearCommandCodeFlag();
00095     void setFieldIndex(uint8_t _fieldIndex);
00096     uint8_t getFieldIndex() const;
00097     bool hasFieldIndex() const;
00098     void clearFieldIndexFlag();
00099     void setDescription(const string& _description);
00100     const string& getDescription() const;
00101     bool hasDescription() const;
00102     void clearDescriptionFlag();
00103     void setErrorInfo(const FieldTable& _errorInfo);
00104     const FieldTable& getErrorInfo() const;
00105     FieldTable& getErrorInfo();
00106     bool hasErrorInfo() const;
00107     void clearErrorInfoFlag();
00108     typedef void ResultType;
00109 
00110     template <class T> ResultType invoke(T& invocable) const {
00111         return invocable.exception(getErrorCode(), getCommandId(), getClassCode(), getCommandCode(), getFieldIndex(), getDescription(), getErrorInfo());
00112     }
00113 
00114     using  AMQMethodBody::accept;
00115     void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00116     boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00117 
00118     ClassId amqpClassId() const { return CLASS_ID; }
00119     MethodId amqpMethodId() const { return METHOD_ID; }
00120     bool isContentBearing() const { return  false; }
00121     bool resultExpected() const { return  false; }
00122     bool responseExpected() const { return  false; }
00123     void encode(Buffer&) const;
00124     void decode(Buffer&, uint32_t=0);
00125     void encodeStructBody(Buffer&) const;
00126     void decodeStructBody(Buffer&, uint32_t=0);
00127     uint32_t encodedSize() const;
00128     uint32_t bodySize() const;
00129     void print(std::ostream& out) const;
00130 }; /* class ExecutionExceptionBody */
00131 
00132 }}
00133 #endif  

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