version 1.39, 2004/08/25 00:14:24
|
version 1.51, 2006/11/07 21:30:36
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L. P., IBM Corp., 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.; | // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; |
// IBM Corp.; EMC Corporation, The Open Group. | // 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/CIMType.h> | #include <Pegasus/Common/CIMType.h> |
#include <Pegasus/Common/CIMObjectPath.h> | #include <Pegasus/Common/CIMObjectPath.h> |
|
#include <Pegasus/Common/CIMObject.h> |
#include <Pegasus/Common/CIMDateTime.h> | #include <Pegasus/Common/CIMDateTime.h> |
#include <Pegasus/Common/Exception.h> | #include <Pegasus/Common/Exception.h> |
#include <Pegasus/Common/Array.h> | #include <Pegasus/Common/Array.h> |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class CIMValueRep; | class CIMValueRep; |
|
class CIMObject; |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
class CIMInstance; |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
| |
/** | /** |
The CIMValue class represents a value of any of the CIM data types | The CIMValue class represents a value of any of the CIM data types |
|
|
/// Constructor. | /// Constructor. |
CIMValue(const CIMObjectPath& x); | CIMValue(const CIMObjectPath& x); |
| |
|
/** Constructor. |
|
Note: Constructing a CIMValue with an uninitialized CIMObject is not |
|
defined and results in a thrown UninitializedObjectException. |
|
Note: The input CIMObject will be cloned before putting it into the |
|
value of the constructed CIMValue. This is because CIMObjects use a |
|
shared representation model, but we don't want CIMObjects inside a |
|
CIMValue to be altered by other external changes. |
|
*/ |
|
CIMValue(const CIMObject& x); |
|
|
|
/// Constructor. |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
CIMValue(const CIMInstance& x); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
|
/// Constructor. | /// Constructor. |
CIMValue(const Array<Boolean>& x); | CIMValue(const Array<Boolean>& x); |
| |
|
|
/// Constructor. | /// Constructor. |
CIMValue(const Array<CIMObjectPath>& x); | CIMValue(const Array<CIMObjectPath>& x); |
| |
/// Constructor. |
/** Constructor. |
|
Note: Constructing a CIMValue with an uninitialized CIMObject anywhere |
|
in the input array is not defined and results in a thrown |
|
UninitializedObjectException. |
|
Note: Each CIMObject in the input Array will be cloned before putting |
|
the Array into the value of the constructed CIMValue. This is because |
|
CIMObjects use a shared representation model, but we don't want |
|
CIMObjects inside a CIMValue to be altered by other external changes. |
|
*/ |
|
CIMValue(const Array<CIMObject>& x); |
|
|
|
/// Constructor. |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
CIMValue(const Array<CIMInstance>& x); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
|
|
/** Constructor. |
|
Note: If the input type is CIMObject, it/they will be cloned before |
|
putting it into the value of the constructed CIMValue. This is because |
|
CIMObjects use a shared representation model, but we don't want |
|
CIMObjects inside a CIMValue to be altered by other external changes. |
|
*/ |
CIMValue(const CIMValue& x); | CIMValue(const CIMValue& x); |
| |
/// Destructor. | /// Destructor. |
~CIMValue(); | ~CIMValue(); |
| |
/// Operator = |
/** Operator = |
|
Note: If the right hand side type is CIMObject, it/they will be cloned |
|
before putting it into the value of the target CIMValue. This is because |
|
CIMObjects use a shared representation model, but we don't want |
|
CIMObjects inside a CIMValue to be altered by other external changes. |
|
*/ |
CIMValue& operator=(const CIMValue& x); | CIMValue& operator=(const CIMValue& x); |
| |
/** Assigns one CIMValue object to another CIMValue object. | /** Assigns one CIMValue object to another CIMValue object. |
@param x - CIMValue object to be used for assignment. | @param x - CIMValue object to be used for assignment. |
|
Note: If the input type is CIMObject, it/they will be cloned before |
|
putting it into the value of the target CIMValue. This is because |
|
CIMObjects use a shared representation model, but we don't want |
|
CIMObjects inside a CIMValue to be altered by other external changes. |
*/ | */ |
void assign(const CIMValue& x); | void assign(const CIMValue& x); |
| |
|
|
CIMValue x; | CIMValue x; |
x.set(Uint16(9)); | x.set(Uint16(9)); |
</pre> | </pre> |
|
@exception UninitializedObjectException If the given type is CIMObject, |
|
and the input CIMObject parameter is uninitialized or at least one |
|
entry in the Array of CIMObjects is uninitialized. |
|
Note: If the input type is CIMObject, it/they will be cloned before |
|
putting it into the value of the target CIMValue. This is because |
|
CIMObjects use a shared representation model, but we don't want |
|
CIMObjects inside a CIMValue to be altered by other external changes. |
*/ | */ |
void set(Boolean x); | void set(Boolean x); |
| |
|
|
/// | /// |
void set(const CIMObjectPath& x); | void set(const CIMObjectPath& x); |
/// | /// |
|
void set(const CIMObject& x); |
|
/// |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
void set(const CIMInstance& x); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
/// |
void set(const Array<Boolean>& x); | void set(const Array<Boolean>& x); |
/// | /// |
void set(const Array<Uint8>& x); | void set(const Array<Uint8>& x); |
|
|
void set(const Array<CIMDateTime>& x); | void set(const Array<CIMDateTime>& x); |
/// | /// |
void set(const Array<CIMObjectPath>& x); | void set(const Array<CIMObjectPath>& x); |
|
/// |
|
void set(const Array<CIMObject>& x); |
|
/// |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
void set(const Array<CIMInstance>& x); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
| |
/** Gets the value of a CIMValue. | /** Gets the value of a CIMValue. |
Note: Before using get, the caller should use getType () and isNull () | Note: Before using get, the caller should use getType () and isNull () |
to ensure that the value is not null, and is of the correct type. | to ensure that the value is not null, and is of the correct type. |
| |
|
The behavior of get is undefined when the value is null. |
|
|
@param Variable in which to return the value. | @param Variable in which to return the value. |
@exception TypeMismatchException If the CIMValue type is not compatible | @exception TypeMismatchException If the CIMValue type is not compatible |
with the type of the output parameter. | with the type of the output parameter. |
|
|
/// | /// |
void get(CIMObjectPath& x) const; | void get(CIMObjectPath& x) const; |
/// | /// |
|
void get(CIMObject& x) const; |
|
/// |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
void get(CIMInstance& x) const; |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
/// |
void get(Array<Boolean>& x) const; | void get(Array<Boolean>& x) const; |
/// | /// |
void get(Array<Uint8>& x) const; | void get(Array<Uint8>& x) const; |
////// |
/// |
void get(Array<Sint8>& x) const; | void get(Array<Sint8>& x) const; |
/// | /// |
void get(Array<Uint16>& x) const; | void get(Array<Uint16>& x) const; |
|
|
void get(Array<CIMDateTime>& x) const; | void get(Array<CIMDateTime>& x) const; |
/// | /// |
void get(Array<CIMObjectPath>& x) const; | void get(Array<CIMObjectPath>& x) const; |
|
/// |
|
void get(Array<CIMObject>& x) const; |
|
/// |
|
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
void get(Array<CIMInstance>& x) const; |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
| |
/** Compares with another CIMValue object for equality. | /** Compares with another CIMValue object for equality. |
@param x - CIMValue to compare with. | @param x - CIMValue to compare with. |
|
|
*/ | */ |
String toString() const; | String toString() const; |
| |
|
#ifdef PEGASUS_USE_DEPRECATED_INTERFACES |
|
/** |
|
<I><B>Deprecated Interface</B></I><BR> |
|
Constructor. (Note: This constructor exists solely to support binary |
|
compatibility with a previous definition of the Sint8 type.) |
|
*/ |
|
CIMValue(char x); |
|
|
|
/** |
|
<I><B>Deprecated Interface</B></I><BR> |
|
Constructor. (Note: This constructor exists solely to support binary |
|
compatibility with a previous definition of the Sint8 type.) |
|
*/ |
|
CIMValue(const Array<char>& x); |
|
|
|
/** |
|
<I><B>Deprecated Interface</B></I><BR> |
|
Sets an Sint8 value. (Note: This method exists solely to support |
|
binary compatibility with a previous definition of the Sint8 type.) |
|
*/ |
|
void set(char x); |
|
|
|
/** |
|
<I><B>Deprecated Interface</B></I><BR> |
|
Sets an Sint8 array value. (Note: This method exists solely to support |
|
binary compatibility with a previous definition of the Sint8 type.) |
|
*/ |
|
void set(const Array<char>& x); |
|
|
|
/** |
|
<I><B>Deprecated Interface</B></I><BR> |
|
Gets an Sint8 value. (Note: This method exists solely to support |
|
binary compatibility with a previous definition of the Sint8 type.) |
|
*/ |
|
void get(char& x) const; |
|
|
|
/** |
|
<I><B>Deprecated Interface</B></I><BR> |
|
Gets an Sint8 array value. (Note: This method exists solely to support |
|
binary compatibility with a previous definition of the Sint8 type.) |
|
*/ |
|
void get(Array<char>& x) const; |
|
#endif |
|
|
private: | private: |
| |
|
void _get(const String*& data, Uint32& size) const; |
|
|
CIMValueRep* _rep; | CIMValueRep* _rep; |
| |
friend class CIMMethodRep; | friend class CIMMethodRep; |
|
|
friend class CIMQualifierRep; | friend class CIMQualifierRep; |
friend class CIMQualifierDeclRep; | friend class CIMQualifierDeclRep; |
friend class BinaryStreamer; | friend class BinaryStreamer; |
|
friend class XmlWriter; |
}; | }; |
| |
/** operator == compares two CIMValue objects for equality. | /** operator == compares two CIMValue objects for equality. |
|
|
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
|
#ifdef PEGASUS_INTERNALONLY |
|
#include <Pegasus/Common/CIMValueInline.h> |
|
#endif |
|
|
#endif /* Pegasus_Value_h */ | #endif /* Pegasus_Value_h */ |