1 martin 1.2 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.3 //
|
3 martin 1.2 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.3 //
|
10 martin 1.2 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.3 //
|
17 martin 1.2 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.3 //
|
20 martin 1.2 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.3 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.2 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.3 //
|
28 martin 1.2 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_MRRTypes_h
33 #define Pegasus_MRRTypes_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/CIMType.h>
37 #include "Linkage.h"
38
39 #define MRR_FLAG_PROPERTY (1 << 0)
40 #define MRR_FLAG_REFERENCE (1 << 1)
41 #define MRR_FLAG_METHOD (1 << 2)
42 #define MRR_FLAG_CLASS (1 << 3)
43 #define MRR_FLAG_ABSTRACT (1 << 4)
44 #define MRR_FLAG_AGGREGATE (1 << 5)
45 #define MRR_FLAG_AGGREGATION (1 << 6)
46 #define MRR_FLAG_ASSOCIATION (1 << 7)
47 #define MRR_FLAG_COMPOSITION (1 << 8)
48 #define MRR_FLAG_COUNTER (1 << 9)
49 #define MRR_FLAG_DELETE (1 << 10)
50 mike 1.1 #define MRR_FLAG_DN (1 << 11)
51 #define MRR_FLAG_EMBEDDEDOBJECT (1 << 12)
52 #define MRR_FLAG_EXCEPTION (1 << 13)
53 #define MRR_FLAG_EXPENSIVE (1 << 14)
54 #define MRR_FLAG_EXPERIMENTAL (1 << 15)
55 #define MRR_FLAG_GAUGE (1 << 16)
56 #define MRR_FLAG_IFDELETED (1 << 17)
57 #define MRR_FLAG_IN (1 << 18)
58 #define MRR_FLAG_INDICATION (1 << 19)
59 #define MRR_FLAG_INVISIBLE (1 << 20)
60 #define MRR_FLAG_KEY (1 << 21)
61 #define MRR_FLAG_LARGE (1 << 22)
62 #define MRR_FLAG_OCTETSTRING (1 << 23)
63 #define MRR_FLAG_OUT (1 << 24)
64 #define MRR_FLAG_READ (1 << 25)
65 #define MRR_FLAG_REQUIRED (1 << 26)
66 #define MRR_FLAG_STATIC (1 << 27)
67 #define MRR_FLAG_TERMINAL (1 << 28)
68 #define MRR_FLAG_WEAK (1 << 29)
69 #define MRR_FLAG_WRITE (1 << 30)
70 #define MRR_FLAG_EMBEDDEDINSTANCE (1 << 31)
71 mike 1.1
72 #define MRR_SCOPE_MRR (1 << 0)
73 #define MRR_SCOPE_CLASS (1 << 1)
74 #define MRR_SCOPE_ASSOCIATION (1 << 2)
75 #define MRR_SCOPE_INDICATION (1 << 3)
76 #define MRR_SCOPE_PROPERTY (1 << 4)
77 #define MRR_SCOPE_REFERENCE (1 << 5)
78 #define MRR_SCOPE_METHOD (1 << 6)
79 #define MRR_SCOPE_PARAMETER (1 << 7)
80 #define MRR_SCOPE_ANY (1|2|4|8|16|32|64|128)
81
82 #define MRR_FLAVOR_OVERRIDABLE (1 << 0)
83 #define MRR_FLAVOR_TOSUBCLASS (1 << 1)
84 #define MRR_FLAVOR_TOINSTANCE (1 << 2)
85 #define MRR_FLAVOR_TRANSLATABLE (1 << 3)
86 #define MRR_FLAVOR_DISABLEOVERRIDE (1 << 4)
87 #define MRR_FLAVOR_RESTRICTED (1 << 5)
88
89 #define MRR_MAX_FEATURES 256
90
91 PEGASUS_NAMESPACE_BEGIN
92 mike 1.1
93 struct MRRFeature
94 {
95 Uint32 flags;
96 char* name;
97 const char** qualifiers;
98 };
99
100 struct MRRProperty /* extends MRRFeature */
101 {
102 // Inherited fields:
103 Uint32 flags;
104 char* name;
105 const char** qualifiers;
106
107 // Local fields:
108 Uint16 type;
109 Sint16 subscript;
110 const char* value;
111 };
112
113 mike 1.1 struct MRRReference /* extends MRRFeature */
114 {
115 // Inherited fields:
116 Uint32 flags;
117 char* name;
118 const char** qualifiers;
119
120 // Local fields:
121 Sint16 subscript;
122 struct MRRClass* ref;
123 };
124
125 struct MRRMethod /* extends MRRFeature */
126 {
127 // Inherited fields:
128 Uint32 flags;
129 char* name;
130 const char** qualifiers;
131
132 // Local fields:
133 Uint16 type;
134 mike 1.1 MRRFeature** parameters;
135 };
136
137 struct MRRClass
138 {
139 Uint32 flags;
140 char* name;
141 const char** qualifiers;
142 struct MRRClass* super;
143 MRRFeature** features;
144 };
145
146 struct MRRQualifierDecl
147 {
148 char* name;
149 Uint16 type;
150 Sint16 subscript;
151 Uint16 scope;
152 Uint16 flavor;
153 const char* value;
154 };
155 mike 1.1
156 struct MRRNameSpace
157 {
158 char* name;
159 MRRQualifierDecl** qualifiers;
160 MRRClass** classes;
161 };
162
163 const MRRQualifierDecl* FindQualifierDecl(
|
164 kumpf 1.4 const MRRNameSpace* ns,
|
165 mike 1.1 const char* name);
166
167 const MRRClass* FindClass(const MRRNameSpace* ns, const char* name);
168
169 bool IsSubClass(const MRRClass* super, const MRRClass* sub);
170
171 inline bool IsA(const MRRClass* super, const MRRClass* sub)
172 {
173 return sub == super || IsSubClass(super, sub);
174 }
175
176 struct MRRFeatureInfo
177 {
178 const MRRFeature* sf;
179 const MRRClass* sc;
180 };
181
182 int MergeFeatures(
183 const MRRClass* sc,
184 bool localOnly,
185 Uint32 flags,
186 mike 1.1 MRRFeatureInfo features[MRR_MAX_FEATURES],
187 size_t& numFeatures);
188
189 int MakeClass(
190 const char* hostName,
191 const MRRNameSpace* ns,
192 const MRRClass* sc,
193 Boolean localOnly,
194 Boolean includeQualifiers,
195 Boolean includeClassOrigin,
196 const char* const* propertyList,
197 class CIMClass& cc);
198
199 int MakeQualifierDecl(
200 const MRRNameSpace* ns,
201 const MRRQualifierDecl* mqd,
202 class CIMQualifierDecl& cqd);
203
204 const MRRFeature* FindFeature(
|
205 kumpf 1.4 const MRRClass* sc,
|
206 mike 1.1 const char* name,
|
207 kumpf 1.4 Uint32 flags =
|
208 mike 1.1 (MRR_FLAG_PROPERTY|MRR_FLAG_REFERENCE|MRR_FLAG_METHOD));
209
210 PEGASUS_NAMESPACE_END
211
212 #endif /* Pegasus_MRRTypes_h */
|