Return-Path: Delivered-To: apmail-incubator-qpid-commits-archive@locus.apache.org Received: (qmail 7847 invoked from network); 19 Sep 2006 22:27:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Sep 2006 22:27:52 -0000 Received: (qmail 17613 invoked by uid 500); 19 Sep 2006 22:27:52 -0000 Delivered-To: apmail-incubator-qpid-commits-archive@incubator.apache.org Received: (qmail 17606 invoked by uid 500); 19 Sep 2006 22:27:52 -0000 Mailing-List: contact qpid-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: qpid-dev@incubator.apache.org Delivered-To: mailing list qpid-commits@incubator.apache.org Delivered-To: moderator for qpid-commits@incubator.apache.org Received: (qmail 91833 invoked by uid 99); 19 Sep 2006 22:08:47 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r447994 [6/46] - in /incubator/qpid/trunk/qpid: ./ cpp/ cpp/bin/ cpp/broker/ cpp/broker/inc/ cpp/broker/src/ cpp/broker/test/ cpp/client/ cpp/client/inc/ cpp/client/src/ cpp/client/test/ cpp/common/ cpp/common/concurrent/ cpp/common/concurr... Date: Tue, 19 Sep 2006 22:07:25 -0000 To: qpid-commits@incubator.apache.org From: rhs@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060919220807.125021A9827@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/code_utils.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/code_utils.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/code_utils.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/code_utils.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,210 @@ + + + + + /** +* +* Copyright (c) 2006 The Apache Software Foundation +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ + +/** +* +* NOTE: This file is generated directly from the AMQP XML specification. +* === DO NOT EDIT === +* +*/ + + + + + + + + + + + + + delete_ + return_ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + u_int8_t + u_int16_t + string + string + bool + u_int32_t + u_int64_t + u_int64_t + + FieldTable + + unknown_type /* WARNING: undefined type */ + + + + + + + + & + & + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/code_utils.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/convert_0.81.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/convert_0.81.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/convert_0.81.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/convert_0.81.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,407 @@ + + + + + + + + + + + + + + + + + + + + + + ==================== + Constants + ==================== + + + + + + + + + + ==================== + Domains + ==================== + + + + + + + + + Elementary domains + + bit + bit + single bit + + + octet + octet + single octet + + + short + short + 16-bit integer + + + long + long + 32-bit integer + + + longlong + longlong + 64-bit integer + + + shortstr + shortstr + short string + + + longstr + longstr + long string + + + timestamp + timestamp + 64-bit timestamp + + + table + table + field table + + + + + + ==================== + Classes + ==================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +rule__ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +doc_rule__ + + + + + + + + + + + +grammar + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/convert_0.81.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/cpp.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/cpp.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/cpp.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/cpp.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + +#include "amqp_framing.h" + + + + + + + + + + + + +#include "amqp_types.h" +#include "AMQP_ServerOperations.h" +#include "AMQMethodBody.h" +#include "Buffer.h" +#include "FieldTable.h" + +#ifndef __ +#define __ + +namespace qpid { +namespace framing { + + + + +} +} + +#endif + + + + + + + + +/** + * This class is autogenerated, do not modify. [From ] + */ +class : virtual public AMQMethodBody +{ + + + + ; + + +public: + typedef std::tr1::shared_ptr<> shared_ptr; + + virtual ~() {} + + + inline ; } + + + + inline void print(std::ostream& out) const{ + out << "" + + << ", + ="<< + + + ; + } + + inline u_int16_t amqpClassId() const { + return ; + } + + inline u_int16_t amqpMethodId() const { + return ; + } + + inline u_int32_t bodySize() const { + + + return + + + + + + + ; + + return 0; + + } + + + inline void invoke(AMQP_ServerOperations& target, u_int16_t channel) { + + + ); + + + ; + + } + + + inline void encodeContent(Buffer& buffer) const + { + + u_int8_t flags = 0; + + ; + + + + + ; + + + buffer.putOctet(flags); + + + } + + inline void decodeContent(Buffer& buffer) + { + + u_int8_t maxbit = ; + + + + + u_int8_t flags = buffer.getOctet(); + ; + + + ; + + + + } + + + + inline () : + { + } + + + inline () + { + } +}; + + + + + +/** + * This file is autogenerated, do not modify. + */ + +#ifndef AMQ_METHODS_H +#define AMQ_METHODS_H + + +#include ".h" + + +namespace qpid { +namespace framing { + + +const ; + + +AMQMethodBody* createAMQMethodBody(u_int16_t classId, u_int16_t methodId); + +} +} + +#endif + + + + + +#include "amqp_methods.h" +#include "QpidError.h" + +namespace qpid { +namespace framing { +/** + * This method is autogenerated, do not modify. + */ +AMQMethodBody* createAMQMethodBody(u_int16_t classId, u_int16_t methodId){ + switch(classId * 1000 + methodId) + { + + case + + * 1000 + + + : return new + (); + + } + THROW_QPID_ERROR(FRAMING_ERROR, "Unknown method"); +} + +} +} + + + + + +#include "amqp_types.h" +#include "FieldTable.h" + +#ifndef _AMQPServer_ +#define _AMQPServer_ + +namespace qpid { +namespace framing { + +class AMQPServer +{ + public: + + + class { + public: + + + virtual void (u_int16_t channel, ) = 0; + + + virtual void (u_int16_t channel) = 0; + + + virtual ~(){} + }; + + virtual () = 0; + + + virtual ~AMQPServer(){} +}; + +} +} + +#endif + + + +#include "amqp_types.h" +#include "FieldTable.h" + +#ifndef _AMQPClient_ +#define _AMQPClient_ + +namespace qpid { +namespace framing { + +class AMQPClient +{ + public: + + + class { + public: + + + virtual void (u_int16_t channel, ) = 0; + + + virtual void (u_int16_t channel) = 0; + + + virtual ~(){} + }; + + virtual () = 0; + + + + virtual ~AMQPClient(){} +}; + +} +} + +#endif + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/cpp.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/framing.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/framing.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/framing.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/framing.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/framing.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare1.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare1.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare1.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare1.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + ( + major= + , minor= + ) + + + + + + + + + + + + + + + + + + + + + + + + Could not inherit from ; file not found. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare1.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare2.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare2.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare2.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare2.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare2.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare3.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare3.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare3.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare3.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/prepare3.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/registry.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/registry.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/registry.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/registry.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,12 @@ + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/registry.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/utils.xsl URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/utils.xsl?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/utils.xsl (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/utils.xsl Tue Sep 19 15:06:50 2006 @@ -0,0 +1,194 @@ + + + + + + + + + + u_int8_t + u_int16_t + string + string + bool + u_int32_t + u_int64_t + FieldTable + Object /*WARNING: undefined type*/ + + + + + + u_int8_t + u_int16_t + string& + string& + bool + u_int32_t + u_int64_t + FieldTable& + Object /*WARNING: undefined type*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* WARNING: COULD NOT DETERMINE FIELD SIZE */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* WARNING: COULD NOT DETERMINE ENCODER */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* WARNING: COULD NOT DETERMINE DECODER */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/generated/stylesheets/utils.xsl ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQBody.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQBody.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQBody.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQBody.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,46 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "memory.h" +#include "amqp_types.h" +#include "Buffer.h" + +#ifndef _AMQBody_ +#define _AMQBody_ + +namespace qpid { + namespace framing { + + class AMQBody + { + public: + typedef std::tr1::shared_ptr shared_ptr; + + virtual u_int32_t size() const = 0; + virtual u_int8_t type() const = 0; + virtual void encode(Buffer& buffer) const = 0; + virtual void decode(Buffer& buffer, u_int32_t size) = 0; + inline virtual ~AMQBody(){} + }; + + enum body_types {METHOD_BODY = 1, HEADER_BODY = 2, CONTENT_BODY = 3, HEARTBEAT_BODY = 8}; + + } +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQBody.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQContentBody.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQContentBody.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQContentBody.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQContentBody.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_types.h" +#include "AMQBody.h" +#include "Buffer.h" + +#ifndef _AMQContentBody_ +#define _AMQContentBody_ + +namespace qpid { +namespace framing { + +class AMQContentBody : virtual public AMQBody +{ + string data; + +public: + typedef std::tr1::shared_ptr shared_ptr; + + AMQContentBody(); + AMQContentBody(string& data); + inline virtual ~AMQContentBody(){} + inline u_int8_t type() const { return CONTENT_BODY; }; + inline string& getData(){ return data; } + u_int32_t size() const; + void encode(Buffer& buffer) const; + void decode(Buffer& buffer, u_int32_t size); +}; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQContentBody.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQDataBlock.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQDataBlock.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQDataBlock.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQDataBlock.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "Buffer.h" + +#ifndef _AMQDataBlock_ +#define _AMQDataBlock_ + +namespace qpid { +namespace framing { + +class AMQDataBlock +{ +public: + virtual ~AMQDataBlock() {} + virtual void encode(Buffer& buffer) = 0; + virtual bool decode(Buffer& buffer) = 0; + virtual u_int32_t size() const = 0; +}; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQDataBlock.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQFrame.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQFrame.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQFrame.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQFrame.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,61 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_methods.h" +#include "amqp_types.h" +#include "AMQBody.h" +#include "AMQDataBlock.h" +#include "AMQMethodBody.h" +#include "AMQHeaderBody.h" +#include "AMQContentBody.h" +#include "AMQHeartbeatBody.h" +#include "Buffer.h" + +#ifndef _AMQFrame_ +#define _AMQFrame_ + +namespace qpid { + namespace framing { + + class AMQFrame : virtual public AMQDataBlock + { + u_int16_t channel; + u_int8_t type;//used if the body is decoded separately from the 'head' + AMQBody::shared_ptr body; + + public: + AMQFrame(); + AMQFrame(u_int16_t channel, AMQBody* body); + AMQFrame(u_int16_t channel, AMQBody::shared_ptr& body); + virtual ~AMQFrame(); + virtual void encode(Buffer& buffer); + virtual bool decode(Buffer& buffer); + virtual u_int32_t size() const; + u_int16_t getChannel(); + AMQBody::shared_ptr& getBody(); + + u_int32_t decodeHead(Buffer& buffer); + void decodeBody(Buffer& buffer, uint32_t size); + + friend std::ostream& operator<<(std::ostream& out, const AMQFrame& body); + }; + + } +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQFrame.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeaderBody.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeaderBody.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeaderBody.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeaderBody.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_types.h" +#include "AMQBody.h" +#include "Buffer.h" +#include "HeaderProperties.h" + +#ifndef _AMQHeaderBody_ +#define _AMQHeaderBody_ + +namespace qpid { +namespace framing { + +class AMQHeaderBody : virtual public AMQBody +{ + HeaderProperties* properties; + u_int16_t weight; + u_int64_t contentSize; + + void createProperties(int classId); +public: + typedef std::tr1::shared_ptr shared_ptr; + + AMQHeaderBody(int classId); + AMQHeaderBody(); + inline u_int8_t type() const { return HEADER_BODY; } + HeaderProperties* getProperties(){ return properties; } + inline u_int64_t getContentSize() const { return contentSize; } + inline void setContentSize(u_int64_t size) { contentSize = size; } + virtual ~AMQHeaderBody(); + virtual u_int32_t size() const; + virtual void encode(Buffer& buffer) const; + virtual void decode(Buffer& buffer, u_int32_t size); +}; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeaderBody.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeartbeatBody.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeartbeatBody.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeartbeatBody.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeartbeatBody.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_types.h" +#include "AMQBody.h" +#include "Buffer.h" + +#ifndef _AMQHeartbeatBody_ +#define _AMQHeartbeatBody_ + +namespace qpid { +namespace framing { + +class AMQHeartbeatBody : virtual public AMQBody +{ +public: + typedef std::tr1::shared_ptr shared_ptr; + + virtual ~AMQHeartbeatBody() {} + inline u_int32_t size() const { return 0; } + inline u_int8_t type() const { return HEARTBEAT_BODY; } + inline void encode(Buffer& buffer) const {} + inline void decode(Buffer& buffer, u_int32_t size) {} +}; + +} +} + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQHeartbeatBody.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQMethodBody.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQMethodBody.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQMethodBody.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQMethodBody.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include +#include "amqp_types.h" +#include "AMQBody.h" +#include "Buffer.h" +#include "AMQP_ServerOperations.h" + +#ifndef _AMQMethodBody_ +#define _AMQMethodBody_ + +namespace qpid { +namespace framing { + +class AMQMethodBody : virtual public AMQBody +{ +public: + typedef std::tr1::shared_ptr shared_ptr; + + inline u_int8_t type() const { return METHOD_BODY; } + inline u_int32_t size() const { return 4 + bodySize(); } + inline virtual ~AMQMethodBody(){} + virtual void print(std::ostream& out) const = 0; + virtual u_int16_t amqpMethodId() const = 0; + virtual u_int16_t amqpClassId() const = 0; + virtual void invoke(AMQP_ServerOperations& target, u_int16_t channel); + virtual void encodeContent(Buffer& buffer) const = 0; + virtual void decodeContent(Buffer& buffer) = 0; + virtual u_int32_t bodySize() const = 0; + void encode(Buffer& buffer) const; + void decode(Buffer& buffer, u_int32_t size); + bool match(AMQMethodBody* other) const; +}; + +std::ostream& operator<<(std::ostream& out, const AMQMethodBody& body); + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/AMQMethodBody.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/BasicHeaderProperties.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/BasicHeaderProperties.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/BasicHeaderProperties.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/BasicHeaderProperties.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,93 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_types.h" +#include "amqp_methods.h" +#include "Buffer.h" +#include "HeaderProperties.h" + +#ifndef _BasicHeaderProperties_ +#define _BasicHeaderProperties_ + +namespace qpid { +namespace framing { + + //TODO: This could be easily generated from the spec + class BasicHeaderProperties : public HeaderProperties + { + string contentType; + string contentEncoding; + FieldTable headers; + u_int8_t deliveryMode; + u_int8_t priority; + string correlationId; + string replyTo; + string expiration; + string messageId; + u_int64_t timestamp; + string type; + string userId; + string appId; + string clusterId; + + u_int16_t getFlags() const; + + public: + BasicHeaderProperties(); + virtual ~BasicHeaderProperties(); + virtual u_int32_t size() const; + virtual void encode(Buffer& buffer) const; + virtual void decode(Buffer& buffer, u_int32_t size); + + inline virtual u_int8_t classId(){ return BASIC; } + + inline string& getContentType(){ return contentType; } + inline string& getContentEncoding(){ return contentEncoding; } + inline FieldTable& getHeaders(){ return headers; } + inline u_int8_t getDeliveryMode(){ return deliveryMode; } + inline u_int8_t getPriority(){ return priority; } + inline string& getCorrelationId(){return correlationId; } + inline string& getReplyTo(){ return replyTo; } + inline string& getExpiration(){ return expiration; } + inline string& getMessageId(){return messageId; } + inline u_int64_t getTimestamp(){ return timestamp; } + inline string& getType(){ return type; } + inline string& getUserId(){ return userId; } + inline string& getAppId(){ return appId; } + inline string& getClusterId(){ return clusterId; } + + void inline setContentType(string& type){ contentType = type; } + void inline setContentEncoding(string& encoding){ contentEncoding = encoding; } + void inline setHeaders(FieldTable& headers){ this->headers = headers; } + void inline setDeliveryMode(u_int8_t mode){ deliveryMode = mode; } + void inline setPriority(u_int8_t priority){ this->priority = priority; } + void inline setCorrelationId(string& correlationId){ this->correlationId = correlationId; } + void inline setReplyTo(string& replyTo){ this->replyTo = replyTo;} + void inline setExpiration(string& expiration){ this->expiration = expiration; } + void inline setMessageId(string& messageId){ this->messageId = messageId; } + void inline setTimestamp(u_int64_t timestamp){ this->timestamp = timestamp; } + void inline setType(string& type){ this->type = type; } + void inline setUserId(string& userId){ this->userId = userId; } + void inline setAppId(string& appId){this->appId = appId; } + void inline setClusterId(string& clusterId){ this->clusterId = clusterId; } + }; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/BasicHeaderProperties.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/BodyHandler.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/BodyHandler.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/BodyHandler.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/BodyHandler.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,50 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include + +#ifndef _BodyHandler_ +#define _BodyHandler_ + +#include "AMQMethodBody.h" +#include "AMQHeaderBody.h" +#include "AMQContentBody.h" +#include "AMQHeartbeatBody.h" + +namespace qpid { +namespace framing { + + class BodyHandler{ + public: + virtual void handleMethod(AMQMethodBody::shared_ptr body) = 0; + virtual void handleHeader(AMQHeaderBody::shared_ptr body) = 0; + virtual void handleContent(AMQContentBody::shared_ptr body) = 0; + virtual void handleHeartbeat(AMQHeartbeatBody::shared_ptr body) = 0; + + void handleBody(AMQBody::shared_ptr& body); + }; + + class UnknownBodyType{ + public: + const u_int16_t type; + inline UnknownBodyType(u_int16_t _type) : type(_type){} + }; +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/BodyHandler.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/Buffer.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/Buffer.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/Buffer.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/Buffer.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,77 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_types.h" +#include "FieldTable.h" + +#ifndef _Buffer_ +#define _Buffer_ + +namespace qpid { +namespace framing { + +class Buffer +{ + const int size; + char* data; + int position; + int limit; + int r_position; + int r_limit; + +public: + + Buffer(int size); + ~Buffer(); + + void flip(); + void clear(); + void compact(); + void record(); + void restore(); + int available(); + char* start(); + void move(int bytes); + + void putOctet(u_int8_t i); + void putShort(u_int16_t i); + void putLong(u_int32_t i); + void putLongLong(u_int64_t i); + + u_int8_t getOctet(); + u_int16_t getShort(); + u_int32_t getLong(); + u_int64_t getLongLong(); + + void putShortString(const string& s); + void putLongString(const string& s); + void getShortString(string& s); + void getLongString(string& s); + + void putFieldTable(const FieldTable& t); + void getFieldTable(FieldTable& t); + + void putRawData(const string& s); + void getRawData(string& s, u_int32_t size); + +}; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/Buffer.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/FieldTable.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/FieldTable.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/FieldTable.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/FieldTable.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include +#include +#include "amqp_types.h" + +#ifndef _FieldTable_ +#define _FieldTable_ + +namespace qpid { +namespace framing { + + class NamedValue; + class Value; + class Buffer; + + class FieldTable + { + std::vector values; + NamedValue* find(const std::string& name) const; + + Value* getValue(const std::string& name) const; + void setValue(const std::string& name, Value* value); + + public: + ~FieldTable(); + u_int32_t size() const; + int count() const; + void setString(const std::string& name, const std::string& value); + void setInt(const std::string& name, int value); + void setTimestamp(const std::string& name, u_int64_t value); + void setTable(const std::string& name, const FieldTable& value); + //void setDecimal(string& name, xxx& value); + std::string getString(const std::string& name); + int getInt(const std::string& name); + u_int64_t getTimestamp(const std::string& name); + void getTable(const std::string& name, FieldTable& value); + //void getDecimal(string& name, xxx& value); + + void encode(Buffer& buffer) const; + void decode(Buffer& buffer); + + friend std::ostream& operator<<(std::ostream& out, const FieldTable& body); + }; + + class FieldNotFoundException{}; + class UnknownFieldName : public FieldNotFoundException{}; + class IncorrectFieldType : public FieldNotFoundException{}; +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/FieldTable.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/HeaderProperties.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/HeaderProperties.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/HeaderProperties.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/HeaderProperties.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "amqp_types.h" +#include "Buffer.h" + +#ifndef _HeaderProperties_ +#define _HeaderProperties_ + +namespace qpid { +namespace framing { + + enum header_classes{BASIC = 60}; + + class HeaderProperties + { + + public: + inline virtual ~HeaderProperties(){} + virtual u_int8_t classId() = 0; + virtual u_int32_t size() const = 0; + virtual void encode(Buffer& buffer) const = 0; + virtual void decode(Buffer& buffer, u_int32_t size) = 0; + }; +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/HeaderProperties.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/InitiationHandler.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/InitiationHandler.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/InitiationHandler.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/InitiationHandler.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include + +#ifndef _InitiationHandler_ +#define _InitiationHandler_ + +#include "ProtocolInitiation.h" + +namespace qpid { +namespace framing { + + class InitiationHandler{ + public: + virtual void initiated(ProtocolInitiation* header) = 0; + }; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/InitiationHandler.h ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/qpid/trunk/qpid/cpp/common/framing/inc/InputHandler.h URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/common/framing/inc/InputHandler.h?view=auto&rev=447994 ============================================================================== --- incubator/qpid/trunk/qpid/cpp/common/framing/inc/InputHandler.h (added) +++ incubator/qpid/trunk/qpid/cpp/common/framing/inc/InputHandler.h Tue Sep 19 15:06:50 2006 @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include + +#ifndef _InputHandler_ +#define _InputHandler_ + +#include "AMQFrame.h" + +namespace qpid { +namespace framing { + + class InputHandler{ + public: + virtual void received(AMQFrame* frame) = 0; + }; + +} +} + + +#endif Propchange: incubator/qpid/trunk/qpid/cpp/common/framing/inc/InputHandler.h ------------------------------------------------------------------------------ svn:eol-style = native