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