diff options
author | Alan Conway <aconway@apache.org> | 2008-02-22 23:13:43 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-02-22 23:13:43 +0000 |
commit | 60434be9f8c48d05d1f7c1d406f93142d8c1dc44 (patch) | |
tree | 3a2cbcdc76b3414d6e775b85100ba5a5764e162e /cpp/src | |
parent | 0375ee9a77888a4901dcb093af1683c953cfcb37 (diff) | |
download | qpid-python-60434be9f8c48d05d1f7c1d406f93142d8c1dc44.tar.gz |
Fixed rubygen to skip unchanged generated files, prevents needless
rebuilding every time the code generator changes.
Start of amqp 0-10 mapping, work in progress.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@630353 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/amqp_0_10/helpers.h | 70 | ||||
-rw-r--r-- | cpp/src/qpid/amqp_0_10/visitors.h | 15 | ||||
-rw-r--r-- | cpp/src/qpid/client/Session.h | 2 |
3 files changed, 86 insertions, 1 deletions
diff --git a/cpp/src/qpid/amqp_0_10/helpers.h b/cpp/src/qpid/amqp_0_10/helpers.h new file mode 100644 index 0000000000..1d93d1d51c --- /dev/null +++ b/cpp/src/qpid/amqp_0_10/helpers.h @@ -0,0 +1,70 @@ +#ifndef QPID_AMQP_0_10_HELPERS_H +#define QPID_AMQP_0_10_HELPERS_H + +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 <string> + +namespace qpid { + +namespace amqp_0_10 { + +struct ClassAttributes { uint8_t code; const char* name }; + +struct MemberAttributes { + ClassAttributes class_; + const char* name + uint8_t code; + + std::string fullName() const { + return std::string(class_.name)+"."+name; + } +}; + +struct StructAttributes : public MemberAttributes { uint8_t size, pack; }; + +static const ClassAttributes getClass(uint8_t code); +static const MemberAttributes getCommand(uint8_t classCode, uint8_t code); +static const MemberAttributes getControl(uint8_t classCode, uint8_t code); + +struct Command : public Member { + class Visitor; + virtual const MemberAttributes& attributes() const = 0; + virtual void accept(Visitor&) const = 0; +}; + +struct Control : public Member { + class Visitor; + struct Attributes { uint8_t classCode, code }; + + virtual const MemberAttributes& attributes() const = 0; + virtual void accept(Visitor&) const = 0; +}; + + +struct Struct : public Member { + virtual const StructAttributes& attributes() const = 0; +}; + + +}} // namespace qpid::amqp_0_10 + +#endif /*!QPID_AMQP_0_10_HELPERS_H*/ diff --git a/cpp/src/qpid/amqp_0_10/visitors.h b/cpp/src/qpid/amqp_0_10/visitors.h new file mode 100644 index 0000000000..3835f37f3e --- /dev/null +++ b/cpp/src/qpid/amqp_0_10/visitors.h @@ -0,0 +1,15 @@ +// Visitors +template <class Base> struct Visitor; +template <class Base, class F, class R> FunctorVisitor; + +/** Template base implementation for visitables. */ +template <class Base, class Derived> +struct VisitableBase : public Base { + virtual void accept(Visitor<Derived>& v) { + v.visit(static_cast<Derived>&(*this)); + } + virtual void accept(Visitor<Derived>& v) const { + v.visit(static_cast<const Derived>&(*this)); + } +}; + diff --git a/cpp/src/qpid/client/Session.h b/cpp/src/qpid/client/Session.h index 3293af60fe..5d91f289e2 100644 --- a/cpp/src/qpid/client/Session.h +++ b/cpp/src/qpid/client/Session.h @@ -27,7 +27,7 @@ namespace qpid { namespace client { /** - * Session is currently just an alias for Session_0_10 + * Session is currently just an alias for Session_99_0 * * \ingroup clientapi */ |