version 1.6, 2003/07/18 13:26:20
|
version 1.18, 2006/05/10 19:40:38
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/Exception.h> | #include <Pegasus/Common/Exception.h> |
|
#include <Pegasus/Common/PegasusAssert.h> |
|
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
const String& message); | const String& message); |
}; | }; |
| |
/** define PEGASUS_ASSERT assertion statement. This statement tests the |
|
condition defined by the parameters and if not True executes an |
|
|
|
<pre> |
|
throw AssertionFailureException |
|
</pre> |
|
|
|
defining the file, line and condition that was tested. |
|
*/ |
|
#ifdef NDEBUG |
|
#define PEGASUS_ASSERT(COND) |
|
#else |
|
#define PEGASUS_ASSERT(COND) \ |
|
do \ |
|
{ \ |
|
if (!(COND)) \ |
|
{ \ |
|
throw AssertionFailureException(__FILE__, __LINE__, #COND); \ |
|
} \ |
|
} while (0) |
|
#endif |
|
| |
/* Macro to Create the equivalent of an assert but without the | /* Macro to Create the equivalent of an assert but without the |
termination. This can be used as a temporary marker for asserts | termination. This can be used as a temporary marker for asserts |
|
|
} while (0) | } while (0) |
| |
| |
// l10n TODO - finish the commented out constructors |
|
|
|
// ATTN: P3 KS documentation Required | // ATTN: P3 KS documentation Required |
class PEGASUS_COMMON_LINKAGE NullPointer : public Exception | class PEGASUS_COMMON_LINKAGE NullPointer : public Exception |
{ | { |
|
|
IncompatibleTypesException(); | IncompatibleTypesException(); |
}; | }; |
| |
|
class PEGASUS_COMMON_LINKAGE InternalSystemError : public Exception |
|
{ |
|
public: |
|
|
|
static const char MSG[]; |
|
|
|
InternalSystemError() |
|
: Exception(MSG) { } |
|
}; |
|
|
| |
/** The CIMException defines the CIM exceptions that are formally defined in | /** The CIMException defines the CIM exceptions that are formally defined in |
the CIM Operations over HTTP specification. TraceableCIMException allows | the CIM Operations over HTTP specification. TraceableCIMException allows |
|
|
TraceableCIMException( | TraceableCIMException( |
CIMStatusCode code, | CIMStatusCode code, |
const String& message, | const String& message, |
const char* file, |
const String& file, |
Uint32 line); | Uint32 line); |
| |
// l10n | // l10n |
TraceableCIMException( | TraceableCIMException( |
const ContentLanguages& langs, |
CIMStatusCode code, |
|
MessageLoaderParms parms, |
|
const String& file, |
|
Uint32 line); |
|
|
|
// l10n |
|
TraceableCIMException( |
|
const ContentLanguageList& langs, |
CIMStatusCode code, | CIMStatusCode code, |
const String& message, | const String& message, |
const char* file, |
const String& file, |
Uint32 line); | Uint32 line); |
| |
TraceableCIMException(const CIMException & cimException); | TraceableCIMException(const CIMException & cimException); |
|
|
String getDescription() const; | String getDescription() const; |
| |
String getTraceDescription() const; | String getTraceDescription() const; |
|
|
|
String getCIMMessage() const; |
|
void setCIMMessage(const String& cimMessage); |
|
|
|
String getFile() const; |
|
Uint32 getLine() const; |
|
const ContentLanguageList& getContentLanguages() const; |
}; | }; |
| |
#define PEGASUS_CIM_EXCEPTION(CODE, EXTRA_MESSAGE) \ | #define PEGASUS_CIM_EXCEPTION(CODE, EXTRA_MESSAGE) \ |
TraceableCIMException(CODE, EXTRA_MESSAGE, __FILE__, __LINE__) |
TraceableCIMException(CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__) |
| |
// l10n | // l10n |
#define PEGASUS_CIM_EXCEPTION_LANG(LANGS, CODE, EXTRA_MESSAGE) \ | #define PEGASUS_CIM_EXCEPTION_LANG(LANGS, CODE, EXTRA_MESSAGE) \ |
TraceableCIMException(LANGS, CODE, EXTRA_MESSAGE, __FILE__, __LINE__) |
TraceableCIMException( \ |
|
LANGS, CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__) |
|
|
|
//l10n |
|
#define PEGASUS_CIM_EXCEPTION_L(CODE, MSG_PARMS) \ |
|
TraceableCIMException(CODE, MSG_PARMS, String(__FILE__), __LINE__) |
|
|
|
/** Macro to prevent overflow of a signed int value when said value is |
|
* doubled. If String/Array/Buffer size is greater than 0x3FFFFFFF, then |
|
* something is suspect, throw bad_alloc exception. |
|
*/ |
|
#define PEGASUS_CHECK_CAPACITY_OVERFLOW(capacity) \ |
|
do \ |
|
{ \ |
|
if (capacity > 0x3FFFFFFF) \ |
|
throw PEGASUS_STD(bad_alloc)(); \ |
|
} \ |
|
while (0) |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |