1 karl 1.17 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.12 // 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 karl 1.9 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.12 // 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.13 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.17 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 kumpf 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // 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 kumpf 1.1 #ifndef Pegasus_InternalException_h
35 #define Pegasus_InternalException_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/Linkage.h>
39 #include <Pegasus/Common/Exception.h>
|
40 jim.wunderlich 1.14 #include <Pegasus/Common/PegasusAssert.h>
41
|
42 kumpf 1.1 PEGASUS_NAMESPACE_BEGIN
43
44 /** Class AssertionFailureException
45 This is an Exception class tied to the definiton of an assert named
46 PEGASUS_ASSERT. This assertion can be included at any point in Pegasus
47 code
48 */
49 class PEGASUS_COMMON_LINKAGE AssertionFailureException : public Exception
50 {
51 public:
52
53 AssertionFailureException(
|
54 kumpf 1.21 const char* file,
55 size_t line,
56 const String& message);
|
57 mike 1.19
58 virtual ~AssertionFailureException();
|
59 kumpf 1.1 };
60
61
62 /* Macro to Create the equivalent of an assert but without the
63 termination. This can be used as a temporary marker for asserts
64 that are not working. Prints out the error but continues.
65 NOTE: This is useful in test programs to keep us aware that we
66 have problems without halting the test sequence.
67 This was created primarily to put temporary asserts into tests that
68 are not yet working correctly but will not stop the test sequence.
69 */
70 #define ASSERTTEMP(COND) \
71 do \
72 { \
|
73 kumpf 1.21 if (!(COND)) \
74 { \
75 cerr << "TEMP Assert Error TEMP **********" \
76 <<__FILE__ << " " << __LINE__ \
77 << " " << #COND << endl; \
78 } \
|
79 kumpf 1.1 } while (0)
80
81
82 // ATTN: P3 KS documentation Required
83 class PEGASUS_COMMON_LINKAGE NullPointer : public Exception
84 {
85 public:
86
87 static const char MSG[];
|
88 kumpf 1.22 static const char KEY[];
|
89 kumpf 1.1
|
90 mike 1.19 NullPointer();
|
91 chuck 1.5
|
92 mike 1.19 virtual ~NullPointer();
|
93 kumpf 1.1 };
94
95 // ATTN: P3 KS documentation Required
96 class PEGASUS_COMMON_LINKAGE UndeclaredQualifier : public Exception
97 {
98 public:
99
100 static const char MSG[];
|
101 kumpf 1.22 static const char KEY[];
|
102 kumpf 1.1
|
103 mike 1.19 UndeclaredQualifier(const String& qualifierName) ;
|
104 chuck 1.5
|
105 mike 1.19 virtual ~UndeclaredQualifier();
|
106 kumpf 1.1 };
107
108 // ATTN: P3 KS documentation Required
109 class PEGASUS_COMMON_LINKAGE BadQualifierScope : public Exception
110 {
111 public:
112
|
113 kumpf 1.22 static const char MSG[];
114 static const char KEY[];
|
115 kumpf 1.1
|
116 mike 1.19 BadQualifierScope(
|
117 kumpf 1.22 const String& qualifierName,
|
118 kumpf 1.21 const String& scopeString);
|
119 chuck 1.5
|
120 mike 1.19 virtual ~BadQualifierScope();
|
121 kumpf 1.1 };
122
123 // ATTN: P3 KS documentation Required
124 class PEGASUS_COMMON_LINKAGE BadQualifierOverride : public Exception
125 {
126 public:
127
128 static const char MSG[];
|
129 kumpf 1.22 static const char KEY[];
|
130 kumpf 1.1
|
131 mike 1.19 BadQualifierOverride(const String& qualifierName);
132
133 virtual ~BadQualifierOverride();
|
134 kumpf 1.1 };
135
136 class PEGASUS_COMMON_LINKAGE BadQualifierType : public Exception
137 {
138 public:
139
140 static const char MSG[];
|
141 kumpf 1.22 static const char KEY[];
|
142 kumpf 1.1
|
143 mike 1.19 BadQualifierType(const String& qualifierName);
144 virtual ~BadQualifierType();
|
145 kumpf 1.1 };
146
147 // ATTN: P3 KS documentation Required
148 class PEGASUS_COMMON_LINKAGE ClassAlreadyResolved : public Exception
149 {
150 public:
151
152 static const char MSG[];
|
153 kumpf 1.22 static const char KEY[];
|
154 kumpf 1.1
|
155 mike 1.19 ClassAlreadyResolved(const String& className);
156
157 virtual ~ClassAlreadyResolved();
|
158 kumpf 1.1 };
159
160 // ATTN: P3 KS documentation Required
161 class PEGASUS_COMMON_LINKAGE ClassNotResolved : public Exception
162 {
163 public:
164
165 static const char MSG[];
|
166 kumpf 1.22 static const char KEY[];
|
167 kumpf 1.1
|
168 mike 1.19 ClassNotResolved(const String& className);
169 virtual ~ClassNotResolved();
|
170 kumpf 1.1 };
171
172 // ATTN: P3 KS documentation Required
173 class PEGASUS_COMMON_LINKAGE InstanceAlreadyResolved : public Exception
174 {
175 public:
176
177 static const char MSG[];
|
178 kumpf 1.22 static const char KEY[];
|
179 kumpf 1.1
|
180 mike 1.19 InstanceAlreadyResolved();
181 virtual ~InstanceAlreadyResolved();
|
182 kumpf 1.1 };
183
184 // ATTN: P3 KS documentation Required
185 class PEGASUS_COMMON_LINKAGE InstantiatedAbstractClass : public Exception
186 {
187 public:
188
189 static const char MSG[];
|
190 kumpf 1.22 static const char KEY[];
|
191 kumpf 1.1
|
192 mike 1.19 InstantiatedAbstractClass(const String& className);
193 virtual ~InstantiatedAbstractClass();
|
194 kumpf 1.1 };
195
196 // ATTN: P3 KS documentation Required
197 class PEGASUS_COMMON_LINKAGE NoSuchProperty : public Exception
198 {
199 public:
200
201 static const char MSG[];
|
202 kumpf 1.22 static const char KEY[];
|
203 kumpf 1.1
|
204 mike 1.19 NoSuchProperty(const String& propertyName);
205 virtual ~NoSuchProperty();
|
206 kumpf 1.1 };
207
208 // ATTN: P3 KS documentation Required
209 class PEGASUS_COMMON_LINKAGE NoSuchFile : public Exception
210 {
211 public:
212
213 static const char MSG[];
|
214 kumpf 1.22 static const char KEY[];
|
215 kumpf 1.1
|
216 mike 1.19 NoSuchFile(const String& fileName);
217 virtual ~NoSuchFile();
|
218 kumpf 1.1 };
219
220 // ATTN: P3 KS documentation Required
221 class PEGASUS_COMMON_LINKAGE FileNotReadable : public Exception
222 {
223 public:
224
225 static const char MSG[];
|
226 kumpf 1.22 static const char KEY[];
|
227 kumpf 1.1
|
228 mike 1.19 FileNotReadable(const String& fileName);
229 virtual ~FileNotReadable();
|
230 kumpf 1.1 };
231
232 // ATTN: P3 KS documentation Required
233 class PEGASUS_COMMON_LINKAGE CannotRemoveDirectory : public Exception
234 {
235 public:
236
237 static const char MSG[];
|
238 kumpf 1.22 static const char KEY[];
|
239 kumpf 1.1
|
240 mike 1.19 CannotRemoveDirectory(const String& path);
241 virtual ~CannotRemoveDirectory();
|
242 kumpf 1.1 };
243
244 // ATTN: P3 KS documentation Required
245 class PEGASUS_COMMON_LINKAGE CannotRemoveFile : public Exception
246 {
247 public:
248
249 static const char MSG[];
|
250 kumpf 1.22 static const char KEY[];
|
251 kumpf 1.1
|
252 mike 1.19 CannotRemoveFile(const String& path);
253 virtual ~CannotRemoveFile();
|
254 kumpf 1.1 };
255
256 // ATTN: P3 KS documentation Required
257 class PEGASUS_COMMON_LINKAGE CannotRenameFile : public Exception
258 {
259 public:
260
261 static const char MSG[];
|
262 kumpf 1.22 static const char KEY[];
|
263 kumpf 1.1
|
264 mike 1.19 CannotRenameFile(const String& path);
265 virtual ~CannotRenameFile();
|
266 kumpf 1.1 };
267
268 // ATTN: P3 KS documentation Required
269 class PEGASUS_COMMON_LINKAGE NoSuchDirectory : public Exception
270 {
271 public:
272
273 static const char MSG[];
|
274 kumpf 1.22 static const char KEY[];
|
275 kumpf 1.1
|
276 mike 1.19 NoSuchDirectory(const String& directoryName);
277 virtual ~NoSuchDirectory();
|
278 kumpf 1.1 };
279
280 // ATTN: P3 KS documentation Required
281 class PEGASUS_COMMON_LINKAGE CannotCreateDirectory : public Exception
282 {
283 public:
284
285 static const char MSG[];
|
286 kumpf 1.22 static const char KEY[];
|
287 kumpf 1.1
|
288 mike 1.19 CannotCreateDirectory(const String& path);
289 virtual ~CannotCreateDirectory();
|
290 kumpf 1.1 };
291
292 // ATTN: P3 KS documentation Required
293 class PEGASUS_COMMON_LINKAGE CannotOpenFile : public Exception
294 {
295 public:
296
297 static const char MSG[];
|
298 kumpf 1.22 static const char KEY[];
|
299 kumpf 1.1
|
300 mike 1.19 CannotOpenFile(const String& path);
301 virtual ~CannotOpenFile();
|
302 kumpf 1.1 };
303
304 // ATTN: P3 KS documentation Required
|
305 thilo.boehm 1.25.4.1 class PEGASUS_COMMON_LINKAGE CannotChangeFilePerm : public Exception
306 {
307 public:
308
309 static const char MSG[];
310 static const char KEY[];
311
312 CannotChangeFilePerm(const String& path);
313 virtual ~CannotChangeFilePerm();
314 };
315
316 // ATTN: P3 KS documentation Required
|
317 kumpf 1.1 class PEGASUS_COMMON_LINKAGE NotImplemented : public Exception
318 {
319 public:
320
321 static const char MSG[];
|
322 kumpf 1.22 static const char KEY[];
|
323 kumpf 1.1
|
324 mike 1.19 NotImplemented(const String& method);
325 virtual ~NotImplemented();
|
326 kumpf 1.1 };
327
328 class PEGASUS_COMMON_LINKAGE StackUnderflow : public Exception
329 {
330 public:
331
332 static const char MSG[];
|
333 kumpf 1.22 static const char KEY[];
|
334 kumpf 1.1
|
335 mike 1.19 StackUnderflow();
336 virtual ~StackUnderflow();
|
337 kumpf 1.1 };
338
339 class PEGASUS_COMMON_LINKAGE StackOverflow : public Exception
340 {
341 public:
342
343 static const char MSG[];
|
344 kumpf 1.22 static const char KEY[];
|
345 kumpf 1.1
|
346 mike 1.19 StackOverflow();
347 virtual ~StackOverflow();
|
348 kumpf 1.1 };
349
350 class PEGASUS_COMMON_LINKAGE BadlyFormedCGIQueryString : public Exception
351 {
352 public:
353
354 static const char MSG[];
|
355 kumpf 1.22 static const char KEY[];
|
356 kumpf 1.1
|
357 mike 1.19 BadlyFormedCGIQueryString();
358 virtual ~BadlyFormedCGIQueryString();
|
359 kumpf 1.1 };
360
361 class PEGASUS_COMMON_LINKAGE DynamicLoadFailed : public Exception
362 {
363 public:
364
365 static const char MSG[];
|
366 kumpf 1.22 static const char KEY[];
|
367 kumpf 1.1
|
368 mike 1.19 DynamicLoadFailed(const String& libraryName);
369 virtual ~DynamicLoadFailed();
|
370 kumpf 1.1 };
371
372 class PEGASUS_COMMON_LINKAGE DynamicLookupFailed : public Exception
373 {
374 public:
375
376 static const char MSG[];
|
377 kumpf 1.22 static const char KEY[];
|
378 kumpf 1.1
|
379 mike 1.19 DynamicLookupFailed(const String& symbolName);
380 virtual ~DynamicLookupFailed();
|
381 kumpf 1.1 };
382
383 class PEGASUS_COMMON_LINKAGE CannotOpenDirectory : public Exception
384 {
385 public:
386
387 static const char MSG[];
|
388 kumpf 1.22 static const char KEY[];
|
389 kumpf 1.1
|
390 mike 1.19 CannotOpenDirectory(const String& path);
391 virtual ~CannotOpenDirectory();
|
392 kumpf 1.1 };
393
394 class PEGASUS_COMMON_LINKAGE ParseError : public Exception
395 {
396 public:
397
398 static const char MSG[];
|
399 kumpf 1.22 static const char KEY[];
|
400 kumpf 1.1
|
401 mike 1.19 ParseError(const String& message);
402 virtual ~ParseError();
|
403 kumpf 1.1 };
404
405 class PEGASUS_COMMON_LINKAGE MissingNullTerminator : public Exception
406 {
407 public:
408
409 static const char MSG[];
|
410 kumpf 1.22 static const char KEY[];
|
411 kumpf 1.1
|
412 mike 1.19 MissingNullTerminator();
413 virtual ~MissingNullTerminator();
|
414 chuck 1.5 };
415
416 class PEGASUS_COMMON_LINKAGE MalformedLanguageHeader: public Exception
417 {
418 public:
419
420 static const char MSG[];
|
421 kumpf 1.22 static const char KEY[];
|
422 chuck 1.5
|
423 mike 1.19 MalformedLanguageHeader(const String& error);
424 virtual ~MalformedLanguageHeader();
|
425 chuck 1.5 };
426
427 class PEGASUS_COMMON_LINKAGE InvalidAcceptLanguageHeader: public Exception
428 {
429 public:
430
431 static const char MSG[];
|
432 kumpf 1.22 static const char KEY[];
|
433 chuck 1.5
|
434 mike 1.19 InvalidAcceptLanguageHeader(const String& error);
435 virtual ~InvalidAcceptLanguageHeader();
|
436 kumpf 1.1 };
437
|
438 chuck 1.5 class PEGASUS_COMMON_LINKAGE InvalidContentLanguageHeader: public Exception
439 {
440 public:
441
442 static const char MSG[];
|
443 kumpf 1.22 static const char KEY[];
|
444 chuck 1.5
|
445 mike 1.19 InvalidContentLanguageHeader(const String& error);
446 virtual ~InvalidContentLanguageHeader();
|
447 chuck 1.5 };
448
|
449 kumpf 1.1 class PEGASUS_COMMON_LINKAGE InvalidAuthHeader: public Exception
450 {
451 public:
452
453 static const char MSG[];
|
454 kumpf 1.22 static const char KEY[];
|
455 kumpf 1.1
|
456 mike 1.19 InvalidAuthHeader();
457 virtual ~InvalidAuthHeader();
|
458 kumpf 1.1 };
459
460 class PEGASUS_COMMON_LINKAGE UnauthorizedAccess: public Exception
461 {
462 public:
463
464 static const char MSG[];
|
465 kumpf 1.22 static const char KEY[];
|
466 kumpf 1.1
|
467 mike 1.19 UnauthorizedAccess();
468 virtual ~UnauthorizedAccess();
|
469 kumpf 1.1 };
470
|
471 kumpf 1.4 class PEGASUS_COMMON_LINKAGE IncompatibleTypesException : public Exception
472 {
473 public:
|
474 kumpf 1.22 IncompatibleTypesException();
475 virtual ~IncompatibleTypesException();
|
476 kumpf 1.4 };
477
|
478 kumpf 1.10 class PEGASUS_COMMON_LINKAGE InternalSystemError : public Exception
479 {
480 public:
481
482 static const char MSG[];
483
|
484 mike 1.19 InternalSystemError();
485 virtual ~InternalSystemError();
|
486 kumpf 1.10 };
487
|
488 kumpf 1.4
|
489 kumpf 1.1 /** The CIMException defines the CIM exceptions that are formally defined in
|
490 kumpf 1.2 the CIM Operations over HTTP specification. TraceableCIMException allows
|
491 kumpf 1.1 file name and line number information to be added for diagnostic purposes.
492 */
|
493 kumpf 1.2 class PEGASUS_COMMON_LINKAGE TraceableCIMException : public CIMException
|
494 kumpf 1.1 {
495 public:
496
|
497 kumpf 1.2 TraceableCIMException(
|
498 kumpf 1.21 CIMStatusCode code,
499 const String& message,
500 const String& file,
501 Uint32 line);
502
503 TraceableCIMException(
504 CIMStatusCode code,
|
505 kumpf 1.23 const MessageLoaderParms& parms,
|
506 kumpf 1.21 const String& file,
507 Uint32 line);
508
509 TraceableCIMException(
510 const ContentLanguageList& langs,
511 CIMStatusCode code,
512 const String& message,
513 const String& file,
514 Uint32 line);
|
515 chuck 1.5
|
516 kumpf 1.2 TraceableCIMException(const CIMException & cimException);
517
518 String getDescription() const;
|
519 kumpf 1.1
520 String getTraceDescription() const;
|
521 kumpf 1.11
522 String getCIMMessage() const;
523 void setCIMMessage(const String& cimMessage);
524
525 String getFile() const;
526 Uint32 getLine() const;
|
527 kumpf 1.16 const ContentLanguageList& getContentLanguages() const;
|
528 kumpf 1.2 };
|
529 kumpf 1.1
|
530 kumpf 1.2 #define PEGASUS_CIM_EXCEPTION(CODE, EXTRA_MESSAGE) \
|
531 kumpf 1.11 TraceableCIMException(CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
|
532 chuck 1.5
533 #define PEGASUS_CIM_EXCEPTION_LANG(LANGS, CODE, EXTRA_MESSAGE) \
|
534 kumpf 1.11 TraceableCIMException( \
|
535 kumpf 1.22 LANGS, CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
536
|
537 humberto 1.7 #define PEGASUS_CIM_EXCEPTION_L(CODE, MSG_PARMS) \
|
538 kumpf 1.11 TraceableCIMException(CODE, MSG_PARMS, String(__FILE__), __LINE__)
|
539 kumpf 1.1
|
540 kumpf 1.22 /** Macro to prevent overflow of a signed int value when said value is
|
541 dave.sudlik 1.18 * doubled. If String/Array/Buffer size is greater than 0x3FFFFFFF, then
542 * something is suspect, throw bad_alloc exception.
543 */
544 #define PEGASUS_CHECK_CAPACITY_OVERFLOW(capacity) \
545 do \
546 { \
547 if (capacity > 0x3FFFFFFF) \
548 throw PEGASUS_STD(bad_alloc)(); \
549 } \
550 while (0)
551
|
552 marek 1.25 /** The following function CheckRep serves to reduce the function call
553 * overhead caused by calling a non-inlined function that only checks
554 * if a pointer is not NULL.
555 * The function ThrowUnitializedObjectException throws
556 * an UninitialisedObjectException.
557 * A function to throw the exception is used to reduce object size of
558 * function CheckRep which is inlined in many places across
559 * the common library.
560 */
561 PEGASUS_COMMON_LINKAGE extern void ThrowUninitializedObjectException();
562
563 inline void CheckRep(void * rep)
564 {
565 if (!rep)
566 ThrowUninitializedObjectException();
567 };
568
|
569 kumpf 1.1 PEGASUS_NAMESPACE_END
570
571 #endif /* Pegasus_InternalException_h */
|