Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 /* 00002 * 00003 * Licensed to the Apache Software Foundation (ASF) under one 00004 * or more contributor license agreements. See the NOTICE file 00005 * distributed with this work for additional information 00006 * regarding copyright ownership. The ASF licenses this file 00007 * to you under the Apache License, Version 2.0 (the 00008 * "License"); you may not use this file except in compliance 00009 * with the License. You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, 00014 * software distributed under the License is distributed on an 00015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00016 * KIND, either express or implied. See the License for the 00017 * specific language governing permissions and limitations 00018 * under the License. 00019 * 00020 */ 00021 #ifndef _QPID_CONSOLE_SCHEMA_H_ 00022 #define _QPID_CONSOLE_SCHEMA_H_ 00023 00024 #include "qpid/console/ClassKey.h" 00025 #include <boost/shared_ptr.hpp> 00026 #include <vector> 00027 00028 namespace qpid { 00029 namespace framing { 00030 class Buffer; 00031 } 00032 namespace console { 00033 class Value; 00034 00035 struct SchemaArgument { 00036 SchemaArgument(framing::Buffer& buffer, bool forMethod = false); 00037 boost::shared_ptr<Value> decodeValue(framing::Buffer& buffer); 00038 00039 std::string name; 00040 uint8_t typeCode; 00041 bool dirInput; 00042 bool dirOutput; 00043 std::string unit; 00044 int min; 00045 int max; 00046 int maxLen; 00047 std::string desc; 00048 std::string defaultVal; 00049 }; 00050 00051 struct SchemaProperty { 00052 SchemaProperty(framing::Buffer& buffer); 00053 boost::shared_ptr<Value> decodeValue(framing::Buffer& buffer); 00054 00055 std::string name; 00056 uint8_t typeCode; 00057 uint8_t accessCode; 00058 bool isIndex; 00059 bool isOptional; 00060 std::string unit; 00061 int min; 00062 int max; 00063 int maxLen; 00064 std::string desc; 00065 }; 00066 00067 struct SchemaStatistic { 00068 SchemaStatistic(framing::Buffer& buffer); 00069 boost::shared_ptr<Value> decodeValue(framing::Buffer& buffer); 00070 00071 std::string name; 00072 uint8_t typeCode; 00073 std::string unit; 00074 std::string desc; 00075 }; 00076 00077 struct SchemaMethod { 00078 SchemaMethod(framing::Buffer& buffer); 00079 ~SchemaMethod(); 00080 00081 std::string name; 00082 std::string desc; 00083 std::vector<SchemaArgument*> arguments; 00084 }; 00085 00086 struct SchemaClass { 00087 static const uint8_t KIND_TABLE = 1; 00088 static const uint8_t KIND_EVENT = 2; 00089 00090 SchemaClass(const uint8_t kind, const ClassKey& key, framing::Buffer& buffer); 00091 ~SchemaClass(); 00092 const ClassKey& getClassKey() const { return key; } 00093 00094 const uint8_t kind; 00095 const ClassKey key; 00096 std::vector<SchemaProperty*> properties; 00097 std::vector<SchemaStatistic*> statistics; 00098 std::vector<SchemaMethod*> methods; 00099 std::vector<SchemaArgument*> arguments; 00100 }; 00101 } 00102 } 00103 00104 00105 #endif