1 karl 1.28 //%2006////////////////////////////////////////////////////////////////////////
|
2 konrad.r 1.2 //
|
3 karl 1.14 // 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 konrad.r 1.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.14 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.17 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.28 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 konrad.r 1.2 //
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 karl 1.14 //
|
21 konrad.r 1.2 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // 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 _CMPIMACS_H_
35 #define _CMPIMACS_H_
36
|
37 denise.eckstein 1.10 #ifndef DOC_ONLY
|
38 konrad.r 1.2 #include "cmpidt.h"
39 #include "cmpift.h"
|
40 denise.eckstein 1.10 #endif
|
41 konrad.r 1.2
42 #ifdef DOC_ONLY
43 #define CMPI_INLINE
44 #endif
45
46 #ifdef DOC_ONLY
|
47 konrad.r 1.11 /** This macro builds a CMPIStatus object with <rc> as return code and returns
|
48 konrad.r 1.2 to the Broker.
49 @param rc the CMPI return code
50 @return This macro contains a return statement and leaves the function.
51 */
52 noReturn CMReturn(CMPIrc rc);
53 #else
54 #define CMReturn(rc) \
55 { CMPIStatus stat={(rc),NULL}; \
56 return stat; }
57 #endif
58
59 #ifdef DOC_ONLY
|
60 konrad.r 1.11 /** This macro builds a CMPIStatus object with <rc> as return code and <str> as
|
61 konrad.r 1.2 message and returns to the Broker.
62 @param rc the CMPI return code
63 @param str the message as String object
64 @return This macro contains a return statement and leaves the function.
65 */
66 noReturn CMReturnWithString(CMPIrc rc, CMPIString *str);
67 #else
68 #define CMReturnWithString(rc,str) \
69 { CMPIStatus stat={(rc),(str)}; \
70 return stat; }
71 #endif
72
73 #ifdef DOC_ONLY
|
74 konrad.r 1.11 /** This macro builds a CMPIStatus object with <rc> as return code and <msg> as
|
75 konrad.r 1.2 message and returns to the Broker.
76 @param mb Broker this pointer
77 @param rc the CMPI return code
78 @param msg the message as character string
79 @return This macro contains a return statement and leaves the function.
80 */
|
81 konrad.r 1.20 noReturn CMReturnWithChars(const CMPIBroker *mb, CMPIrc rc, char *msg);
|
82 konrad.r 1.2 #else
83 #define CMReturnWithChars(b,rc,chars) \
84 { CMPIStatus stat={(rc),NULL}; \
85 stat.msg=(b)->eft->newString((b),(chars),NULL); \
86 return stat; }
87 #endif
88
89
90 #ifdef CMPI_INLINE
91 /** Initializes status object with rc and NULL message.
92 @param st Address of status object
93 @param rcp CMPI return code
94 */
95 inline static void CMSetStatus(CMPIStatus* st, CMPIrc rcp)
96 { (st)->rc=(rcp); (st)->msg=NULL; }
97 #else
98 #define CMSetStatus(st,rcp) \
99 { (st)->rc=(rcp); (st)->msg=NULL; }
100 #endif
101
102
103 konrad.r 1.2 #ifdef CMPI_INLINE
104 /** Initializes status object with rc and message.
105 @param mb Broker this pointer
106 @param st Address of status object
107 @param rcp CMPI return code
108 @param string Message string
109 */
|
110 konrad.r 1.20 inline static void CMSetStatusWithString(const CMPIBroker *mb, CMPIStatus *st, CMPIrc rcp,
|
111 konrad.r 1.23 const CMPIString *string)
|
112 konrad.r 1.2 { (st)->rc=(rcp); (st)->msg=(string); }
113 #else
114 #define CMSetStatusWithString(st,rcp,string) \
115 { (st)->rc=(rcp); (st)->msg=(string); }
116 #endif
117
118
119 #ifdef CMPI_INLINE
120 /** Initializes status object with rc and message.
121 @param mb Broker this pointer
122 @param st Address of status object
123 @param rcp CMPI return code
124 @param chars Message character string
125 */
|
126 konrad.r 1.20 inline static void CMSetStatusWithChars(const CMPIBroker *mb, CMPIStatus* st, CMPIrc rcp,
127 const char* chars)
|
128 konrad.r 1.2 { (st)->rc=(rcp);
129 (st)->msg=(mb)->eft->newString((mb),(chars),NULL); }
130 #else
131 #define CMSetStatusWithChars(mb,st,rcp,chars) \
132 { (st)->rc=(rcp); \
133 (st)->msg=(mb)->eft->newString((mb),(chars),NULL); }
134 #endif
135
|
136 mike 1.29 /* Define CMPI_EXPORT */
|
137 konrad.r 1.2 #ifndef DOC_ONLY
|
138 mike 1.29 # if defined(CMPI_PLATFORM_WIN32_IX86_MSVC)
139 # define CMPI_EXPORT __declspec(dllexport)
140 # elif defined(CMPI_PLATFORM_LINUX_GENERIC_GNU) && (__GNUC__ >= 4)
141 # define CMPI_EXPORT __attribute__((visibility("default")))
142 # else
143 # define CMPI_EXPORT /* empty */
144 # endif
145 #endif
146
147 /* Define CMPI_EXTERN_C */
148 #ifndef DOC_ONLY
149 # ifdef __cplusplus
150 # define CMPI_EXTERN_C extern "C" CMPI_EXPORT
151 # else
152 # define CMPI_EXTERN_C CMPI_EXPORT
153 # endif
|
154 konrad.r 1.2 #endif
155
156 #ifdef CMPI_INLINE
157 /** Tests for encapsulated NULL object.
158 @param obj CMPI Object pointer
159 */
|
160 konrad.r 1.23 inline static CMPIBoolean CMIsNullObject(const void* obj)
|
161 konrad.r 1.2 { return ((obj)==NULL || *((void**)(obj))==NULL); }
162 #else
163 #define CMIsNullObject(o) ((o)==NULL || *((void**)(o))==NULL)
164 #endif
165
166 #ifdef CMPI_INLINE
167 /** Tests for nullValue data item.
168 @param val Value object
169 */
|
170 konrad.r 1.23 inline static CMPIBoolean CMIsNullValue(const CMPIData val)
|
171 konrad.r 1.2 { return ((val.state) & CMPI_nullValue); }
172 #else
173 #define CMIsNullValue(v) ((v.state) & CMPI_nullValue)
174 #endif
175
176 #ifdef CMPI_INLINE
177 /** Tests for keyValue data item.
178 @param val Value object
179 */
180 inline static CMPIBoolean CMIsKeyValue(CMPIData val)
181 { return ((val.state) & CMPI_keyValue); }
182 #else
183 #define CMIsKeyValue(v) ((v.state) & CMPI_keyValue)
184 #endif
185
186 #ifdef CMPI_INLINE
187 /** Tests for keyValue data item.
188 @param val Value object
189 */
190 inline static CMPIBoolean CMIsArray(CMPIData val)
191 { return ((val.type) & CMPI_ARRAY); }
192 konrad.r 1.2 #else
193 #define CMIsArray(v) ((v.type) & CMPI_ARRAY)
194 #endif
195
196
197 // Life-cycle macros
198
199 #define CMClone(o,rc) ((o)->ft->clone((o),(rc)))
200 #define CMRelease(o) ((o)->ft->release((o)))
201 #define CMGetCharPtr(s) ((char*)s->hdl)
202
203 // CMPIBroker factory macros
204
205 #ifdef CMPI_INLINE
206 /** Instance factory service.
207 @param mb Broker this pointer
208 @param op ObjectPath containing namespace and classname.
209 @param rc Output: Service return status (suppressed when NULL).
210 @return The newly created Instance.
211 */
|
212 konrad.r 1.20 inline static CMPIInstance* CMNewInstance(const CMPIBroker *mb, const CMPIObjectPath *op,
|
213 konrad.r 1.2 CMPIStatus *rc)
214 { return ((mb)->eft->newInstance((mb),(op),(rc))); }
215 #else
216 #define CMNewInstance(b,c,rc) ((b)->eft->newInstance((b),(c),(rc)))
217 #endif
218
219 #ifdef CMPI_INLINE
220 /** ObjectPath factory service.
221 @param mb Broker this pointer
222 @param ns Namespace
223 @param cn Classname.
224 @param rc Output: Service return status (suppressed when NULL).
225 @return The newly created ObjectPath.
226 */
|
227 konrad.r 1.20 inline static CMPIObjectPath* CMNewObjectPath(const CMPIBroker *mb, const char *ns, const char *cn,
|
228 konrad.r 1.2 CMPIStatus *rc)
229 { return ((mb)->eft->newObjectPath((mb),(ns),(cn),(rc))); }
230 #else
231 #define CMNewObjectPath(b,n,c,rc) \
232 ((b)->eft->newObjectPath((b),(n),(c),(rc)))
233 #endif
234
235 #ifdef CMPI_INLINE
236 /** String container factory service.
237 @param mb Broker this pointer
238 @param data String data
239 @param rc Output: Service return status (suppressed when NULL).
240 @return The newly created String.
241 */
|
242 konrad.r 1.20 inline static CMPIString* CMNewString(const CMPIBroker* mb, const char *data, CMPIStatus *rc)
|
243 konrad.r 1.2 { return ((mb)->eft->newString((mb),(data),(rc))); }
244 #else
245 #define CMNewString(b,s,rc) ((b)->eft->newString((b),(s),(rc)))
246 #endif
247
248 #ifdef CMPI_INLINE
249 /** Args container factory service.
250 @param mb Broker this pointer
251 @param rc Output: Service return status (suppressed when NULL).
252 @return The newly created Args container.
253 */
|
254 konrad.r 1.20 inline static CMPIArgs* CMNewArgs(const CMPIBroker* mb, CMPIStatus* rc)
|
255 konrad.r 1.2 { return ((mb)->eft->newArgs((mb),(rc))); }
256 #else
257 #define CMNewArgs(b,rc) ((b)->eft->newArgs((b),(rc)))
258 #endif
259
260 #ifdef CMPI_INLINE
261 /** Array container factory service.
262 @param mb Broker this pointer
263 @param max Maximum number of elements
264 @param type Element type
265 @param rc Output: Service return status (suppressed when NULL).
266 @return The newly created Array.
267 */
|
268 konrad.r 1.20 inline static CMPIArray* CMNewArray(const CMPIBroker* mb, CMPICount max, CMPIType type,
|
269 konrad.r 1.2 CMPIStatus* rc)
270 { return ((mb)->eft->newArray((mb),(max),(type),(rc))); }
271 #else
272 #define CMNewArray(b,c,t,rc) ((b)->eft->newArray((b),(c),(t),(rc)))
273 #endif
274
275 #ifdef CMPI_INLINE
276 /** DateTime factory service. Initialized with the time of day.
277 @param mb Broker this pointer
278 @param rc Output: Service return status (suppressed when NULL).
279 @return The newly created DateTime.
280 */
|
281 konrad.r 1.20 inline static CMPIDateTime* CMNewDateTime(const CMPIBroker* mb, CMPIStatus* rc)
|
282 konrad.r 1.2 { return ((mb)->eft->newDateTime((mb),(rc))); }
283 #else
284 #define CMNewDateTime(b,rc) ((b)->eft->newDateTime((b),(rc)))
285 #endif
286
287 #ifdef CMPI_INLINE
|
288 konrad.r 1.11 /** DateTime factory service. Initialized from <binTime>.
|
289 konrad.r 1.2 @param mb Broker this pointer
290 @param binTime Date/Time definition in binary format in microsecods
291 starting since 00:00:00 GMT, Jan 1,1970.
292 @param interval Wenn true, defines Date/Time definition to be an interval value
293 @param rc Output: Service return status (suppressed when NULL).
294 @return The newly created DateTime.
295 */
296 inline static CMPIDateTime* CMNewDateTimeFromBinary
|
297 konrad.r 1.20 (const CMPIBroker* mb, CMPIUint64 binTime, CMPIBoolean interval,
|
298 konrad.r 1.2 CMPIStatus* rc)
299 { return ((mb)->eft->newDateTimeFromBinary((mb),(binTime),(interval),(rc))); }
300 #else
301 #define CMNewDateTimeFromBinary(b,d,i,rc) \
302 ((b)->eft->newDateTimeFromBinary((b),(d),(i),(rc)))
303 #endif
304
305 #ifdef CMPI_INLINE
|
306 konrad.r 1.11 /** DateTime factory service. Is initialized from <utcTime>.
|
307 konrad.r 1.2 @param mb Broker this pointer
308 @param utcTime Date/Time definition in UTC format
309 @param rc Output: Service return status (suppressed when NULL).
310 @return The newly created DateTime.
311 */
312 inline static CMPIDateTime* CMNewDateTimeFromChars
|
313 konrad.r 1.20 (const CMPIBroker* mb, char* utcTime, CMPIStatus* rc)
|
314 konrad.r 1.2 { return ((mb)->eft->newDateTimeFromChars((mb),(utcTime),(rc))); }
315 #else
316 #define CMNewDateTimeFromChars(b,d,rc) \
317 ((b)->eft->newDateTimeFromChars((b),(d),(rc)))
318 #endif
319
320 #ifdef CMPI_INLINE
321 /** SelectExp factory service. TBD.
322 @param mb Broker this pointer
323 @param query The select expression.
324 @param lang The query language.
325 @param projection Output: Projection specification (suppressed when NULL).
326 @param rc Output: Service return status (suppressed when NULL).
327 @return The newly created SelectExp.
328 */
329 inline static CMPISelectExp* CMNewSelectExp
|
330 konrad.r 1.20 (const CMPIBroker* mb, const char* query, const char* lang,
|
331 konrad.r 1.2 CMPIArray** projection, CMPIStatus* rc)
332 { return ((mb)->eft->newSelectExp((mb),(query),(lang),(projection),(rc))); }
333 #else
334 #define CMNewSelectExp(b,q,l,p,rc) \
335 ((b)->eft->newSelectExp((b),(q),(l),(p),(rc)))
336 #endif
337
338 #ifdef CMPI_INLINE
|
339 konrad.r 1.11 /** Function to determine whether a CIM class is of <type> or any of
340 <type> subclasses.
|
341 konrad.r 1.2 @param mb Broker this pointer
342 @param op The class path (namespace and classname components).
343 @param type The type to tested for.
344 @param rc Output: Service return status (suppressed when NULL).
345 @return True if test successful.
346 */
347 inline static CMPIBoolean CMClassPathIsA
|
348 konrad.r 1.20 (const CMPIBroker* mb, const CMPIObjectPath* op, const char* type, CMPIStatus* rc)
|
349 konrad.r 1.2 { return ((mb)->eft->classPathIsA((mb),(op),(type),(rc))); }
350 #else
351 #define CMClassPathIsA(b,p,pn,rc) \
352 ((b)->eft->classPathIsA((b),(p),(pn),(rc)))
353 #endif
354
355 // Debugging macros
356
357 #ifdef CMPI_INLINE
358 /** Attempts to transforms an CMPI object to a broker specific string format.
359 Intended for debugging purposes only.
360 @param mb Broker this pointer
361 @param object A valid CMPI object.
362 @param rc Output: Service return status (suppressed when NULL).
|
363 konrad.r 1.11 @return String from representation of <object>.
|
364 konrad.r 1.2 */
365 inline static CMPIString* CDToString
|
366 konrad.r 1.20 (const CMPIBroker* mb, const void* object, CMPIStatus* rc)
|
367 konrad.r 1.2 { return ((mb)->eft->toString((mb),(void*)(object),(rc))); }
368 #else
369 #define CDToString(b,o,rc) ((b)->eft->toString((b),(void*)(o),(rc)))
370 #endif
371
372 #ifdef CMPI_INLINE
|
373 konrad.r 1.11 /** Verifies whether <object> is of CMPI type <type>.
|
374 konrad.r 1.2 Intended for debugging purposes only.
375 @param mb Broker this pointer
376 @param object A valid CMPI object.
377 @param type A string specifying a valid CMPI Object type
378 ("CMPIInstance", "CMPIObjectPath", etc).
379 @param rc Output: Service return status (suppressed when NULL).
380 @return True if test successful.
381 */
382 inline static CMPIBoolean CDIsOfType
|
383 konrad.r 1.20 (const CMPIBroker* mb, const void* object, const char* type, CMPIStatus* rc)
|
384 konrad.r 1.2 { return ((mb)->eft->isOfType((mb),(void*)(object),(type),(rc))); }
385 #else
386 #define CDIsOfType(b,o,t,rc) \
|
387 konrad.r 1.20 (b)->eft->isOfType((b),(void*)(o),(t),(rc))
|
388 konrad.r 1.2 #endif
389
390 #ifdef CMPI_INLINE
|
391 konrad.r 1.11 /** Retrieves the CMPI type of <object>.
|
392 konrad.r 1.2 Intended for debugging purposes only.
393 @param mb Broker this pointer
394 @param object A valid CMPI object.
395 @param rc Output: Service return status (suppressed when NULL).
396 @return CMPI object type.
397 */
398 inline static CMPIString* CDGetType
|
399 konrad.r 1.20 (const CMPIBroker* mb, const void* object, CMPIStatus* rc)
|
400 konrad.r 1.2 { return ((mb)->eft->getType((mb),(object),(rc))); }
401 #else
402 #define CDGetType(b,o,rc) ((b)->eft->getType((b),(void*)(o),(rc)))
403 #endif
404
405 #if defined(CMPI_VER_85)
406 #ifdef DOC_ONLY
407 /** Retrieves translated message. When using as macro, use
408 CMFmtArgsX and CMFmtX macros to generate the variable parameter list and ommit
409 the count parameter.
410 @example CMGetMessage(_broker,"msgid","Test $0 $1",NULL,
411 CMFmtArgs2(CMFmtChars("message"),CMFmtSint(1));
412 @param mb Broker this pointer
413 @param msgId The message identifier.
414 @param defMsg The default message. The message can have up to 10 message
415 insert placeholders ($0 through $9). The placeholders will be
416 replaced by the corresponding message insert values.
417 @param rc Output: Service return status (suppressed when NULL).
418 @param count The number of message insert values. Ommit when using
419 CMGetMessage as macro.
420 @param ... Up to 10 Message insert values.
421 konrad.r 1.2 These are specified using the following macros:
422 CMFmtSint(v) integer value
423 CMFmtUint(v) unsigned integer value
424 CMFmtSint64(v) long integer value
425 CMFmtUint64(v) long unsigned integer vale
426 CMFmtReal(v) float or double real value
427 CMFmtBoolean(v) CMPIBoolean value
428 CMFmtChars(v) char string
429 CMFmtString(v) CMPIString
430 @return the translated message.
431 */
|
432 konrad.r 1.20 inline static CMPIString* CMGetMessage
433 (const CMPIBroker* mb, const char *msgId, const char *defMsg, CMPIStatus* rc, unsigned int, ...);
|
434 konrad.r 1.2 #endif
435
436 #define CMFmtSint(v) CMPI_sint32,((long int)v)
437 #define CMFmtUint(v) CMPI_uint32,((unsigned long int)v)
438 #define CMFmtSint64(v) CMPI_sint64,((long long int)v)
439 #define CMFmtUint64(v) CMPI_uint64,((unsigned long long int)v)
440 #define CMFmtReal(v) CMPI_real64,((double)v)
441 #define CMFmtBoolean(v) CMPI_boolean,((int)v)
442 #define CMFmtChars(v) CMPI_chars,((char*)v)
443 #define CMFmtString(v) CMPI_String,((CMPI_String*)v)
444
445 #define CMFmtArgs0() 0
446 #define CMFmtArgs1(v1) \
447 1,v1
448 #define CMFmtArgs2(v1,v2) \
449 2,v1,v2
450 #define CMFmtArgs3(v1,v2,v3) \
451 3,v1,v2,v3
452 #define CMFmtArgs4(v1,v2,v3,v4) \
453 4,v1,v2,v3,v4
454 #define CMFmtArgs5(v1,v2,v3,v4,v5) \
455 konrad.r 1.2 5,v1,v2,v3,v4,v5
456 #define CMFmtArgs6(v1,v2,v3,v4,v5,v6) \
457 6,v1,v2,v3,v4,v5,v6
458 #define CMFmtArgs7(v1,v2,v3,v4,v5,v6,v7) \
459 7,v1,v2,v3,v4,v5,v6,v7
460 #define CMFmtArgs8(v1,v2,v3,v4,v5,v6,v7,v8) \
461 8,v1,v2,v3,v4,v5,v6,v7,v8
462 #define CMFmtArgs9(v1,v2,v3,v4,v5,v6,v7,v8,v9) \
463 9,v1,v2,v3,v4,v5,v6,v7,v8,v9
464 #define CMFmtArgs10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10) \
465 10,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
466
467 #define CMGetMessage(b,id,def,rc,parms) ((b)->eft->getMessage((b),(id),(def),(rc),parms))
468 #endif //CMPI_VER_85
469
|
470 konrad.r 1.20
471 #ifdef CMPI_VER_100
472 #ifdef CMPI_INLINE
|
473 konrad.r 1.25 /** Logs the message to the standard logging facility.
474 @example CMLogMessage(_broker, 1, "TestProvider","Entering EnumerateInstance", NULL);
475 @param mb Broker this pointer
476 @param severity The severity is from 1-4. 1 is for information,
477 2, is for warning, 3 for severe and 4 for fatal.
478 @param id The ID of the provider.
479 @param text The message. If not NULL, is the message text to be logged.
480 @param string The message. If not NULL, is the message text to be logged.
481 string will be ignored when text is not NULL.
482 @param rc Output: Service return status
|
483 konrad.r 1.20 */
484 inline static CMPIStatus CMLogMessage
485 (const CMPIBroker *b, int severity, const char *id,
486 const char *text, const CMPIString *string)
487 { return ((b)->eft->logMessage((b),(severity),(id), (text), (string))); }
488 #else
489 #define CMLogMessage(b,severity,id, text, string) ((b)->eft->logMessage((b),(severity),(id),(text),(string)))
490 #endif
491 #endif
492
493 #ifdef CMPI_VER_100
494 #ifdef CMPI_INLINE
|
495 konrad.r 1.25 /** Logs the message to the trace facility.
496 @example CMLogMessage(_broker, 1, "TestProvider","Entering EnumerateInstance", NULL);
497 @param mb Broker this pointer
498 @param level The severity is from 1-4.
499 @param component The component name to use for logging. The available
500 facilities are defined in TraceComponents.h file.
501 @param text The message. If not NULL, is the message text to be logged.
502 @param string The message. If not NULL, is the message text to be logged.
503 string will be ignored when text is not NULL.
504 @param rc Output: Service return status
|
505 konrad.r 1.20 */
506 inline static CMPIStatus CMTraceMessage
507 (const CMPIBroker *b, int level, const char *component,
508 const char *text, const CMPIString *string)
509 { return ((b)->eft->logMessage((b),(level),(component), (text), (string))); }
510 #else
511 #define CMTraceMessage(b,level,component, text, string) ((b)->eft->trace((b),(level),(component),(text),(string)))
512 #endif
513 #endif
514
|
515 konrad.r 1.2 // CMPIInstance macros
516
517
518 #ifdef CMPI_INLINE
519 /** Gets a named property value.
520 @param inst Instance this pointer.
521 @param name Property name.
522 @param rc Output: Service return status (suppressed when NULL).
523 @return Property value.
524 */
525 inline static CMPIData CMGetProperty
|
526 konrad.r 1.20 (const CMPIInstance* inst, const char* name, CMPIStatus* rc)
|
527 konrad.r 1.2 { return ((inst)->ft->getProperty((inst),(name),(rc))); }
528 #else
529 #define CMGetProperty(i,n,rc) ((i)->ft->getProperty((i),(n),(rc)))
|
530 kumpf 1.6 #endif
|
531 konrad.r 1.2
532 #ifdef CMPI_INLINE
533 /** Gets a Property value defined by its index.
534 @param inst Instance this pointer.
535 @param index Position in the internal Data array.
536 @param name Output: Returned property name (suppressed when NULL).
537 @param rc Output: Service return status (suppressed when NULL).
538 @return Property value.
539 */
540 inline static CMPIData CMGetPropertyAt
|
541 konrad.r 1.20 (const CMPIInstance* inst, unsigned int index, CMPIString** name,
|
542 konrad.r 1.2 CMPIStatus* rc)
543 { return ((inst)->ft->getPropertyAt((inst),(index),(name),(rc))); }
544 #else
545 #define CMGetPropertyAt(i,num,s,rc) \
546 ((i)->ft->getPropertyAt((i),(num),(s),(rc)))
547 #endif
548
549 #ifdef CMPI_INLINE
550 /** Adds/replaces a named Property.
551 @param inst Instance this pointer.
552 @param name Entry name.
553 @param value Address of value structure.
554 @param type Value type.
555 @return Service return status.
556 */
557 inline static CMPIStatus CMSetProperty
|
558 konrad.r 1.20 (const CMPIInstance* inst,const char* name,
559 const CMPIValue* value, CMPIType type)
560 { return ((inst)->ft->setProperty((inst),(name),(value),(type))); }
|
561 konrad.r 1.2 #else
562 #define CMSetProperty(i,n,v,t) \
563 ((i)->ft->setProperty((i),(n),(CMPIValue*)(v),(t)))
564 #endif
565
566 #ifdef CMPI_INLINE
567 /** Gets the number of properties contained in this Instance.
568 @param inst Instance this pointer.
569 @param rc Output: Service return status (suppressed when NULL).
570 @return Number of properties.
571 */
572 inline static unsigned int CMGetPropertyCount
|
573 konrad.r 1.20 (const CMPIInstance* inst, CMPIStatus* rc)
|
574 konrad.r 1.2 { return ((inst)->ft->getPropertyCount((inst),(rc))); }
575 #else
576 #define CMGetPropertyCount(i,rc) ((i)->ft->getPropertyCount((i),(rc)))
577 #endif
578
579 #ifdef CMPI_INLINE
580 /** Generates an ObjectPath out of the namespace, classname and
581 key propeties of this Instance.
582 @param inst Instance this pointer.
583 @param rc Output: Service return status (suppressed when NULL).
584 @return the generated ObjectPath.
585 */
586 inline static CMPIObjectPath* CMGetObjectPath
|
587 konrad.r 1.20 (const CMPIInstance* inst, CMPIStatus* rc)
|
588 konrad.r 1.2 { return ((inst)->ft->getObjectPath((inst),(rc))); }
589 #else
590 #define CMGetObjectPath(i,rc) ((i)->ft->getObjectPath((i),(rc)))
591 #endif
592
|
593 konrad.r 1.20 #ifdef CMPI_VER_100
594 #ifdef CMPI_INLINE
|
595 konrad.r 1.25 /** Replaces the ObjectPath of the instance.
596 @param inst Instance this pointer.
597 @param obj Pointer to the new object path.
598 @param rc Output: Service return status (suppressed when NULL).
599 @return the generated ObjectPath.
|
600 konrad.r 1.20 */
601 inline static CMPIStatus CMSetObjectPath
602 ( CMPIInstance* inst, const CMPIObjectPath *obj)
603 { return ((inst)->ft->setObjectPath((inst),(obj))); }
604 #else
|
605 konrad.r 1.27 #define CMSetObjectPath(i,obj) ((i)->ft->setObjectPath((i),(obj)))
|
606 konrad.r 1.20 #endif
607 #endif
608
|
609 konrad.r 1.2 #ifdef CMPI_INLINE
610 /** Directs CMPI to ignore any setProperty operations for this
611 instance for any properties not in this list.
612 @param inst Instance this pointer.
613 @param propertyList If not NULL, the members of the array define one
614 or more Property names to be accepted by setProperty operations.
615 @param keys array of key properties. This array must be specified.
616 @return Service return status.
617 */
618 inline static CMPIStatus CMSetPropertyFilter
|
619 konrad.r 1.20 (CMPIInstance* inst, const char** propertyList, char **keys)
|
620 konrad.r 1.2 { return ((inst)->ft->setPropertyFilter((inst),(propertyList),(keys))); }
621 #else
622 #define CMSetPropertyFilter(i,pl,k) ((i)->ft->setPropertyFilter((i),(pl),(k)))
623 #endif
624
625
626
627 // CMPIObjectPath macros
628
629
630 #ifdef CMPI_INLINE
631 /** Set/replace the hostname component.
632 @param op ObjectPath this pointer.
633 @param hn The hostname string
634 @return Service return status.
635 */
636 inline static CMPIStatus CMSetHostname
|
637 konrad.r 1.20 (CMPIObjectPath* op, const char* hn)
|
638 konrad.r 1.2 { return ((op)->ft->setHostname((op),(hn))); }
639 #else
640 #define CMSetHostname(p,n) ((p)->ft->setHostname((p),(n)))
641 #endif
642
643 #ifdef CMPI_INLINE
644 /** Get the hostname component.
645 @param op ObjectPath this pointer.
646 @param rc Output: Service return status (suppressed when NULL).
647 @return The hostname component.
648 */
649 inline static CMPIString* CMGetHostname
|
650 konrad.r 1.20 (const CMPIObjectPath* op,CMPIStatus* rc)
|
651 konrad.r 1.2 { return ((op)->ft->getHostname((op),(rc))); }
652 #else
653 #define CMGetHostname(p,rc) ((p)->ft->getHostname((p),(rc)))
654 #endif
655
656 #ifdef CMPI_INLINE
657 /** Set/replace the namespace component.
658 @param op ObjectPath this pointer.
659 @param ns The namespace string
660 @return Service return status.
661 */
662 inline static CMPIStatus CMSetNameSpace
|
663 konrad.r 1.20 (CMPIObjectPath* op,const char* ns)
|
664 konrad.r 1.2 { return ((op)->ft->setNameSpace((op),(ns))); }
665 #else
666 #define CMSetNameSpace(p,n) ((p)->ft->setNameSpace((p),(n)))
667 #endif
668
669 #ifdef CMPI_INLINE
670 /** Get the namespace component.
671 @param op ObjectPath this pointer.
672 @param rc Output: Service return status (suppressed when NULL).
673 @return The namespace component.
674 */
675 inline static CMPIString* CMGetNameSpace
|
676 konrad.r 1.20 (const CMPIObjectPath* op, CMPIStatus* rc)
|
677 konrad.r 1.2 { return ((op)->ft->getNameSpace((op),(rc))); }
678 #else
679 #define CMGetNameSpace(p,rc) ((p)->ft->getNameSpace((p),(rc)))
680 #endif
681
682 #ifdef CMPI_INLINE
683 /** Set/replace the classname component.
684 @param op ObjectPath this pointer.
685 @param cn The hostname string
686 @return Service return status.
687 */
688 inline static CMPIStatus CMSetClassName
|
689 konrad.r 1.20 (CMPIObjectPath* op, const char* cn)
|
690 konrad.r 1.2 { return ((op)->ft->setClassName((op),(cn))); }
691 #else
692 #define CMSetClassName(p,n) ((p)->ft->setClassName((p),(n)))
693 #endif
694
695 #ifdef CMPI_INLINE
696 /** Get the classname component.
697 @param op ObjectPath this pointer.
698 @param rc Output: Service return status (suppressed when NULL).
699 @return The classname component.
700 */
701 inline static CMPIString* CMGetClassName
|
702 konrad.r 1.20 (const CMPIObjectPath* op,CMPIStatus* rc)
|
703 konrad.r 1.2 { return ((op)->ft->getClassName((op),(rc))); }
704 #else
705 #define CMGetClassName(p,rc) ((p)->ft->getClassName((p),(rc)))
706 #endif
707
708 #ifdef CMPI_INLINE
709 /** Adds/replaces a named key property.
710 @param op ObjectPath this pointer.
711 @param name Key property name.
712 @param value Address of value structure.
713 @param type Value type.
714 @return Service return status.
715 */
716 inline static CMPIStatus CMAddKey
|
717 konrad.r 1.20 (CMPIObjectPath* op, const char* name,
718 const CMPIValue * value, const CMPIType type)
719 { return ((op)->ft->addKey((op),(name),(value),(type))); }
|
720 konrad.r 1.2 #else
721 #define CMAddKey(p,n,v,t) \
722 ((p)->ft->addKey((p),(n),(CMPIValue*)(v),(t)))
723 #endif
724
725 #ifdef CMPI_INLINE
726 /** Gets a named key property value.
727 @param op ObjectPath this pointer.
728 @param name Key property name.
729 @param rc Output: Service return status (suppressed when NULL).
730 @return Entry value.
731 */
732 inline static CMPIData CMGetKey
|
733 konrad.r 1.20 (const CMPIObjectPath* op, const char* name, CMPIStatus* rc)
|
734 konrad.r 1.2 { return ((op)->ft->getKey((op),(name),(rc))); }
735 #else
736 #define CMGetKey(p,n,rc) ((p)->ft->getKey((p),(n),(rc)))
737 #endif
738
739 #ifdef CMPI_INLINE
740 /** Gets a key property value defined by its index.
741 @param op ObjectPath this pointer.
742 @param index Position in the internal Data array.
743 @param name Output: Returned property name (suppressed when NULL).
744 @param rc Output: Service return status (suppressed when NULL).
745 @return Data value.
746 */
747 inline static CMPIData CMGetKeyAt
|
748 konrad.r 1.20 (const CMPIObjectPath* op,unsigned int index, CMPIString** name,
|
749 konrad.r 1.2 CMPIStatus* rc)
750 { return ((op)->ft->getKeyAt((op),(index),(name),(rc))); }
751 #else
752 #define CMGetKeyAt(p,i,n,rc) ((p)->ft->getKeyAt((p),(i),(n),(rc)))
753 #endif
754
755
756 #ifdef CMPI_INLINE
757 /** Gets the number of key properties contained in this ObjectPath.
758 @param op ObjectPath this pointer.
759 @param rc Output: Service return status (suppressed when NULL).
760 @return Number of properties.
761 */
762 inline static unsigned int CMGetKeyCount
|
763 konrad.r 1.20 (const CMPIObjectPath* op, CMPIStatus* rc)
|
764 konrad.r 1.2 { return ((op)->ft->getKeyCount((op),(rc))); }
765 #else
766 #define CMGetKeyCount(p,rc) ((p)->ft->getKeyCount((p),(rc)))
767 #endif
768
769 #ifdef CMPI_INLINE
|
770 konrad.r 1.11 /** Set/replace namespace and classname components from <src>.
|
771 konrad.r 1.2 @param op ObjectPath this pointer.
772 @param src Source input.
773 @return Service return status.
774 */
775 inline static CMPIStatus CMSetNameSpaceFromObjectPath
|
776 konrad.r 1.20 (CMPIObjectPath* op, const CMPIObjectPath* src)
|
777 konrad.r 1.2 { return ((op)->ft->setNameSpaceFromObjectPath((op),(src))); }
778 #else
779 #define CMSetNameSpaceFromObjectPath(p,s) \
780 ((p)->ft->setNameSpaceFromObjectPath((p),(s)))
781 #endif
782
783 #ifdef CMPI_INLINE
|
784 konrad.r 1.11 /** Set/replace hostname, namespace and classname components from <src>.
|
785 konrad.r 1.2 @param op ObjectPath this pointer.
786 @param src Source input.
787 @return Service return status.
788 */
789 inline static CMPIStatus CMSetHostAndNameSpaceFromObjectPath
790 (CMPIObjectPath* op,
|
791 konrad.r 1.20 const CMPIObjectPath* src)
|
792 konrad.r 1.2 { return ((op)->ft->setHostAndNameSpaceFromObjectPath((op),(src))); }
793 #else
794 #define CMSetHostAndNameSpaceFromObjectPath(p,s) \
795 ((p)->ft->setHostAndNameSpaceFromObjectPath((p),(s)))
796 #endif
797
798 #if defined(CMPI_VER_86)
799 #ifdef CMPI_INLINE
|
800 konrad.r 1.11 /** Set/replace hostname, namespace and classname components from <src>.
|
801 konrad.r 1.2 @param op ObjectPath this pointer.
802 @param src Source input.
803 @return Service return status.
804 */
805 inline static CMPIString* CMObjectPathToString
|
806 konrad.r 1.20 (const CMPIObjectPath* op, CMPIStatus* rc)
807 { return ((op)->ft->toString((op),(rc))); }
|
808 konrad.r 1.2 #else
809 #define CMObjectPathToString(p,rc) \
810 ((p)->ft->toString((p),(rc)))
811 #endif
812 #endif
813
814 // CMPIArray macros
815
816
817 #ifdef CMPI_INLINE
818 /** Gets the number of elements contained in this Array.
819 @param ar Array this pointer.
820 @param rc Output: Service return status (suppressed when NULL).
821 @return Number of elements.
822 */
823 inline static CMPICount CMGetArrayCount
|
824 konrad.r 1.20 (const CMPIArray* ar, CMPIStatus* rc)
|
825 konrad.r 1.2 { return ((ar)->ft->getSize((ar),(rc))); }
826 #else
827 #define CMGetArrayCount(a,rc) ((a)->ft->getSize((a),(rc)))
828 #endif
829
830 #ifdef CMPI_INLINE
831 /** Gets the element type.
832 @param ar Array this pointer.
833 @param rc Output: Service return status (suppressed when NULL).
834 @return Number of elements.
835 */
836 inline static CMPIType CMGetArrayType
|
837 konrad.r 1.20 (const CMPIArray* ar, CMPIStatus* rc)
|
838 konrad.r 1.2 { return ((ar)->ft->getSimpleType((ar),(rc))); }
839 #else
840 #define CMGetArrayType(a,rc) ((a)->ft->getSimpleType((a),(rc)))
841 #endif
842
843 #ifdef CMPI_INLINE
844 /** Gets an element value defined by its index.
845 @param ar Array this pointer.
846 @param index Position in the internal Data array.
847 @param rc Output: Service return status (suppressed when NULL).
848 @return Element value.
849 */
850 inline static CMPIData CMGetArrayElementAt
|
851 konrad.r 1.20 (const CMPIArray* ar, CMPICount index, CMPIStatus* rc)
|
852 konrad.r 1.2 { return ((ar)->ft->getElementAt((ar),(index),(rc))); }
853 #else
854 #define CMGetArrayElementAt(a,n,rc) \
855 ((a)->ft->getElementAt((a),(n),(rc)))
856 #endif
857
858 #ifdef CMPI_INLINE
859 /** Sets an element value defined by its index.
860 @param ar Array this pointer.
861 @param index Position in the internal Data array.
862 @param value Address of value structure.
863 @param type Value type.
864 @return Service return status.
865 */
866 inline static CMPIStatus CMSetArrayElementAt
|
867 konrad.r 1.20 (CMPIArray* ar, CMPICount index, const CMPIValue* value, CMPIType type)
|
868 konrad.r 1.2 { return ((ar)->ft->setElementAt((ar),(index),(value),(type))); }
869 #else
870 #define CMSetArrayElementAt(a,n,v,t) \
871 ((a)->ft->setElementAt((a),(n),(CMPIValue*)(v),(t)))
872 #endif
873
874
875
|
876 konrad.r 1.20 // CMPIArgs macros
|
877 konrad.r 1.2
878
879 #ifdef CMPI_INLINE
880 /** Adds/replaces a named argument.
881 @param as Args this pointer.
882 @param name Argument name.
883 @param value Address of value structure.
884 @param type Value type.
885 @return Service return status.
886 */
887 inline static CMPIStatus CMAddArg
888 (CMPIArgs* as, char* name ,void* value,
889 CMPIType type)
890 { return ((as)->ft->addArg((as),(name),(CMPIValue*)(value),(type))); }
891 #else
892 #define CMAddArg(a,n,v,t) \
893 ((a)->ft->addArg((a),(n),(CMPIValue*)(v),(t)))
894 #endif
895
896 #ifdef CMPI_INLINE
897 /** Gets a named argument value.
898 konrad.r 1.2 @param as Args this pointer.
899 @param name Argument name.
900 @param rc Output: Service return status (suppressed when NULL).
901 @return Argument value.
902 */
903 inline static CMPIData CMGetArg
|
904 konrad.r 1.20 (const CMPIArgs* as, const char* name, CMPIStatus* rc)
|
905 konrad.r 1.2 { return ((as)->ft->getArg((as),(name),(rc))); }
906 #else
907 #define CMGetArg(a,n,rc) ((a)->ft->getArg((a),(n),(rc)))
908 #endif
909
910 #ifdef CMPI_INLINE
911 /** Gets a Argument value defined by its index.
912 @param as Args this pointer.
913 @param index Position in the internal Data array.
914 @param name Output: Returned argument name (suppressed when NULL).
915 @param rc Output: Service return status (suppressed when NULL).
916 @return Argument value.
917 */
918 inline static CMPIData CMGetArgAt
|
919 konrad.r 1.20 (const CMPIArgs* as, unsigned int index, CMPIString** name,
|
920 konrad.r 1.2 CMPIStatus* rc)
921 { return ((as)->ft->getArgAt((as),(index),(name),(rc))); }
922 #else
923 #define CMGetArgAt(a,p,n,rc) ((a)->ft->getArgAt((a),(p),(n),(rc)))
924 #endif
925
926 #ifdef CMPI_INLINE
927 /** Gets the number of arguments contained in this Args.
928 @param as Args this pointer.
929 @param rc Output: Service return status (suppressed when NULL).
930 @return Number of properties.
931 */
932 inline static unsigned int CMGetArgCount
|
933 konrad.r 1.20 (const CMPIArgs* as, CMPIStatus* rc)
|
934 konrad.r 1.2 { return ((as)->ft->getArgCount((as),(rc))); }
935 #else
936 #define CMGetArgCount(a,rc) ((a)->ft->getArgCount((a),(rc)))
937 #endif
938
939
940
941 // CMPIString Macros
942
943
944 #ifdef CMPI_INLINE
945 /** Get a pointer to a C char* representation of this String.
946 @param st String this pointer.
947 @param rc Output: Service return status (suppressed when NULL).
948 @return Pointer to char* representation.
949 */
950 inline static char* CMGetCharsPtr
|
951 konrad.r 1.20 (const CMPIString* st, CMPIStatus* rc)
|
952 konrad.r 1.2 { return ((st)->ft->getCharPtr((st),(rc))); }
953 #else
954 #define CMGetCharsPtr(st,rc) ((st)->ft->getCharPtr((st),(rc)))
955 #endif
956
957
958
959 // CMPIDateTime macros
960
961
962 #ifdef CMPI_INLINE
963 /** Get DateTime setting in UTC string format.
964 @param dt DateTime this pointer.
965 @param rc Output: Service return status (suppressed when NULL).
966 @return DateTime as UTC string.
967 */
968 inline static CMPIString* CMGetStringFormat
|
969 konrad.r 1.20 (const CMPIDateTime* dt, CMPIStatus* rc)
|
970 konrad.r 1.2 { return ((dt)->ft->getStringFormat((dt),(rc))); }
971 #else
972 #define CMGetStringFormat(d,rc) ((d)->ft->getStringFormat((d),(rc)))
973 #endif
974
975 #ifdef CMPI_INLINE
976 /** Get DateTime setting in binary format (in microsecods
977 starting since 00:00:00 GMT, Jan 1,1970).
978 @param dt DateTime this pointer.
979 @param rc Output: Service return status (suppressed when NULL).
980 @return DateTime in binary.
981 */
982 inline static CMPIUint64 CMGetBinaryFormat
|
983 konrad.r 1.20 (const CMPIDateTime* dt, CMPIStatus* rc)
|
984 konrad.r 1.2 { return ((dt)->ft->getBinaryFormat((dt),(rc))); }
985 #else
986 #define CMGetBinaryFormat(d,rc) ((d)->ft->getBinaryFormat((d),(rc)))
987 #endif
988
989 #ifdef CMPI_INLINE
990 /** Tests whether DateTime is an interval value.
991 @param dt DateTime this pointer.
992 @param rc Output: Service return status (suppressed when NULL).
993 @return True if interval value.
994 */
995 inline static CMPIBoolean CMIsInterval
|
996 konrad.r 1.20 (const CMPIDateTime* dt, CMPIStatus* rc)
|
997 konrad.r 1.2 { return ((dt)->ft->isInterval((dt),(rc))); }
998 #else
999 #define CMIsInterval(d,rc) ((d)->ft->isInterval((d),(rc)))
1000 #endif
1001
1002
1003 // CMPIEnumeration Macros
1004
1005
1006 #ifdef CMPI_INLINE
1007 /** Get the next element of this Enumeration.
1008 @param en Enumeration this pointer.
1009 @param rc Output: Service return status (suppressed when NULL).
1010 @return Element value.
1011 */
1012 inline static CMPIData CMGetNext
|
1013 konrad.r 1.20 (const CMPIEnumeration* en, CMPIStatus* rc)
|
1014 konrad.r 1.2 { return ((en)->ft->getNext((en),(rc))); }
1015 #else
1016 #define CMGetNext(n,rc) ((n)->ft->getNext((n),(rc)))
1017 #endif
1018
1019 #ifdef CMPI_INLINE
1020 /** Test for any elements left in this Enumeration.
1021 @param en Enumeration this pointer.
1022 @param rc Output: Service return status (suppressed when NULL).
1023 @return True or false.
1024 */
1025 inline static CMPIBoolean CMHasNext
|
1026 konrad.r 1.20 (const CMPIEnumeration* en, CMPIStatus* rc)
|
1027 konrad.r 1.2 { return ((en)->ft->hasNext((en),(rc))); }
1028 #else
1029 #define CMHasNext(n,rc) ((n)->ft->hasNext((n),(rc)))
1030 #endif
1031
1032 #ifdef CMPI_INLINE
1033 /** Convert this Enumeration into an Array.
1034 @param en Enumeration this pointer.
1035 @param rc Output: Service return status (suppressed when NULL).
1036 @return The Array.
1037 */
1038 inline static CMPIArray* CMToArray
|
1039 konrad.r 1.20 (const CMPIEnumeration* en, CMPIStatus* rc)
|
1040 konrad.r 1.2 { return ((en)->ft->toArray((en),(rc))); }
1041 #else
1042 #define CMToArray(n,rc) ((n)->ft->toArray((n),(rc)))
1043 #endif
1044
1045
1046 // CMPIResult Macros
1047
1048
1049 #ifdef CMPI_INLINE
1050 /** Return a value/type pair.
1051 @param rslt Result this pointer.
1052 @param value Address of a Value object.
1053 @param type Type of the Value object.
1054 @return Service return status.
1055 */
1056 inline static CMPIStatus CMReturnData
|
1057 konrad.r 1.20 (const CMPIResult* rslt, const CMPIValue* value, const CMPIType type)
1058 { return ((rslt)->ft->returnData((rslt),(value),(type))); }
|
1059 konrad.r 1.2 #else
1060 #define CMReturnData(r,v,t) \
1061 ((r)->ft->returnData((r),(CMPIValue*)(v),(t)))
1062 #endif
1063
1064 #ifdef CMPI_INLINE
1065 /** Return a Instance object.
1066 @param rslt Result this pointer.
1067 @param inst Instance to be returned.
1068 @return Service return status.
1069 */
1070 inline static CMPIStatus CMReturnInstance
|
1071 konrad.r 1.20 (const CMPIResult* rslt,const CMPIInstance* inst)
|
1072 konrad.r 1.2 { return ((rslt)->ft->returnInstance((rslt),(inst))); }
1073 #else
1074 #define CMReturnInstance(r,i) ((r)->ft->returnInstance((r),(i)))
1075 #endif
1076
1077 #ifdef CMPI_INLINE
1078 /** Return a ObjectPath object..
1079 @param rslt Result this pointer.
1080 @param ref ObjectPath to be returned.
1081 @return Service return status.
1082 */
1083 inline static CMPIStatus CMReturnObjectPath
|
1084 konrad.r 1.20 (const CMPIResult* rslt, const CMPIObjectPath* ref)
|
1085 konrad.r 1.2 { return ((rslt)->ft->returnObjectPath((rslt),(ref))); }
1086 #else
1087 #define CMReturnObjectPath(r,o) ((r)->ft->returnObjectPath((r),(o)))
1088 #endif
1089
1090 #ifdef CMPI_INLINE
1091 /** Indicates no further data to be returned.
1092 @param rslt Result this pointer.
1093 @return Service return status.
1094 */
1095 inline static CMPIStatus CMReturnDone
|
1096 konrad.r 1.20 (const CMPIResult* rslt)
|
1097 konrad.r 1.2 { return ((rslt)->ft->returnDone((rslt))); }
1098 #else
1099 #define CMReturnDone(r) ((r)->ft->returnDone((r)))
1100 #endif
1101
1102
1103
1104 // CMPIContext Macros
1105
1106
1107 #ifdef CMPI_INLINE
1108 /** Gets a named Context entry value.
1109 @param ctx Context this pointer.
1110 @param name Context entry name.
1111 @param rc Output: Service return status (suppressed when NULL).
1112 @return Entry value.
1113 */
1114 inline static CMPIData CMGetContextEntry
|
1115 konrad.r 1.20 (const CMPIContext* ctx, const char* name, CMPIStatus* rc)
|
1116 konrad.r 1.2 { return ((ctx)->ft->getEntry((ctx),(name),(rc))); }
1117 #else
1118 #define CMGetContextEntry(c,n,rc) \
1119 ((c)->ft->getEntry((c),(n),(rc)))
1120 #endif
1121
1122 #ifdef CMPI_INLINE
1123 /** Gets a Context entry value defined by its index.
1124 @param ctx Context this pointer.
1125 @param index Position in the internal Data array.
1126 @param name Output: Returned Context entry name (suppressed when NULL).
1127 @param rc Output: Service return status (suppressed when NULL).
1128 @return Entry value.
1129 */
1130 inline static CMPIData CMGetContextEntryAt
|
1131 konrad.r 1.20 (const CMPIContext* ctx, unsigned int index, CMPIString** name,
|
1132 konrad.r 1.2 CMPIStatus* rc)
1133 { return ((ctx)->ft->getEntryAt((ctx),(index),(name),(rc))); }
1134 #else
1135 #define CMGetContextEntryAt(c,p,n,rc) \
1136 ((c)->ft->getEntryAt((c),(p),(n),(rc)))
1137 #endif
1138
1139 #ifdef CMPI_INLINE
1140 /** Gets the number of entries contained in this Context.
1141 @param ctx Context this pointer.
1142 @param rc Output: Service return status (suppressed when NULL).
1143 @return Number of entries.
1144 */
1145 inline static unsigned int CMGetContextEntryCount
|
1146 konrad.r 1.20 (const CMPIContext* ctx, CMPIStatus* rc)
|
1147 konrad.r 1.2 { return ((ctx)->ft->getEntryCount((ctx),(rc))); }
1148 #else
1149 #define CMGetContextEntryCount(c,rc) \
1150 ((c)->ft->getEntryCount((c),(rc)))
1151 #endif
1152
1153 #ifdef CMPI_INLINE
1154 /** adds/replaces a named Context entry
1155 @param ctx Context this pointer.
1156 @param name Entry name.
1157 @param value Address of value structure.
1158 @param type Value type.
1159 @return Service return status.
1160 */
1161 inline static CMPIStatus CMAddContextEntry
|
1162 konrad.r 1.20 (const CMPIContext* ctx, const char* name, const CMPIValue* value, const CMPIType type)
1163 { return ((ctx)->ft->addEntry((ctx),(name),(value),(type))); }
|
1164 konrad.r 1.2 #else
1165 #define CMAddContextEntry(c,n,v,t) \
1166 ((c)->ft->addEntry((c),(n),(CMPIValue*)(v),(t)))
1167 #endif
1168
1169
1170
1171 // CMPISelectExp macros
1172
1173
1174
1175 #ifdef CMPI_INLINE
1176 /** Return the select expression in string format.
1177 @param se SelectExp this pointer.
1178 @param rc Output: Service return status (suppressed when NULL).
1179 @return The select expression.
1180 */
1181 inline static CMPIString* CMGetSelExpString
|
1182 konrad.r 1.20 (const CMPISelectExp* se, CMPIStatus* rc)
|
1183 konrad.r 1.2 { return ((se)->ft->getString((se),(rc))); }
1184 #else
1185 #define CMGetSelExpString(s,rc) ((s)->ft->getString((s),(rc)))
1186 #endif
1187
1188 #ifdef CMPI_INLINE
1189 /** Evaluate the instance using this select expression.
1190 @param se SelectExp this pointer.
1191 @param inst Instance to be evaluated.
1192 @param rc Output: Service return status (suppressed when NULL).
1193 @return True or false incicator.
1194 */
1195 inline static CMPIBoolean CMEvaluateSelExp
|
1196 konrad.r 1.20 (const CMPISelectExp* se, const CMPIInstance* inst, CMPIStatus* rc)
|
1197 konrad.r 1.2 { return ((se)->ft->evaluate((se),(inst),(rc))); }
1198 #else
1199 #define CMEvaluateSelExp(s,i,r) ((s)->ft->evaluate((s),(i),(r)))
1200 #endif
1201
1202 #if defined(CMPI_VER_87)
1203 #ifdef CMPI_INLINE
1204 /** Evaluate this select expression by using a data value accessor routine. .
1205 @param se SelectExp this pointer.
1206 @param accessor Data accessor routine to be used.
1207 @param parm Data accessor parameter.
1208 @param rc Output: Service return status (suppressed when NULL).
1209 @return True or false incicator.
1210 */
1211 inline static CMPIBoolean CMEvaluateSelExpUsingAccessor
|
1212 konrad.r 1.20 (const CMPISelectExp* se, CMPIAccessor* accessor, void *parm, CMPIStatus* rc)
1213 { return ((se)->ft->evaluateUsingAccessor((se),(accessor),(parm),(rc))); }
|
1214 konrad.r 1.2 #else
1215 #define CMEvaluateSelExpUsingAccessor(s,i,p,r) \
1216 ((s)->ft->evaluateUsingAccessor((s),(i),(p),(r)))
1217 #endif
1218 #endif
1219
1220 #ifdef CMPI_INLINE
1221 /** Return the select expression as disjunction of conjunctions.
1222 @param se SelectExp this pointer.
1223 @param rc Output: Service return status (suppressed when NULL).
1224 @return The disjunction.
1225 */
1226 inline static CMPISelectCond* CMGetDoc
|
1227 konrad.r 1.20 (const CMPISelectExp* se, CMPIStatus* rc)
|
1228 konrad.r 1.2 { return ((se)->ft->getDOC((se),(rc))); }
1229 #else
1230 #define CMGetDoc(s,rc) ((s)->ft->getDOC((s),(rc)))
1231 #endif
1232
1233 #ifdef CMPI_INLINE
1234 /** Return the select expression as conjunction of disjunctions.
1235 @param se SelectExp this pointer.
1236 @param rc Output: Service return status (suppressed when NULL).
1237 @return The conjunction.
1238 */
1239 inline static CMPISelectCond* CMGetCod
|
1240 konrad.r 1.20 (const CMPISelectExp* se, CMPIStatus* rc)
|
1241 konrad.r 1.2 { return ((se)->ft->getCOD((se),(rc))); }
1242 #else
1243 #define CMGetCod(s,rc) ((s)->ft->getCOD((s),(rc)))
1244 #endif
1245
1246
1247
1248 // CMPISelectCond macros
1249
|
1250 r.kieninger 1.9
|
1251 konrad.r 1.2
1252 #ifdef CMPI_INLINE
1253 /** Return the number of sub conditions that are partof this SelectCond.
1254 Optionally, the SelectCond type (COD or DOC) will be returned.
1255 @param sc SelectCond this pointer.
1256 @param type Output: SelectCond type (suppressed when NULL).
1257 @param rc Output: Service return status (suppressed when NULL).
1258 @return Number of SubCond elements.
1259 */
1260 inline static CMPICount CMGetSubCondCountAndType
|
1261 konrad.r 1.20 (const CMPISelectCond* sc, int* type, CMPIStatus* rc)
|
1262 konrad.r 1.2 { return ((sc)->ft->getCountAndType((sc),(type),(rc))); }
1263 #else
1264 #define CMGetSubCondCountAndType(c,t,rc) \
1265 ((c)->ft->getCountAndType((c),(t),(rc)))
1266 #endif
1267
1268 #ifdef CMPI_INLINE
1269 /** Return a SubCond element based on its index.
1270 @param sc SelectCond this pointer.
1271 @param index Position in the internal SubCoind array.
1272 @param rc Output: Service return status (suppressed when NULL).
1273 @return The indexed SubCond element.
1274 */
1275 inline static CMPISubCond* CMGetSubCondAt
|
1276 konrad.r 1.20 (const CMPISelectCond* sc, unsigned int index, CMPIStatus* rc)
|
1277 konrad.r 1.2 { return ((sc)->ft->getSubCondAt((sc),(index),(rc))); }
1278 #else
1279 #define CMGetSubCondAt(c,p,rc) ((c)->ft->getSubCondAt((c),(p),(rc)))
1280 #endif
1281
1282
1283
1284 // CMPISubCond macros
1285
1286
1287
1288 #ifdef CMPI_INLINE
1289 /** Return the number of predicates that are part of sub condition.
1290 @param sc SubCond this pointer.
1291 @param rc Output: Service return status (suppressed when NULL).
1292 @return Number of Predicate elements.
1293 */
1294 inline static CMPICount CMGetPredicateCount
|
1295 konrad.r 1.20 (const CMPISubCond* sc, CMPIStatus* rc)
|
1296 konrad.r 1.2 { return ((sc)->ft->getCount((sc),(rc))); }
1297 #else
1298 #define CMGetPredicateCount(s,rc) ((s)->ft->getCount((s),(rc)))
1299 #endif
1300
1301 #ifdef CMPI_INLINE
1302 /** Return a Predicate element based on its index.
1303 @param sc SubCond this pointer.
1304 @param index Position in the internal Predicate array.
1305 @param rc Output: Service return status (suppressed when NULL).
1306 @return The indexed Predicate element.
1307 */
1308 inline static CMPIPredicate* CMGetPredicateAt
|
1309 konrad.r 1.20 (const CMPISubCond* sc, unsigned int index, CMPIStatus* rc)
|
1310 konrad.r 1.2 { return ((sc)->ft->getPredicateAt((sc),(index),(rc))); }
1311 #else
1312 #define CMGetPredicateAt(s,p,rc) \
1313 ((s)->ft->getPredicateAt((s),(p),(rc)))
1314 #endif
1315
1316 #ifdef CMPI_INLINE
1317 /** Return a named Predicate element.
1318 @param sc SubCond this pointer.
1319 @param name Predicate name (property name).
1320 @param rc Output: Service return status (suppressed when NULL).
1321 @return The named Predicate element.
1322 */
1323 inline static CMPIPredicate* CMGetPredicate
|
1324 konrad.r 1.20 (const CMPISubCond* sc, const char* name, CMPIStatus* rc)
|
1325 konrad.r 1.2 { return ((sc)->ft->getPredicate((sc),(name),(rc))); }
1326 #else
1327 #define CMGetPredicate(s,n,rc) ((s)->ft->getPredicate((s),(n),(rc)))
1328 #endif
1329
1330
1331
1332 // CMPIPredicate macros
1333
1334
1335 #ifdef CMPI_INLINE
1336 /** Get the predicate components.
1337 @param pr Predicate this pointer.
1338 @param type Property type.
1339 @param op Predicate operation.
1340 @param lhs Left hand side of predicate.
1341 @param rhs Right hand side of predicate.
1342 @return Service return status.
1343 */
1344 inline static CMPIStatus CMGetPredicateData
|
1345 konrad.r 1.20 (const CMPIPredicate* pr, CMPIType* type,
|
1346 konrad.r 1.2 CMPIPredOp* op, CMPIString** lhs, CMPIString** rhs)
1347 { return ((pr)->ft->getData((pr),(type),(op),(lhs),(rhs))); }
1348 #else
1349 #define CMGetPredicateData(p,t,o,n,v) \
1350 ((p)->ft->getData((p),(t),(o),(n),(v)))
1351 #endif
1352
|
1353 konrad.r 1.20 #if defined(CMPI_VER_87) && !defined(CMPI_VER_100)
|
1354 konrad.r 1.2 #ifdef CMPI_INLINE
1355 /** Evaluate the predicate using a specific value.
1356 @param pr Predicate this pointer.
1357 @param type Property type.
1358 @param value Address of value structure.
1359 @param type Value type.
1360 @param rc Output: Service return status (suppressed when NULL).
1361 @return Evaluation result.
1362 */
1363 inline static int CMEvaluatePredicate
1364 (CMPIPredicate* pr, void* value,
1365 CMPIType type, CMPIStatus* rc)
1366 { return ((pr)->ft->evaluate((pr),(CMPIValue*)(value),(type),(rc))); }
1367 #else
1368 #define CMEvaluatePredicate(p,v,t,rc) \
1369 ((p)->ft->evaluate((p),(CMPIValue*)(v),(t),(rc)))
1370 #endif
|
1371 konrad.r 1.20 #endif
1372
1373 #if defined(CMPI_VER_100)
1374 #ifdef CMPI_INLINE
|
1375 konrad.r 1.25 /** Evaluate this predicate by using a data value accessor routine. .
|
1376 konrad.r 1.20 @param pr Predicate this pointer.
|
1377 konrad.r 1.25 @param accessor Data accessor routine to be used.
1378 @param parm Data accessor parameter.
|
1379 konrad.r 1.20 @param rc Output: Service return status (suppressed when NULL).
1380 @return Evaluation result.
1381 */
1382 inline static int CMEvaluatePredicateUsingAccessor
1383 (const CMPIPredicate* pr, CMPIAccessor *accessor, void* parm,
1384 CMPIStatus* rc)
1385 { return ((pr)->ft->evaluateUsingAccessor((pr),(accessor), (parm), (rc))); }
1386 #else
1387 #define CMEvaluatePredicateUsingAccessor(p,a,parm,rc) \
1388 ((p)->ft->evaluateUsingAccessor((p),(a),(parm),(rc)))
1389 #endif
1390
1391 #endif // CMPI_VER_100
|
1392 konrad.r 1.2
1393
1394
1395 // CMPIBroker Macros
1396
1397
1398
1399 #ifdef CMPI_INLINE
1400 /** 32 bits describing CMPI features supported by this CIMOM.
1401 See CMPI_MB_Class_x and CMPI_MB_Supports_xxx flags.
1402 */
|
1403 konrad.r 1.20 inline static unsigned long CBGetClassification(const CMPIBroker* mb)
|
1404 konrad.r 1.2 { return ((mb)->bft->brokerClassification); }
1405 #else
1406 #define CBGetClassification(b) ((b)->bft->brokerClassification)
1407 #endif
1408
1409 #ifdef CMPI_INLINE
1410 /** CIMOM version as defined by CIMOM
1411 */
|
1412 konrad.r 1.20 inline static int CBBrokerVersion(const CMPIBroker* mb)
|
1413 konrad.r 1.2 { return ((mb)->bft->brokerVersion); }
1414 #else
1415 #define CBBrokerVersion(b) ((b)->bft->brokerVersion)
1416 #endif
1417
1418 #ifdef CMPI_INLINE
1419 /** CIMOM name
1420 */
|
1421 konrad.r 1.23 inline static const char* CBBrokerName(const CMPIBroker* mb)
|
1422 konrad.r 1.2 { return ((mb)->bft->brokerName); }
1423 #else
1424 #define CBBrokerName(b) ((b)->bft->brokerName)
1425 #endif
1426
1427
1428 #ifdef CMPI_INLINE
1429 /** This function prepares the CMPI run time system to accept
1430 a thread that will be using CMPI services. The returned
1431 CMPIContext object must be used by the subsequent attachThread()
1432 and detachThread() invocations.
1433 @param mb Broker this pointer.
1434 @param ctx Old Context object
1435 @return New Context object to be used by thread to be attached.
1436 */
1437 inline static CMPIContext* CBPrepareAttachThread
|
1438 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx)
|
1439 konrad.r 1.2 { return ((mb)->bft->prepareAttachThread((mb),(ctx))); }
1440 #else
1441 #define CBPrepareAttachThread(b,c) \
1442 ((b)->bft->prepareAttachThread((b),(c)))
1443 #endif
1444
1445 #ifdef CMPI_INLINE
1446 /** This function informs the CMPI run time system that the current
1447 thread with Context will begin using CMPI services.
1448 @param mb Broker this pointer.
1449 @param ctx Context object
1450 @return Service return status.
1451 */
1452 inline static CMPIStatus CBAttachThread
|
1453 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx)
|
1454 konrad.r 1.2 { return ((mb)->bft->attachThread((mb),(ctx))); }
1455 #else
1456 #define CBAttachThread(b,c) ((b)->bft->attachThread((b),(c)))
1457 #endif
1458
1459 #ifdef CMPI_INLINE
1460 /** This function informs the CMPI run time system that the current thread
1461 will not be using CMPI services anymore. The Context object will be
1462 freed during this operation.
1463 @param mb Broker this pointer.
1464 @param ctx Context object
1465 @return Service return status.
1466 */
1467 inline static CMPIStatus CBDetachThread
|
1468 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx)
|
1469 konrad.r 1.2 { return ((mb)->bft->detachThread((mb),(ctx))); }
1470 #else
1471 #define CBDetachThread(b,c) ((b)->bft->detachThread((b),(c)))
1472 #endif
1473
1474
1475
1476 #ifdef CMPI_INLINE
1477 /** This function requests delivery of an Indication. The CIMOM will
1478 locate pertinent subscribers and notify them about the event.
1479 @param mb Broker this pointer.
1480 @param ctx Context object
1481 @param ns Namespace
1482 @param ind Indication Instance
1483 @return Service return status.
1484 */
1485 inline static CMPIStatus CBDeliverIndication
|
1486 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1487 const char* ns, const CMPIInstance* ind)
|
1488 konrad.r 1.2 { return ((mb)->bft->deliverIndication((mb),(ctx),(ns),(ind))); }
1489 #else
1490 #define CBDeliverIndication(b,c,n,i) \
1491 ((b)->bft->deliverIndication((b),(c),(n),(i)))
1492 #endif
1493
1494 #ifdef CMPI_INLINE
|
1495 konrad.r 1.11 /** Enumerate Instance Names of the class (and subclasses) defined by <op>.
|
1496 konrad.r 1.2 @param mb Broker this pointer.
1497 @param ctx Context object
1498 @param op ObjectPath containing namespace and classname components.
1499 @param rc Output: Service return status (suppressed when NULL).
1500 @return Enumeration of ObjectPathes.
1501 */
1502 inline static CMPIEnumeration* CBEnumInstanceNames
|
1503 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1504 const CMPIObjectPath* op, CMPIStatus* rc)
|
1505 konrad.r 1.2 { return ((mb)->bft->enumInstanceNames((mb),(ctx),(op),(rc))); }
1506 #else
1507 #define CBEnumInstanceNames(b,c,p,rc) \
1508 ((b)->bft->enumInstanceNames((b),(c),(p),(rc)))
1509 #endif
1510
1511 #ifdef CMPI_INLINE
|
1512 konrad.r 1.11 /** Enumerate Instances of the class (and subclasses) defined by <op>.
|
1513 konrad.r 1.2 Instance structure and inheritance scope can be controled using the
|
1514 konrad.r 1.11 CMPIInvocationFlags entry in <ctx>.
|
1515 konrad.r 1.2 @param mb Broker this pointer.
1516 @param ctx Context object
1517 @param op ObjectPath containing namespace and classname components.
1518 @param properties If not NULL, the members of the array define one or more Property
1519 names. Each returned Object MUST NOT include elements for any Properties
1520 missing from this list
1521 @param rc Output: Service return status (suppressed when NULL).
1522 @return Enumeration of Instances.
1523 */
1524 inline static CMPIEnumeration* CBEnumInstances
|
1525 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1526 const CMPIObjectPath* op, const char** properties, CMPIStatus* rc)
|
1527 konrad.r 1.2 { return ((mb)->bft->enumInstances((mb),(ctx),(op),(properties),(rc))); }
1528 #else
1529 #define CBEnumInstances(b,c,p,pr,rc) \
1530 ((b)->bft->enumInstances((b),(c),(p),(pr),(rc)))
1531 #endif
1532
1533 #ifdef CMPI_INLINE
|
1534 konrad.r 1.11 /** Get Instance using <op> as reference. Instance structure can be
1535 controled using the CMPIInvocationFlags entry in <ctx>.
|
1536 konrad.r 1.2 @param mb Broker this pointer.
1537 @param ctx Context object
1538 @param op ObjectPath containing namespace, classname and key components.
1539 @param properties If not NULL, the members of the array define one or more Property
1540 names. Each returned Object MUST NOT include elements for any Properties
1541 missing from this list
1542 @param rc Output: Service return status (suppressed when NULL).
1543 @return The Instance.
1544 */
1545 inline static CMPIInstance* CBGetInstance
|
1546 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1547 const CMPIObjectPath* op, const char** properties, CMPIStatus* rc)
|
1548 konrad.r 1.2 { return ((mb)->bft->getInstance((mb),(ctx),(op),(properties),(rc))); }
1549 #else
1550 #define CBGetInstance(b,c,p,pr,rc) \
1551 ((b)->bft->getInstance((b),(c),(p),(pr),(rc)))
1552 #endif
1553
1554 #ifdef CMPI_INLINE
|
1555 konrad.r 1.11 /** Create Instance from <inst> using <op> as reference.
|
1556 konrad.r 1.2 @param mb Broker this pointer.
1557 @param ctx Context object
1558 @param op ObjectPath containing namespace, classname and key components.
1559 @param inst Complete instance.
1560 @param rc Output: Service return status (suppressed when NULL).
1561 @return The assigned instance reference.
1562 */
1563 inline static CMPIObjectPath* CBCreateInstance
|
1564 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1565 const CMPIObjectPath* op, const CMPIInstance* inst, CMPIStatus* rc)
|
1566 konrad.r 1.2 { return ((mb)->bft->createInstance((mb),(ctx),(op),(inst),(rc))); }
1567 #else
1568 #define CBCreateInstance(b,c,p,i,rc) \
1569 ((b)->bft->createInstance((b),(c),(p),(i),(rc)))
1570 #endif
1571
|
1572 konrad.r 1.20 #if defined(CMPI_VER_90)
1573
|
1574 schuur 1.5 #ifdef CMPI_INLINE
|
1575 konrad.r 1.11 /** Replace an existing Instance from <inst> using <op> as reference.
|
1576 schuur 1.5 @param mb Broker this pointer.
1577 @param ctx Context object
1578 @param op ObjectPath containing namespace, classname and key components.
1579 @param inst Complete instance.
1580 @param properties Specifies which properties to set. All properties will be ste if NULL.
1581 @return Service return status.
1582 */
|
1583 konrad.r 1.20 #if defined(CMPI_VER_100)
1584 inline static CMPIStatus CBModifyInstance
1585 (const CMPIBroker* mb, const CMPIContext* ctx,
1586 const CMPIObjectPath* op, const CMPIInstance* inst, const char** properties)
1587 { return ((mb)->bft->modifyInstance((mb),(ctx),(op),(inst),(properties))); }
1588 #else // CMPI_VER_100
|
1589 schuur 1.5 inline static CMPIStatus CBSetInstance
|
1590 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1591 const CMPIObjectPath* op, const CMPIInstance* inst, const char** properties)
1592 { return ((mb)->bft->setInstance((mb),(ctx),(op),(inst),(properties))); }
1593 #endif // CMPI_VER_!00
1594 #else // CMPI_INLINE
1595 #if defined(CMPI_VER_100)
1596 #define CBModifyInstance(b,c,p,i,pr) ((b)->bft->modifyInstance((b),(c),(p),(i),(pr)))
1597 #else
1598 #define CBSetInstance(b,c,p,i,pr) ((b)->bft->setInstance((b),(c),(p),(i),(pr)))
1599 #endif //CMPI_VER_100
|
1600 schuur 1.5 #endif
1601 #else
1602 #ifdef CMPI_INLINE
|
1603 konrad.r 1.11 /** Replace an existing Instance from <inst> using <op> as reference.
|
1604 konrad.r 1.2 @param mb Broker this pointer.
1605 @param ctx Context object
1606 @param op ObjectPath containing namespace, classname and key components.
1607 @param inst Complete instance.
1608 @return Service return status.
1609 */
1610 inline static CMPIStatus CBSetInstance
1611 (CMPIBroker* mb, CMPIContext* ctx,
1612 CMPIObjectPath* op, CMPIInstance* inst)
|
1613 konrad.r 1.16 { return ((mb)->bft->setInstance((mb),(ctx),(op),(inst), NULL)); }
|
1614 schuur 1.5 #else
|
1615 konrad.r 1.2 #define CBSetInstance(b,c,p,i) ((b)->bft->setInstance((b),(c),(p),(i)))
|
1616 schuur 1.5 #endif
1617 #endif //version 90
|
1618 konrad.r 1.2
1619 #ifdef CMPI_INLINE
|
1620 konrad.r 1.11 /** Delete an existing Instance using <op> as reference.
|
1621 konrad.r 1.2 @param mb Broker this pointer.
1622 @param ctx Context object
1623 @param op ObjectPath containing namespace, classname and key components.
1624 @return Service return status.
1625 */
1626 inline static CMPIStatus CBDeleteInstance
|
1627 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1628 const CMPIObjectPath* op)
|
1629 konrad.r 1.2 { return ((mb)->bft->deleteInstance((mb),(ctx),(op))); }
1630 #else
1631 #define CBDeleteInstance(b,c,p) ((b)->bft->deleteInstance((b),(c),(p)))
1632 #endif
1633
1634 #ifdef CMPI_INLINE
1635 /** Query the enumeration of instances of the class (and subclasses) defined
|
1636 konrad.r 1.11 by <op> using <query> expression.
|
1637 konrad.r 1.2 @param mb Broker this pointer.
1638 @param ctx Context object
1639 @param op ObjectPath containing namespace and classname components.
1640 @param query Query expression
1641 @param lang Query Language
1642 @param rc Output: Service return status (suppressed when NULL).
1643 @return Resulting eumeration of Instances.
1644 */
1645 inline static CMPIEnumeration* CBExecQuery
|
1646 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1647 const CMPIObjectPath* op, const char* query, const char* lang, CMPIStatus* rc)
|
1648 konrad.r 1.2 { return ((mb)->bft->execQuery((mb),(ctx),(op),(query),(lang),(rc))); }
1649 #else
1650 #define CBExecQuery(b,c,p,l,q,rc) \
1651 ((b)->bft->execQuery((b),(c),(p),(l),(q),(rc)))
1652 #endif
1653
1654
1655 #ifdef CMPI_INLINE
|
1656 konrad.r 1.11 /** Enumerate instances associated with the Instance defined by the <op>.
|
1657 konrad.r 1.2 @param mb Broker this pointer.
1658 @param ctx Context object
1659 @param op Source ObjectPath containing namespace, classname and key components.
1660 @param assocClass If not NULL, MUST be a valid Association Class name.
1661 It acts as a filter on the returned set of Objects by mandating that
1662 each returned Object MUST be associated to the source Object via an
1663 Instance of this Class or one of its subclasses.
1664 @param resultClass If not NULL, MUST be a valid Class name.
1665 It acts as a filter on the returned set of Objects by mandating that
1666 each returned Object MUST be either an Instance of this Class (or one
1667 of its subclasses).
1668 @param role If not NULL, MUST be a valid Property name.
1669 It acts as a filter on the returned set of Objects by mandating
1670 that each returned Object MUST be associated to the source Object
1671 via an Association in which the source Object plays the specified role
1672 (i.e. the name of the Property in the Association Class that refers
1673 to the source Object MUST match the value of this parameter).
1674 @param resultRole If not NULL, MUST be a valid Property name.
1675 It acts as a filter on the returned set of Objects by mandating
1676 that each returned Object MUST be associated to the source Object
1677 via an Association in which the returned Object plays the specified role
1678 konrad.r 1.2 (i.e. the name of the Property in the Association Class that refers to
1679 the returned Object MUST match the value of this parameter).
1680 @param properties If not NULL, the members of the array define one or more Property
1681 names. Each returned Object MUST NOT include elements for any Properties
1682 missing from this list
1683 @param rc Output: Service return status (suppressed when NULL).
1684 @return Enumeration of Instances.
1685 */
1686 inline static CMPIEnumeration* CBAssociators
|
1687 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1688 const CMPIObjectPath* op, const char* assocClass, const char* resultClass,
1689 const char* role, const char* resultRole, const char** properties, CMPIStatus* rc)
|
1690 konrad.r 1.2 { return ((mb)->bft->associators((mb),(ctx),(op),(assocClass),(resultClass),
1691 (role),(resultRole),(properties),(rc))); }
1692 #else
1693 #define CBAssociators(b,c,p,acl,rcl,r,rr,pr,rc) \
1694 ((b)->bft->associators((b),(c),(p),(acl),(rcl),(r),(rr),(pr),(rc)))
1695 #endif
1696
1697 #ifdef CMPI_INLINE
|
1698 konrad.r 1.11 /** Enumerate ObjectPaths associated with the Instance defined by <op>.
|
1699 konrad.r 1.2 @param mb Broker this pointer.
1700 @param ctx Context object
1701 @param op Source ObjectPath containing namespace, classname and key components.
1702 @param assocClass If not NULL, MUST be a valid Association Class name.
1703 It acts as a filter on the returned set of Objects by mandating that
1704 each returned Object MUST be associated to the source Object via an
1705 Instance of this Class or one of its subclasses.
1706 @param resultClass If not NULL, MUST be a valid Class name.
1707 It acts as a filter on the returned set of Objects by mandating that
1708 each returned Object MUST be either an Instance of this Class (or one
1709 of its subclasses).
1710 @param role If not NULL, MUST be a valid Property name.
1711 It acts as a filter on the returned set of Objects by mandating
1712 that each returned Object MUST be associated to the source Object
1713 via an Association in which the source Object plays the specified role
1714 (i.e. the name of the Property in the Association Class that refers
1715 to the source Object MUST match the value of this parameter).
1716 @param resultRole If not NULL, MUST be a valid Property name.
1717 It acts as a filter on the returned set of Objects by mandating
1718 that each returned Object MUST be associated to the source Object
1719 via an Association in which the returned Object plays the specified role
1720 konrad.r 1.2 (i.e. the name of the Property in the Association Class that refers to
1721 the returned Object MUST match the value of this parameter).
1722 @param rc Output: Service return status (suppressed when NULL).
1723 @return Enumeration of ObjectPaths.
1724 */
1725 inline static CMPIEnumeration* CBAssociatorNames
|
1726 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1727 const CMPIObjectPath* op, const char* assocClass, const char* resultClass,
1728 const char* role, const char* resultRole, CMPIStatus* rc)
|
1729 konrad.r 1.2 { return ((mb)->bft->associatorNames((mb),(ctx),(op),
1730 (assocClass),(resultClass),(role),(resultRole),(rc))); }
1731 #else
1732 #define CBAssociatorNames(b,c,p,acl,rcl,r,rr,rc) \
1733 ((b)->bft->associatorNames((b),(c),(p),(acl),(rcl),(r),(rr),(rc)))
1734 #endif
1735
1736 #ifdef CMPI_INLINE
1737 /** Enumerates the association instances that refer to the instance defined by
|
1738 konrad.r 1.11 <op>.
|
1739 konrad.r 1.2 @param mb Broker this pointer.
1740 @param ctx Context object
1741 @param op Source ObjectPath containing namespace, classname and key components.
1742 @param resultClass If not NULL, MUST be a valid Class name.
1743 It acts as a filter on the returned set of Objects by mandating that
1744 each returned Object MUST be either an Instance of this Class (or one
1745 of its subclasses).
1746 @param role If not NULL, MUST be a valid Property name.
1747 It acts as a filter on the returned set of Objects by mandating
1748 that each returned Object MUST be associated to the source Object
1749 via an Association in which the source Object plays the specified role
1750 (i.e. the name of the Property in the Association Class that refers
1751 to the source Object MUST match the value of this parameter).
1752 @param properties If not NULL, the members of the array define one or more Property
1753 names. Each returned Object MUST NOT include elements for any Properties
1754 missing from this list
1755 @param rc Output: Service return status (suppressed when NULL).
1756 @return Enumeration of ObjectPaths.
1757 */
1758 inline static CMPIEnumeration* CBReferences
|
1759 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1760 const CMPIObjectPath* op, const char* resultClass ,const char* role ,
1761 const char** properties, CMPIStatus* rc)
|
1762 konrad.r 1.2 { return ((mb)->bft->references((mb),(ctx),(op),
1763 (resultClass),(role),(properties),(rc))); }
1764 #else
1765 #define CBReferences(b,c,p,acl,r,pr,rc) \
1766 ((b)->bft->references((b),(c),(p),(acl),(r),(pr),(rc)))
1767 #endif
1768
1769 #ifdef CMPI_INLINE
1770 /** Enumerates the association ObjectPaths that refer to the instance defined by
|
1771 konrad.r 1.11 <op>.
|
1772 konrad.r 1.2 @param mb Broker this pointer.
1773 @param ctx Context object
1774 @param op Source ObjectPath containing namespace, classname and key components.
1775 @param resultClass If not NULL, MUST be a valid Class name.
1776 It acts as a filter on the returned set of Objects by mandating that
1777 each returned Object MUST be either an Instance of this Class (or one
1778 of its subclasses).
1779 @param role If not NULL, MUST be a valid Property name.
1780 It acts as a filter on the returned set of Objects by mandating
1781 that each returned Object MUST be associated to the source Object
1782 via an Association in which the source Object plays the specified role
1783 (i.e. the name of the Property in the Association Class that refers
1784 to the source Object MUST match the value of this parameter).
1785 @param rc Output: Service return status (suppressed when NULL).
1786 @return Enumeration of ObjectPaths.
1787 */
1788 inline static CMPIEnumeration* CBReferenceNames
|
1789 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1790 const CMPIObjectPath* op, const char* resultClass ,const char* role,
|
1791 konrad.r 1.2 CMPIStatus* rc)
1792 { return ((mb)->bft->referenceNames((mb),(ctx),(op),(resultClass),(role),(rc))); }
1793 #else
1794 #define CBReferenceNames(b,c,p,acl,r,rc) \
1795 ((b)->bft->referenceNames((b),(c),(p),(acl),(r),(rc)))
1796 #endif
1797
1798
1799 #ifdef CMPI_INLINE
1800 /** Invoke a named, extrinsic method of an Instance
|
1801 konrad.r 1.11 defined by the <op> parameter.
|
1802 konrad.r 1.2 @param mb Broker this pointer.
1803 @param ctx Context object
1804 @param op ObjectPath containing namespace, classname and key components.
1805 @param method Method name
1806 @param in Input parameters.
1807 @param out Output parameters.
1808 @param rc Output: Service return status (suppressed when NULL).
1809 @return Method return value.
1810 */
1811 inline static CMPIData CBInvokeMethod
|
1812 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1813 const CMPIObjectPath* op, const char* method,
1814 const CMPIArgs* in, CMPIArgs* out, CMPIStatus* rc)
|
1815 konrad.r 1.2 { return ((mb)->bft->invokeMethod((mb),(ctx),(op),(method),(in),(out),(rc))); }
1816 #else
1817 #define CBInvokeMethod(b,c,p,m,ai,ao,rc) \
1818 ((b)->bft->invokeMethod((b),(c),(p),(m),(ai),(ao),(rc)))
1819 #endif
1820
1821 #ifdef CMPI_INLINE
|
1822 konrad.r 1.11 /** Set the named property value of an Instance defined by the <op> parameter.
|
1823 konrad.r 1.2 @param mb Broker this pointer.
1824 @param ctx Context object
1825 @param op ObjectPath containing namespace, classname and key components.
1826 @param name Property name
1827 @param value Value.
1828 @param type Value type.
1829 @return Service return status.
1830 */
1831 inline static CMPIStatus CBSetProperty
|
1832 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1833 const CMPIObjectPath* op, const char* name ,
1834 const CMPIValue *value, const CMPIType type)
|
1835 konrad.r 1.2 { return ((mb)->bft->setProperty((mb),(ctx),(op),(name),
1836 (CMPIValue*)(value),(type))); }
1837 #else
1838 #define CBSetProperty(b,c,p,n,v,t) \
1839 ((b)->bft->setProperty((b),(c),(p),(n),(CMPIValue*)(v),(t)))
1840 #endif
1841
1842 #ifdef CMPI_INLINE
|
1843 konrad.r 1.11 /** Get the named property value of an Instance defined by the <op> parameter.
|
1844 konrad.r 1.2 @param mb Broker this pointer.
1845 @param ctx Context object
1846 @param op ObjectPath containing namespace, classname and key components.
1847 @param name Property name
1848 @param rc Output: Service return status (suppressed when NULL).
1849 @return Property value.
1850 */
1851 inline static CMPIData CBGetProperty
|
1852 konrad.r 1.20 (const CMPIBroker* mb, const CMPIContext* ctx,
1853 const CMPIObjectPath* op, const char* name, CMPIStatus* rc)
|
1854 konrad.r 1.2 { return (mb)->bft->getProperty((mb),(ctx),(op),(name),(rc)); }
1855 #else
1856 #define CBGetProperty(b,c,p,n,rc) \
1857 (b)->bft->getProperty((b),(c),(p),(n),(rc))
1858 #endif
1859
1860
1861 #ifndef DOC_ONLY
1862 // MI factory stubs
1863
|
1864 ms.aruran 1.30 #define CMNoHook
|
1865 konrad.r 1.2 #endif
1866
1867 /*
1868 ----------------- C provider factories ---------------------
1869 */
1870
1871 #ifdef DOC_ONLY
1872 /** This macro generates the function table and initialization stub
|
1873 konrad.r 1.11 for an instance provider. The initialization routine <pn>Create_InstanceMI
|
1874 konrad.r 1.2 is called when this provider module is loaded by the broker.
1875 This macro is for CMPI providers written in plain C.
1876 @param pfx The prefix for all mandatory association provider functions.
1877 This is a character string without quotes.
|
1878 konrad.r 1.11 Mandatory functions are: <pfx>Cleanup, <pfx>EnumInstanceNames,
1879 <pfx>EnumInstances, <pfx>GetInstance, <pfx>CreateInstance,
1880 <pfx>SetInstance, <pfx>DeleteInstance and <pfx>ExecQuery.
|
1881 konrad.r 1.2 @param pn The provider name under which this provider is registered.
1882 This is a character string without quotes.
1883 @param broker The name of the broker variable used by this macro to store
1884 the CMPIBroker pointer
|
1885 konrad.r 1.11 @param hook A statement that is executed within <pn>Create_InstanceMI routine.
|
1886 konrad.r 1.2 This enables you to perform additional initialization functions and
1887 is normally a function call like furtherInit(broker) or CMNoHook.
1888 Use CMNoHook if no further intialization is required.
1889 @return The function table of this instance provider.
1890 */
1891 CMPIInstanceMI* CMInstanceMIStub(chars pfx, chars pn,
1892 CMPIBroker *broker, statement hook);
1893 #else
|
1894 konrad.r 1.20
1895 #if defined(CMPI_VER_100)
1896 #define CMInstanceMIStubChange(pfx) pfx##ModifyInstance
1897 #else
1898 #define CMInstanceMIStubChange(pfx) pfx##SetInstance
1899 #endif
1900
|
1901 konrad.r 1.2 #define CMInstanceMIStub(pfx,pn,broker,hook) \
1902 static CMPIInstanceMIFT instMIFT__={ \
1903 CMPICurrentVersion, \
1904 CMPICurrentVersion, \
1905 "instance" #pn, \
1906 pfx##Cleanup, \
1907 pfx##EnumInstanceNames, \
1908 pfx##EnumInstances, \
1909 pfx##GetInstance, \
1910 pfx##CreateInstance, \
|
1911 konrad.r 1.20 CMInstanceMIStubChange(pfx), \
|
1912 konrad.r 1.2 pfx##DeleteInstance, \
1913 pfx##ExecQuery, \
1914 }; \
|
1915 a.dunfey 1.7 CMPI_EXTERN_C \
|
1916 konrad.r 1.20 CMPIInstanceMI* pn##_Create_InstanceMI(const CMPIBroker* brkr,const CMPIContext *ctx, CMPIStatus *rc) { \
|
1917 konrad.r 1.2 static CMPIInstanceMI mi={ \
1918 NULL, \
1919 &instMIFT__, \
1920 }; \
1921 broker=brkr; \
1922 hook; \
1923 return &mi; \
1924 }
|
1925 konrad.r 1.20
|
1926 konrad.r 1.2 #endif
1927
1928 #ifdef DOC_ONLY
1929 /** This macro generates the function table and initialization stub
1930 for an association provider. The initialization routine
|
1931 konrad.r 1.11 <pn>Create_AssociationMI
|
1932 konrad.r 1.2 is called when this provider module is loaded by the broker.
1933 This macro is for CMPI providers written in plain C.
1934 @param pfx The prefix for all mandatory instance provider functions.
1935 This is a character string without quotes.
|
1936 konrad.r 1.11 Mandatory functions are: <pfx>AssociationCleanup,
1937 <pfx>Associators, <pfx>AssociatorNames, <pfx>References and
1938 <pfx>ReferenceNames.
|
1939 konrad.r 1.2 @param pn The provider name under which this provider is registered.
1940 This is a character string without quotes.
1941 @param broker The name of the broker variable used by this macro to store
1942 the CMPIBroker pointer
|
1943 konrad.r 1.11 @param hook A statement that is executed within <pn>Create_AssociationMI routine.
|
1944 konrad.r 1.2 This enables you to perform additional initialization functions and
1945 is normally a function call like furtherInit(broker) or CMNoHook.
1946 Use CMNoHook if no further intialization is required.
1947 @return The function table of this association provider.
1948 */
1949 CMPIAssociationMI* CMAssociationMIStub(chars pfx, chars pn,
1950 CMPIBroker *broker, statement hook);
1951 #else
1952 #define CMAssociationMIStub(pfx,pn,broker,hook) \
1953 static CMPIAssociationMIFT assocMIFT__={ \
1954 CMPICurrentVersion, \
1955 CMPICurrentVersion, \
1956 "association" #pn, \
1957 pfx##AssociationCleanup, \
1958 pfx##Associators, \
1959 pfx##AssociatorNames, \
1960 pfx##References, \
1961 pfx##ReferenceNames, \
1962 }; \
|
1963 a.dunfey 1.7 CMPI_EXTERN_C \
|
1964 konrad.r 1.20 CMPIAssociationMI* pn##_Create_AssociationMI(const CMPIBroker* brkr,const CMPIContext *ctx, CMPIStatus *rc) { \
|
1965 konrad.r 1.2 static CMPIAssociationMI mi={ \
1966 NULL, \
1967 &assocMIFT__, \
1968 }; \
1969 broker=brkr; \
1970 hook; \
1971 return &mi; \
1972 }
1973 #endif
1974
1975 #ifdef DOC_ONLY
1976 /** This macro generates the function table and initialization stub
|
1977 konrad.r 1.11 for a method provider. The initialization routine <pn>Create_MethodMI
|
1978 konrad.r 1.2 is called when this provider module is loaded by the broker.
1979 This macro is for CMPI providers written in plain C.
1980 @param pfx The prefix for all mandatory method provider functions.
1981 This is a character string without quotes.
|
1982 konrad.r 1.11 Mandatory functions are: <pfx>MthodCleanup and <pfx>InvokeMethod.
|
1983 konrad.r 1.2 @param pn The provider name under which this provider is registered.
1984 This is a character string without quotes.
1985 @param broker The name of the broker variable used by this macro to store
1986 the CMPIBroker pointer
|
1987 konrad.r 1.11 @param hook A statement that is executed within <pn>Create_MethodMI routine.
|
1988 konrad.r 1.2 This enables you to perform additional initialization functions and
1989 is normally a function call like furtherInit(broker) or CMNoHook.
1990 Use CMNoHook if no further intialization is required.
1991 @return The function table of this method provider.
1992 */
1993 CMPIMethodMI* CMMethodMIStub(chars pfx, chars pn,
1994 CMPIBroker *broker, statement hook);
1995 #else
1996 #define CMMethodMIStub(pfx,pn,broker,hook) \
1997 static CMPIMethodMIFT methMIFT__={ \
1998 CMPICurrentVersion, \
1999 CMPICurrentVersion, \
2000 "method" #pn, \
2001 pfx##MethodCleanup, \
2002 pfx##InvokeMethod, \
2003 }; \
|
2004 a.dunfey 1.7 CMPI_EXTERN_C \
|
2005 konrad.r 1.20 CMPIMethodMI* pn##_Create_MethodMI(const CMPIBroker* brkr, const CMPIContext *ctx, CMPIStatus *rc) { \
|
2006 konrad.r 1.2 static CMPIMethodMI mi={ \
2007 NULL, \
2008 &methMIFT__, \
2009 }; \
2010 broker=brkr; \
2011 hook; \
2012 return &mi; \
2013 }
2014 #endif
2015
2016 #ifdef DOC_ONLY
2017 /** This macro generates the function table and initialization stub
|
2018 konrad.r 1.11 for a property provider. The initialization routine <pn>Create_PropertyMI
|
2019 konrad.r 1.2 is called when this provider module is loaded by the broker.
2020 This macro is for CMPI providers written in plain C.
2021 @param pfx The prefix for all mandatory property provider functions.
2022 This is a character string without quotes.
|
2023 konrad.r 1.11 Mandatory functions are: <pfx>PropertyCleanup, <pfx>SetProperty and
2024 <pfx>GetProperty.
|
2025 konrad.r 1.2
2026 @param pn The provider name under which this provider is registered.
2027 This is a character string without quotes.
2028 @param broker The name of the broker variable used by this macro to store
2029 the CMPIBroker pointer
|
2030 konrad.r 1.11 @param hook A statement that is executed within <pn>Create_PropertyMI routine.
|
2031 konrad.r 1.2 This enables you to perform additional initialization functions and
2032 is normally a function call like furtherInit(broker) or CMNoHook.
2033 Use CMNoHook if no further intialization is required.
2034 @return The function table of this property provider.
2035 */
2036 CMPIPropertyMI* CMPropertyMIStub(chars pfx, chars pn,
2037 CMPIBroker *broker, statement hook);
2038 #else
2039 #define CMPropertyMIStub(pfx,pn,broker,hook) \
2040 static CMPIPropertyMIFT propMIFT__={ \
2041 CMPICurrentVersion, \
2042 CMPICurrentVersion, \
2043 "property" #pn, \
2044 pfx##PropertyCleanup, \
2045 pfx##SetProperty, \
2046 pfx##GetProperty, \
2047 }; \
|
2048 a.dunfey 1.7 CMPI_EXTERN_C \
|
2049 konrad.r 1.20 CMPIPropertyMI* pn##_Create_PropertyMI(const CMPIBroker* brkr,const CMPIContext *ctx, CMPIStatus *rc) { \
|
2050 konrad.r 1.2 static CMPIPropertyMI mi={ \
2051 NULL, \
2052 &propMIFT__, \
2053 }; \
2054 broker=brkr; \
2055 hook; \
2056 return &mi; \
2057 }
2058 #endif
2059
2060 #ifdef DOC_ONLY
2061 /** This macro generates the function table and initialization stub
|
2062 konrad.r 1.11 for an indication provider. The initialization routine <pn>Create_IndicationMI
|
2063 konrad.r 1.2 is called when this provider module is loaded by the broker.
2064 This macro is for CMPI providers written in plain C.
2065 @param pfx The prefix for all mandatory indication provider functions.
2066 This is a character string without quotes.
|
2067 konrad.r 1.11 Mandatory functions are: <pfx>IndicationCleanup, <pfx>AuthorizeFilter,
2068 <pfx>MustPoll, <pfx>ActivateFilter and <pfx>DeActivateFilter.
|
2069 konrad.r 1.2 @param pn The provider name under which this provider is registered.
2070 This is a character string without quotes.
2071 @param broker The name of the broker variable used by this macro to store
2072 the CMPIBroker pointer
|
2073 konrad.r 1.11 @param hook A statement that is executed within <pn>Create_IndicationMI routine.
|
2074 konrad.r 1.2 This enables you to perform additional initialization functions and
2075 is normally a function call like furtherInit(broker) or CMNoHook.
2076 Use CMNoHook if no further intialization is required.
2077 @return The function table of this indication provider.
2078 */
2079 CMPIIndicationMI* CMIndicationMIStub(chars pfx, chars pn,
2080 CMPIBroker *broker, statement hook);
2081 #else
2082
2083 #if defined(CMPI_VER_86)
2084 #define CMIndicationMIStubExtensions(pfx) pfx##EnableIndications, \
|
2085 r.kieninger 1.9 pfx##DisableIndications,
|
2086 konrad.r 1.2 #else
2087 #define CMIndicationMIStubExtensions(pfx)
2088 #endif
2089
2090 #define CMIndicationMIStub(pfx,pn,broker,hook) \
2091 static CMPIIndicationMIFT indMIFT__={ \
2092 CMPICurrentVersion, \
2093 CMPICurrentVersion, \
2094 "Indication" #pn, \
2095 pfx##IndicationCleanup, \
2096 pfx##AuthorizeFilter, \
2097 pfx##MustPoll, \
2098 pfx##ActivateFilter, \
2099 pfx##DeActivateFilter, \
2100 CMIndicationMIStubExtensions(pfx) \
2101 }; \
|
2102 a.dunfey 1.7 CMPI_EXTERN_C \
|
2103 konrad.r 1.20 CMPIIndicationMI* pn##_Create_IndicationMI(const CMPIBroker* brkr,const CMPIContext *ctx,CMPIStatus *rc) { \
|
2104 konrad.r 1.2 static CMPIIndicationMI mi={ \
2105 NULL, \
2106 &indMIFT__, \
2107 }; \
2108 broker=brkr; \
2109 hook; \
2110 return &mi; \
2111 }
2112 #endif
2113
2114 /*
2115 ----------------- C++ provider factories ---------------------
2116 */
2117
2118 #ifdef DOC_ONLY
2119 /** This macro generates the function table and initialization stub
|
2120 konrad.r 1.11 for an instance provider. The initialization routine <pn>Create_IndicationMI
|
2121 konrad.r 1.2 is called when this provider module is loaded by the broker.
2122 This macro is for CMPI providers written in C++ using the Cmpi* classes.
2123 @param cn The C++ class name of this instance provider
2124 (a subclass of CmpiInstanceMI).
2125 This is a character string without quotes.
2126 @param pn The provider name under which this provider is registered.
2127 This is a character string without quotes.
2128 @return The function table of this instance provider.
2129 */
2130 CMPIInstanceMI* CMInstanceMIFactory(chars cn, chars pn);
2131 #else
2132 #define CMInstanceMIFactory(cn,pn) \
|
2133 marek 1.15 CMPI_EXTERN_C \
|
2134 konrad.r 1.20 CMPIInstanceMI* pn##_Create_InstanceMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \
|
2135 konrad.r 1.2 static CMPIInstanceMIFT instMIFT={ \
2136 CMPICurrentVersion, \
2137 CMPICurrentVersion, \
2138 "instance" #pn, \
|
2139 konrad.r 1.24 (CMPIStatus(*)(CMPIInstanceMI*,const CMPIContext*,CMPIBoolean))CmpiBaseMI::driveBaseCleanup, \
|
2140 konrad.r 1.2 CmpiInstanceMI::driveEnumInstanceNames, \
2141 CmpiInstanceMI::driveEnumInstances, \
2142 CmpiInstanceMI::driveGetInstance, \
2143 CmpiInstanceMI::driveCreateInstance, \
2144 CmpiInstanceMI::driveSetInstance, \
2145 CmpiInstanceMI::driveDeleteInstance, \
2146 CmpiInstanceMI::driveExecQuery, \
2147 }; \
2148 static CMPIInstanceMI mi; \
2149 fprintf(stderr,"--- _Create_InstanceMI() broker: %p\n",broker); \
|
2150 konrad.r 1.22 CmpiContext ctx((CMPIContext*)ctxp); \
|
2151 konrad.r 1.2 mi.ft=&instMIFT; \
|
2152 r.kieninger 1.9 CmpiBaseMI *provider=base##pn.getBaseMI(); \
2153 if (provider == 0) {\
|
2154 konrad.r 1.22 provider = new cn(CmpiBroker((CMPIBroker*)broker),ctx); \
|
2155 r.kieninger 1.9 provider->setProviderBase(&base##pn); \
|
2156 konrad.r 1.2 provider->initialize(ctx); \
|
2157 r.kieninger 1.9 base##pn.setBaseMI(provider); \
|
2158 konrad.r 1.2 } \
|
2159 r.kieninger 1.9 mi.hdl=provider; \
2160 base##pn.incUseCount(); \
|
2161 konrad.r 1.2 return &mi; \
2162 }
2163 #endif
2164
2165 #ifdef DOC_ONLY
2166 /** This macro generates the function table and initialization stub
2167 for an association provider. The initialization routine
|
2168 konrad.r 1.11 <pn>Create_AssociationMI
|
2169 konrad.r 1.2 is called when this provider module is loaded by the broker.
2170 This macro is for CMPI providers written in C++ using the Cmpi* classes.
2171 @param cn The C++ class name of this instance provider
2172 (a subclass of CmpiInstanceMI).
2173 This is a character string without quotes.
2174 @param pn The provider name under which this provider is registered.
2175 This is a character string without quotes.
2176 @return The function table of this instance provider.
2177 */
2178 CMPIAssociationMI* CMAssociationMIFactory(chars cn, chars pn);
2179 #else
2180 #define CMAssociationMIFactory(cn,pn) \
|
2181 marek 1.15 CMPI_EXTERN_C \
|
2182 konrad.r 1.20 CMPIAssociationMI* pn##_Create_AssociationMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \
|
2183 konrad.r 1.2 static CMPIAssociationMIFT assocMIFT={ \
2184 CMPICurrentVersion, \
2185 CMPICurrentVersion, \
2186 "association" #pn, \
|
2187 konrad.r 1.24 (CMPIStatus(*)(CMPIAssociationMI*,const CMPIContext*,CMPIBoolean))CmpiBaseMI::driveBaseCleanup, \
|
2188 konrad.r 1.2 CmpiAssociationMI::driveAssociators, \
2189 CmpiAssociationMI::driveAssociatorNames, \
2190 CmpiAssociationMI::driveReferences, \
2191 CmpiAssociationMI::driveReferenceNames, \
2192 }; \
2193 static CMPIAssociationMI mi; \
2194 fprintf(stderr,"--- _Create_AssociationMI() broker: %p\n",broker); \
|
2195 konrad.r 1.22 CmpiContext ctx((CMPIContext*)ctxp); \
|
2196 konrad.r 1.2 mi.ft=&assocMIFT; \
|
2197 r.kieninger 1.9 CmpiBaseMI *provider=base##pn.getBaseMI(); \
2198 if (provider == 0) {\
|
2199 konrad.r 1.22 provider = new cn(CmpiBroker((CMPIBroker*)broker),ctx); \
|
2200 r.kieninger 1.9 provider->setProviderBase(&base##pn); \
|
2201 konrad.r 1.2 provider->initialize(ctx); \
|
2202 r.kieninger 1.9 base##pn.setBaseMI(provider); \
|
2203 konrad.r 1.2 } \
|
2204 r.kieninger 1.9 mi.hdl=provider; \
2205 base##pn.incUseCount(); \
|
2206 konrad.r 1.2 return &mi; \
2207 }
2208 #endif
2209
2210 #ifdef DOC_ONLY
2211 /** This macro generates the function table and initialization stub
2212 for an method provider. The initialization routine
|
2213 konrad.r 1.11 <pn>Create_MethodMI is called when this provider module is loaded
|
2214 konrad.r 1.2 by the broker.
2215 This macro is for CMPI providers written in C++ using the Cmpi* classes.
2216 @param cn The C++ class name of this method provider
2217 (a subclass of CmpiMethodMI).
2218 This is a character string without quotes.
2219 @param pn The provider name under which this provider is registered.
2220 This is a character string without quotes.
2221 @return The function table of this association provider.
2222 */
2223 CMPIMethodMI* CMMethodMIFactory(chars cn, chars pn);
2224 #else
2225 #define CMMethodMIFactory(cn,pn) \
|
2226 marek 1.15 CMPI_EXTERN_C \
|
2227 konrad.r 1.20 CMPIMethodMI* pn##_Create_MethodMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \
|
2228 konrad.r 1.2 static CMPIMethodMIFT methMIFT={ \
2229 CMPICurrentVersion, \
2230 CMPICurrentVersion, \
2231 "method" #pn, \
|
2232 konrad.r 1.24 (CMPIStatus(*)(CMPIMethodMI*,const CMPIContext*, CMPIBoolean))CmpiBaseMI::driveBaseCleanup, \
|
2233 konrad.r 1.2 CmpiMethodMI::driveInvokeMethod, \
2234 }; \
2235 static CMPIMethodMI mi; \
2236 fprintf(stderr,"--- _Create_MethodMI() broker: %p\n",broker); \
|
2237 konrad.r 1.22 CmpiContext ctx((CMPIContext*)ctxp); \
|
2238 konrad.r 1.2 mi.ft=&methMIFT; \
|
2239 r.kieninger 1.9 CmpiBaseMI *provider=base##pn.getBaseMI(); \
2240 if (provider == 0) {\
|
2241 konrad.r 1.22 provider = new cn(CmpiBroker((CMPIBroker*)broker),ctx); \
|
2242 r.kieninger 1.9 provider->setProviderBase(&base##pn); \
|
2243 konrad.r 1.2 provider->initialize(ctx); \
|
2244 r.kieninger 1.9 base##pn.setBaseMI(provider); \
|
2245 konrad.r 1.2 } \
|
2246 r.kieninger 1.9 mi.hdl=provider; \
2247 base##pn.incUseCount(); \
|
2248 konrad.r 1.2 return &mi; \
2249 }
2250 #endif
2251
2252 #ifdef DOC_ONLY
2253 /** This macro generates the function table and initialization stub
|
2254 konrad.r 1.11 for a property provider. The initialization routine <pn>Create_PropertyMI
|
2255 konrad.r 1.2 is called when this provider module is loaded by the broker.
2256 This macro is for CMPI providers written in C++ using the Cmpi* classes.
2257 @param cn The C++ class name of this method provider
2258 (a subclass of CmpiMethodMI).
2259 This is a character string without quotes.
2260 @param pn The provider name under which this provider is registered.
2261 This is a character string without quotes.
2262 @return The function table of this association provider.
2263 */
2264 CMPIPropertyMI* CMPropertyMIFactory(chars cn, chars pn):
2265 #else
2266 #define CMPropertyMIFactory(cn,pn) \
|
2267 marek 1.15 CMPI_EXTERN_C \
|
2268 konrad.r 1.20 CMPIMethodMI* pn##_Create_PropertyMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \
|
2269 konrad.r 1.2 static CMPIPropertyMIFT propMIFT={ \
2270 CMPICurrentVersion, \
2271 CMPICurrentVersion, \
2272 "property" #pn, \
|
2273 konrad.r 1.24 (CMPIStatus(*)(CMPIPropertyMI*,const CMPIContext*,CMPIBoolean))CmpiBaseMI::driveBaseCleanup, \
|
2274 konrad.r 1.2 CmpiPropertyMI::driveSetProperty, \
2275 CmpiPropertyMI::driveGetProperty, \
2276 }; \
2277 static CMPIPropertyMI mi; \
2278 fprintf(stderr,"--- _Create_MethodMI() broker: %p\n",broker); \
|
2279 konrad.r 1.22 CmpiContext ctx((CMPIContext*)ctxp); \
|
2280 konrad.r 1.2 mi.ft=&propMIFT; \
|
2281 r.kieninger 1.9 CmpiBaseMI *provider=base##pn.getBaseMI(); \
2282 if (provider == 0) {\
|
2283 konrad.r 1.22 provider = new cn(CmpiBroker((CMPIBroker*)broker),ctx); \
|
2284 r.kieninger 1.9 provider->setProviderBase(&base##pn); \
|
2285 konrad.r 1.2 provider->initialize(ctx); \
|
2286 r.kieninger 1.9 base##pn.setBaseMI(provider); \
|
2287 konrad.r 1.2 } \
|
2288 r.kieninger 1.9 mi.hdl=provider; \
2289 base##pn.incUseCount(); \
|
2290 konrad.r 1.2 return &mi; \
2291 }
2292 #endif
2293
2294
2295 #ifdef DOC_ONLY
2296 /** This macro generates the function table and initialization stub
|
2297 konrad.r 1.11 for an indication provider. The initialization routine <pn>Create_IndicationMI
|
2298 konrad.r 1.2 is called when this provider module is loaded by the broker.
2299 This macro is for CMPI providers written in C++ using the Cmpi* classes.
|
2300 marek 1.18 @param cn The C++ class name of this indication provider
2301 (a subclass of CmpiIndicationMI).
|
2302 konrad.r 1.2 This is a character string without quotes.
2303 @param pn The provider name under which this provider is registered.
2304 This is a character string without quotes.
2305 @return The function table of this association provider.
2306 */
|
2307 marek 1.18 CMPIIndicationMI* CMIndicationMIFactory(chars cn, chars pn);
|
2308 konrad.r 1.2 #else
2309
2310 #if defined(CMPI_VER_86)
|
2311 marek 1.18 #define CMIndicationMIFactoryExtensions CmpiIndicationMI::driveEnableIndications, \
2312 CmpiIndicationMI::driveDisableIndications,
|
2313 konrad.r 1.2 #else
2314 #define CMIndicationMIFactoryExtensions
2315 #endif
2316
2317 #define CMIndicationMIFactory(cn,pn) \
|
2318 marek 1.15 CMPI_EXTERN_C \
|
2319 konrad.r 1.20 CMPIIndicationMI* pn##_Create_IndicationMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \
|
2320 konrad.r 1.2 static CMPIIndicationMIFT indMIFT={ \
2321 CMPICurrentVersion, \
2322 CMPICurrentVersion, \
2323 "indication" #pn, \
|
2324 konrad.r 1.24 (CMPIStatus(*)(CMPIIndicationMI*,const CMPIContext*,CMPIBoolean))CmpiBaseMI::driveBaseCleanup, \
|
2325 marek 1.18 CmpiIndicationMI::driveAuthorizeFilter, \
2326 CmpiIndicationMI::driveMustPoll, \
2327 CmpiIndicationMI::driveActivateFilter, \
2328 CmpiIndicationMI::driveDeActivateFilter, \
|
2329 konrad.r 1.2 CMIndicationMIFactoryExtensions \
2330 }; \
|
2331 marek 1.18 static CMPIIndicationMI mi; \
|
2332 konrad.r 1.2 fprintf(stderr,"--- _Create_IndicationMI() broker: %p\n",broker); \
|
2333 konrad.r 1.22 CmpiContext ctx((CMPIContext*)ctxp); \
|
2334 konrad.r 1.2 mi.ft=&indMIFT; \
|
2335 r.kieninger 1.9 CmpiBaseMI *provider=base##pn.getBaseMI(); \
2336 if (provider == 0) {\
|
2337 konrad.r 1.22 provider = new cn(CmpiBroker((CMPIBroker*)broker),ctx); \
|
2338 r.kieninger 1.9 provider->setProviderBase(&base##pn); \
|
2339 konrad.r 1.2 provider->initialize(ctx); \
|
2340 r.kieninger 1.9 base##pn.setBaseMI(provider); \
|
2341 konrad.r 1.2 } \
|
2342 r.kieninger 1.9 mi.hdl=provider; \
2343 base##pn.incUseCount(); \
|
2344 konrad.r 1.2 return &mi; \
2345 }
2346 #endif
2347
2348 #define CMProviderBase(pn) \
2349 CmpiProviderBase base##pn;
2350
2351 #endif // _CMPIMACS_H_
|