1 mike 1.1.2.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.2.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_SchemaTypes_h
35 #define Pegasus_SchemaTypes_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/CIMType.h>
39 #include "Linkage.h"
40
41 #define SCHEMA_FLAG_PROPERTY (1 << 0)
42 #define SCHEMA_FLAG_REFERENCE (1 << 1)
43 mike 1.1.2.1 #define SCHEMA_FLAG_METHOD (1 << 2)
44 #define SCHEMA_FLAG_CLASS (1 << 3)
45 #define SCHEMA_FLAG_ABSTRACT (1 << 4)
46 #define SCHEMA_FLAG_AGGREGATE (1 << 5)
47 #define SCHEMA_FLAG_AGGREGATION (1 << 6)
48 #define SCHEMA_FLAG_ASSOCIATION (1 << 7)
49 #define SCHEMA_FLAG_COMPOSITION (1 << 8)
50 #define SCHEMA_FLAG_COUNTER (1 << 9)
51 #define SCHEMA_FLAG_DELETE (1 << 10)
52 #define SCHEMA_FLAG_DN (1 << 11)
53 #define SCHEMA_FLAG_EMBEDDEDOBJECT (1 << 12)
54 #define SCHEMA_FLAG_EXCEPTION (1 << 13)
55 #define SCHEMA_FLAG_EXPENSIVE (1 << 14)
56 #define SCHEMA_FLAG_EXPERIMENTAL (1 << 15)
57 #define SCHEMA_FLAG_GAUGE (1 << 16)
58 #define SCHEMA_FLAG_IFDELETED (1 << 17)
59 #define SCHEMA_FLAG_IN (1 << 18)
60 #define SCHEMA_FLAG_INDICATION (1 << 19)
61 #define SCHEMA_FLAG_INVISIBLE (1 << 20)
62 #define SCHEMA_FLAG_KEY (1 << 21)
63 #define SCHEMA_FLAG_LARGE (1 << 22)
64 mike 1.1.2.1 #define SCHEMA_FLAG_OCTETSTRING (1 << 23)
65 #define SCHEMA_FLAG_OUT (1 << 24)
66 #define SCHEMA_FLAG_READ (1 << 25)
67 #define SCHEMA_FLAG_REQUIRED (1 << 26)
68 #define SCHEMA_FLAG_STATIC (1 << 27)
69 #define SCHEMA_FLAG_TERMINAL (1 << 28)
70 #define SCHEMA_FLAG_WEAK (1 << 29)
71 #define SCHEMA_FLAG_WRITE (1 << 30)
72 #define SCHEMA_FLAG_EMBEDDEDINSTANCE (1 << 31)
73
74 #define SCHEMA_SCOPE_SCHEMA (1 << 0)
75 #define SCHEMA_SCOPE_CLASS (1 << 1)
76 #define SCHEMA_SCOPE_ASSOCIATION (1 << 2)
77 #define SCHEMA_SCOPE_INDICATION (1 << 3)
78 #define SCHEMA_SCOPE_PROPERTY (1 << 4)
79 #define SCHEMA_SCOPE_REFERENCE (1 << 5)
80 #define SCHEMA_SCOPE_METHOD (1 << 6)
81 #define SCHEMA_SCOPE_PARAMETER (1 << 7)
82 #define SCHEMA_SCOPE_ANY (1|2|4|8|16|32|64|128)
83
84 #define SCHEMA_FLAVOR_OVERRIDABLE (1 << 0)
85 mike 1.1.2.1 #define SCHEMA_FLAVOR_TOSUBCLASS (1 << 1)
86 #define SCHEMA_FLAVOR_TOINSTANCE (1 << 2)
87 #define SCHEMA_FLAVOR_TRANSLATABLE (1 << 3)
88 #define SCHEMA_FLAVOR_DISABLEOVERRIDE (1 << 4)
89 #define SCHEMA_FLAVOR_RESTRICTED (1 << 5)
90
91 #define SCHEMA_MAX_FEATURES 256
92
93 PEGASUS_NAMESPACE_BEGIN
94
95 struct SchemaFeature
96 {
97 Uint32 flags;
98 char* name;
99 const char** qualifiers;
100 };
101
102 struct SchemaProperty /* extends SchemaFeature */
103 {
104 // Inherited fields:
105 Uint32 flags;
106 mike 1.1.2.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 SchemaReference /* extends SchemaFeature */
116 {
117 // Inherited fields:
118 Uint32 flags;
119 char* name;
120 const char** qualifiers;
121
122 // Local fields:
123 Sint16 subscript;
124 struct SchemaClass* ref;
125 };
126
127 mike 1.1.2.1 struct SchemaMethod /* extends SchemaFeature */
128 {
129 // Inherited fields:
130 Uint32 flags;
131 char* name;
132 const char** qualifiers;
133
134 // Local fields:
135 Uint16 type;
136 SchemaFeature** parameters;
137 };
138
139 struct SchemaClass
140 {
141 Uint32 flags;
142 char* name;
143 const char** qualifiers;
144 struct SchemaClass* super;
145 SchemaFeature** features;
146 };
147
148 mike 1.1.2.1 struct SchemaQualifierDecl
149 {
150 char* name;
151 Uint16 type;
152 Sint16 subscript;
153 Uint16 scope;
154 Uint16 flavor;
155 const char* value;
156 };
157
158 struct SchemaNameSpace
159 {
160 char* name;
161 SchemaQualifierDecl** qualifiers;
162 SchemaClass** classes;
163 };
164
165 const SchemaQualifierDecl* FindQualifierDecl(
166 const SchemaNameSpace* ns,
167 const char* name);
168
169 mike 1.1.2.1 const SchemaClass* FindClass(const SchemaNameSpace* ns, const char* name);
170
171 bool IsSubClass(const SchemaClass* super, const SchemaClass* sub);
172
173 inline bool IsA(const SchemaClass* super, const SchemaClass* sub)
174 {
175 return sub == super || IsSubClass(super, sub);
176 }
177
178 struct SchemaFeatureInfo
179 {
|
186 mike 1.1.2.1 bool localOnly,
187 Uint32 flags,
188 SchemaFeatureInfo features[SCHEMA_MAX_FEATURES],
189 size_t& numFeatures);
190
191 int MakeClass(
192 const char* hostName,
193 const SchemaNameSpace* ns,
|
195 mike 1.1.2.1 Boolean localOnly,
196 Boolean includeQualifiers,
197 Boolean includeClassOrigin,
198 const char* const* propertyList,
199 class CIMClass& cc);
200
201 int MakeQualifierDecl(
202 const SchemaNameSpace* ns,
203 const SchemaQualifierDecl* mqd,
204 class CIMQualifierDecl& cqd);
205
206 const SchemaFeature* FindFeature(
|