Qpid Management Framework  0.24
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Schema.h
Go to the documentation of this file.
1 #ifndef _QmfEngineSchema_
2 #define _QmfEngineSchema_
3 
4 /*
5  * Licensed to the Apache Software Foundation (ASF) under one
6  * or more contributor license agreements. See the NOTICE file
7  * distributed with this work for additional information
8  * regarding copyright ownership. The ASF licenses this file
9  * to you under the Apache License, Version 2.0 (the
10  * "License"); you may not use this file except in compliance
11  * with the License. You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing,
16  * software distributed under the License is distributed on an
17  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  * KIND, either express or implied. See the License for the
19  * specific language governing permissions and limitations
20  * under the License.
21  */
22 
23 #include <qmf/engine/Typecode.h>
24 #include <qpid/sys/IntegerTypes.h>
25 
26 namespace qmf {
27 namespace engine {
28 
30  enum Direction { DIR_IN = 1, DIR_OUT = 2, DIR_IN_OUT = 3 };
31  enum ClassKind { CLASS_OBJECT = 1, CLASS_EVENT = 2 };
32  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 };
33 
34  struct SchemaArgumentImpl;
35  struct SchemaMethodImpl;
36  struct SchemaPropertyImpl;
37  struct SchemaStatisticImpl;
38  struct SchemaObjectClassImpl;
39  struct SchemaEventClassImpl;
40  struct SchemaClassKeyImpl;
41 
45  public:
46  SchemaArgument(const char* name, Typecode typecode);
47  SchemaArgument(const SchemaArgument& from);
49  void setDirection(Direction dir);
50  void setUnit(const char* val);
51  void setDesc(const char* desc);
52  const char* getName() const;
53  Typecode getType() const;
54  Direction getDirection() const;
55  const char* getUnit() const;
56  const char* getDesc() const;
57 
58  private:
59  friend struct SchemaArgumentImpl;
60  friend struct SchemaMethodImpl;
61  friend struct SchemaEventClassImpl;
63  SchemaArgumentImpl* impl;
64  };
65 
68  class SchemaMethod {
69  public:
70  SchemaMethod(const char* name);
71  SchemaMethod(const SchemaMethod& from);
72  ~SchemaMethod();
73  void addArgument(const SchemaArgument* argument);
74  void setDesc(const char* desc);
75  const char* getName() const;
76  const char* getDesc() const;
77  int getArgumentCount() const;
78  const SchemaArgument* getArgument(int idx) const;
79 
80  private:
81  friend struct SchemaMethodImpl;
82  friend struct SchemaObjectClassImpl;
83  friend class AgentImpl;
85  SchemaMethodImpl* impl;
86  };
87 
91  public:
92  SchemaProperty(const char* name, Typecode typecode);
93  SchemaProperty(const SchemaProperty& from);
95  void setAccess(Access access);
96  void setIndex(bool val);
97  void setOptional(bool val);
98  void setUnit(const char* val);
99  void setDesc(const char* desc);
100  const char* getName() const;
101  Typecode getType() const;
102  Access getAccess() const;
103  bool isIndex() const;
104  bool isOptional() const;
105  const char* getUnit() const;
106  const char* getDesc() const;
107 
108  private:
109  friend struct SchemaPropertyImpl;
110  friend struct SchemaObjectClassImpl;
112  SchemaPropertyImpl* impl;
113  };
114 
118  public:
119  SchemaStatistic(const char* name, Typecode typecode);
120  SchemaStatistic(const SchemaStatistic& from);
122  void setUnit(const char* val);
123  void setDesc(const char* desc);
124  const char* getName() const;
125  Typecode getType() const;
126  const char* getUnit() const;
127  const char* getDesc() const;
128 
129  private:
130  friend struct SchemaStatisticImpl;
131  friend struct SchemaObjectClassImpl;
133  SchemaStatisticImpl* impl;
134  };
135 
139  public:
140  SchemaClassKey(const SchemaClassKey& from);
141  ~SchemaClassKey();
142 
143  const char* getPackageName() const;
144  const char* getClassName() const;
145  const uint8_t* getHash() const;
146  const char* asString() const;
147 
148  bool operator==(const SchemaClassKey& other) const;
149  bool operator<(const SchemaClassKey& other) const;
150 
151  private:
152  friend struct SchemaClassKeyImpl;
153  friend class BrokerProxyImpl;
154  friend class ConsoleImpl;
156  SchemaClassKeyImpl* impl;
157  };
158 
162  public:
163  SchemaObjectClass(const char* package, const char* name);
166  void addProperty(const SchemaProperty* property);
167  void addStatistic(const SchemaStatistic* statistic);
168  void addMethod(const SchemaMethod* method);
169 
170  const SchemaClassKey* getClassKey() const;
171  int getPropertyCount() const;
172  int getStatisticCount() const;
173  int getMethodCount() const;
174  const SchemaProperty* getProperty(int idx) const;
175  const SchemaStatistic* getStatistic(int idx) const;
176  const SchemaMethod* getMethod(int idx) const;
177 
178  private:
179  friend struct SchemaObjectClassImpl;
180  friend class BrokerProxyImpl;
181  friend class AgentImpl;
183  SchemaObjectClassImpl* impl;
184  };
185 
189  public:
190  SchemaEventClass(const char* package, const char* name, Severity severity);
191  SchemaEventClass(const SchemaEventClass& from);
193  void addArgument(const SchemaArgument* argument);
194  void setDesc(const char* desc);
195 
196  const SchemaClassKey* getClassKey() const;
197  Severity getSeverity() const;
198  int getArgumentCount() const;
199  const SchemaArgument* getArgument(int idx) const;
200 
201  private:
202  friend struct SchemaEventClassImpl;
203  friend class BrokerProxyImpl;
204  friend class AgentImpl;
206  SchemaEventClassImpl* impl;
207  };
208 }
209 }
210 
211 #endif
212