Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
qmf/engine/Schema.h
Go to the documentation of this file.
00001 #ifndef _QmfEngineSchema_
00002 #define _QmfEngineSchema_
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 #include <qmf/engine/Typecode.h>
00024 #include <qpid/sys/IntegerTypes.h>
00025 
00026 namespace qmf {
00027 namespace engine {
00028 
00029     enum Access { ACCESS_READ_CREATE = 1, ACCESS_READ_WRITE = 2, ACCESS_READ_ONLY = 3 };
00030     enum Direction { DIR_IN = 1, DIR_OUT = 2, DIR_IN_OUT = 3 };
00031     enum ClassKind { CLASS_OBJECT = 1, CLASS_EVENT = 2 };
00032     enum Severity { SEV_EMERG = 0, SEV_ALERT = 1, SEV_CRIT = 2, SEV_ERROR = 3, SEV_WARN = 4, SEV_NOTICE = 5, SEV_INFORM = 6, SEV_DEBUG = 7 };
00033 
00034     struct SchemaArgumentImpl;
00035     struct SchemaMethodImpl;
00036     struct SchemaPropertyImpl;
00037     struct SchemaStatisticImpl;
00038     struct SchemaObjectClassImpl;
00039     struct SchemaEventClassImpl;
00040     struct SchemaClassKeyImpl;
00041 
00044     class SchemaArgument {
00045     public:
00046         SchemaArgument(const char* name, Typecode typecode);
00047         SchemaArgument(const SchemaArgument& from);
00048         ~SchemaArgument();
00049         void setDirection(Direction dir);
00050         void setUnit(const char* val);
00051         void setDesc(const char* desc);
00052         const char* getName() const;
00053         Typecode getType() const;
00054         Direction getDirection() const;
00055         const char* getUnit() const;
00056         const char* getDesc() const;
00057 
00058     private:
00059         friend struct SchemaArgumentImpl;
00060         friend struct SchemaMethodImpl;
00061         friend struct SchemaEventClassImpl;
00062         SchemaArgument(SchemaArgumentImpl* impl);
00063         SchemaArgumentImpl* impl;
00064     };
00065 
00068     class SchemaMethod {
00069     public:
00070         SchemaMethod(const char* name);
00071         SchemaMethod(const SchemaMethod& from);
00072         ~SchemaMethod();
00073         void addArgument(const SchemaArgument* argument);
00074         void setDesc(const char* desc);
00075         const char* getName() const;
00076         const char* getDesc() const;
00077         int getArgumentCount() const;
00078         const SchemaArgument* getArgument(int idx) const;
00079 
00080     private:
00081         friend struct SchemaMethodImpl;
00082         friend struct SchemaObjectClassImpl;
00083         friend class  AgentImpl;
00084         SchemaMethod(SchemaMethodImpl* impl);
00085         SchemaMethodImpl* impl;
00086     };
00087 
00090     class SchemaProperty {
00091     public:
00092         SchemaProperty(const char* name, Typecode typecode);
00093         SchemaProperty(const SchemaProperty& from);
00094         ~SchemaProperty();
00095         void setAccess(Access access);
00096         void setIndex(bool val);
00097         void setOptional(bool val);
00098         void setUnit(const char* val);
00099         void setDesc(const char* desc);
00100         const char* getName() const;
00101         Typecode getType() const;
00102         Access getAccess() const;
00103         bool isIndex() const;
00104         bool isOptional() const;
00105         const char* getUnit() const;
00106         const char* getDesc() const;
00107 
00108     private:
00109         friend struct SchemaPropertyImpl;
00110         friend struct SchemaObjectClassImpl;
00111         SchemaProperty(SchemaPropertyImpl* impl);
00112         SchemaPropertyImpl* impl;
00113     };
00114 
00117     class SchemaStatistic {
00118     public:
00119         SchemaStatistic(const char* name, Typecode typecode);
00120         SchemaStatistic(const SchemaStatistic& from);
00121         ~SchemaStatistic();
00122         void setUnit(const char* val);
00123         void setDesc(const char* desc);
00124         const char* getName() const;
00125         Typecode getType() const;
00126         const char* getUnit() const;
00127         const char* getDesc() const;
00128 
00129     private:
00130         friend struct SchemaStatisticImpl;
00131         friend struct SchemaObjectClassImpl;
00132         SchemaStatistic(SchemaStatisticImpl* impl);
00133         SchemaStatisticImpl* impl;
00134     };
00135 
00138     class SchemaClassKey {
00139     public:
00140         SchemaClassKey(const SchemaClassKey& from);
00141         ~SchemaClassKey();
00142 
00143         const char* getPackageName() const;
00144         const char* getClassName() const;
00145         const uint8_t* getHash() const;
00146         const char* asString() const;
00147 
00148         bool operator==(const SchemaClassKey& other) const;
00149         bool operator<(const SchemaClassKey& other) const;
00150 
00151     private:
00152         friend struct SchemaClassKeyImpl;
00153         friend class BrokerProxyImpl;
00154         friend class ConsoleImpl;
00155         SchemaClassKey(SchemaClassKeyImpl* impl);
00156         SchemaClassKeyImpl* impl;
00157     };
00158 
00161     class SchemaObjectClass {
00162     public:
00163         SchemaObjectClass(const char* package, const char* name);
00164         SchemaObjectClass(const SchemaObjectClass& from);
00165         ~SchemaObjectClass();
00166         void addProperty(const SchemaProperty* property);
00167         void addStatistic(const SchemaStatistic* statistic);
00168         void addMethod(const SchemaMethod* method);
00169 
00170         const SchemaClassKey* getClassKey() const;
00171         int getPropertyCount() const;
00172         int getStatisticCount() const;
00173         int getMethodCount() const;
00174         const SchemaProperty* getProperty(int idx) const;
00175         const SchemaStatistic* getStatistic(int idx) const;
00176         const SchemaMethod* getMethod(int idx) const;
00177 
00178     private:
00179         friend struct SchemaObjectClassImpl;
00180         friend class  BrokerProxyImpl;
00181         friend class  AgentImpl;
00182         SchemaObjectClass(SchemaObjectClassImpl* impl);
00183         SchemaObjectClassImpl* impl;
00184     };
00185 
00188     class SchemaEventClass {
00189     public:
00190         SchemaEventClass(const char* package, const char* name, Severity severity);
00191         SchemaEventClass(const SchemaEventClass& from);
00192         ~SchemaEventClass();
00193         void addArgument(const SchemaArgument* argument);
00194         void setDesc(const char* desc);
00195 
00196         const SchemaClassKey* getClassKey() const;
00197         Severity getSeverity() const;
00198         int getArgumentCount() const;
00199         const SchemaArgument* getArgument(int idx) const;
00200 
00201     private:
00202         friend struct SchemaEventClassImpl;
00203         friend class  BrokerProxyImpl;
00204         friend class  AgentImpl;
00205         SchemaEventClass(SchemaEventClassImpl* impl);
00206         SchemaEventClassImpl* impl;
00207     };
00208 }
00209 }
00210 
00211 #endif
00212 

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4