version 1.17, 2002/03/24 13:33:07
|
version 1.19, 2002/05/11 21:36:29
|
|
|
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/CIMType.h> | #include <Pegasus/Common/CIMType.h> |
|
#include <Pegasus/Common/CIMReference.h> |
#include <Pegasus/Common/CIMDateTime.h> | #include <Pegasus/Common/CIMDateTime.h> |
#include <Pegasus/Common/Union.h> |
#include <Pegasus/Common/Exception.h> |
#include <Pegasus/Common/Array.h> | #include <Pegasus/Common/Array.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
class CIMValueRep; |
|
|
/** | /** |
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 |
(see CIMType.h for a list of valid CIM data types). This class | (see CIMType.h for a list of valid CIM data types). This class |
|
|
ATTN: Add example | ATTN: Add example |
</pre> | </pre> |
*/ | */ |
CIMValue(Boolean x) { _init(); set(x); } |
CIMValue(Boolean x); |
| |
/// Constructor | /// Constructor |
CIMValue(Uint8 x) { _init(); set(x); } |
CIMValue(Uint8 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Sint8 x) { _init(); set(x); } |
CIMValue(Sint8 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Uint16 x) { _init(); set(x); } |
CIMValue(Uint16 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Sint16 x) { _init(); set(x); } |
CIMValue(Sint16 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Uint32 x) { _init(); set(x); } |
CIMValue(Uint32 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Sint32 x) { _init(); set(x); } |
CIMValue(Sint32 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Uint64 x) { _init(); set(x); } |
CIMValue(Uint64 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Sint64 x) { _init(); set(x); } |
CIMValue(Sint64 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Real32 x) { _init(); set(x); } |
CIMValue(Real32 x); |
| |
/// Constructor | /// Constructor |
CIMValue(Real64 x) { _init(); set(x); } |
CIMValue(Real64 x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Char16& x) { _init(); set(x); } |
CIMValue(const Char16& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const String& x) { _init(); set(x); } |
CIMValue(const String& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const char* x) { _init(); set(x); } |
CIMValue(const char* x); |
| |
/// Constructor | /// Constructor |
CIMValue(const CIMDateTime& x) { _init(); set(x); } |
CIMValue(const CIMDateTime& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const CIMReference& x) { _init(); set(x); } |
CIMValue(const CIMReference& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Boolean>& x) { _init(); set(x); } |
CIMValue(const Array<Boolean>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Uint8>& x) { _init(); set(x); } |
CIMValue(const Array<Uint8>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Sint8>& x) { _init(); set(x); } |
CIMValue(const Array<Sint8>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Uint16>& x) { _init(); set(x); } |
CIMValue(const Array<Uint16>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Sint16>& x) { _init(); set(x); } |
CIMValue(const Array<Sint16>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Uint32>& x) { _init(); set(x); } |
CIMValue(const Array<Uint32>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Sint32>& x) { _init(); set(x); } |
CIMValue(const Array<Sint32>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Uint64>& x) { _init(); set(x); } |
CIMValue(const Array<Uint64>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Sint64>& x) { _init(); set(x); } |
CIMValue(const Array<Sint64>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Real32>& x) { _init(); set(x); } |
CIMValue(const Array<Real32>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Real64>& x) { _init(); set(x); } |
CIMValue(const Array<Real64>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<Char16>& x) { _init(); set(x); } |
CIMValue(const Array<Char16>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<String>& x) { _init(); set(x); } |
CIMValue(const Array<String>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<CIMDateTime>& x) { _init(); set(x); } |
CIMValue(const Array<CIMDateTime>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const Array<CIMReference>& x) { _init(); set(x); } |
CIMValue(const Array<CIMReference>& x); |
| |
/// Constructor | /// Constructor |
CIMValue(const CIMValue& x); | CIMValue(const CIMValue& x); |
|
|
~CIMValue(); | ~CIMValue(); |
| |
/// Operator = | /// Operator = |
CIMValue& operator=(const CIMValue& x) |
CIMValue& operator=(const CIMValue& x); |
{ |
|
assign(x); return *this; |
|
} |
|
| |
/** assign - The method to assign one CIMValue object to another CIMValue | /** assign - The method to assign one CIMValue object to another CIMValue |
object. | object. |
|
|
*/ | */ |
void assign(const CIMValue& x); | void assign(const CIMValue& x); |
| |
|
|
... | ... |
</pre> | </pre> |
*/ | */ |
Boolean typeCompatible(const CIMValue& x) const |
Boolean typeCompatible(const CIMValue& x) const; |
{ |
|
return _type == x._type && _isArray == x._isArray; |
|
} |
|
| |
/** isArray - Determines if the value is an array | /** isArray - Determines if the value is an array |
@return TRUE if the value is an array | @return TRUE if the value is an array |
*/ | */ |
Boolean isArray() const { return _isArray; } |
Boolean isArray() const; |
| |
/** Returns whether the CIMvalue object is Null. | /** Returns whether the CIMvalue object is Null. |
Null is the specific condition where no value has | Null is the specific condition where no value has |
|
|
will create an exception. | will create an exception. |
@return Returns True if the CIMValue object is Null | @return Returns True if the CIMValue object is Null |
*/ | */ |
Boolean isNull() const { return _isNull; } |
Boolean isNull() const; |
| |
/** getArraySize = Returns the size of an Array CIMValue | /** getArraySize = Returns the size of an Array CIMValue |
@return The number of entries in the array | @return The number of entries in the array |
|
|
The CIMType is defined in ATTN: | The CIMType is defined in ATTN: |
@return Returns the CIMType value | @return Returns the CIMType value |
*/ | */ |
CIMType getType() const |
CIMType getType() const; |
{ |
|
return CIMType(_type); |
|
} |
|
| |
/** setNullvalue - Sets the CIMType, the Array indicator and if it is |
/** setNullValue - Sets the CIMType, the Array indicator and if it is |
the arraytype, the Arraysize of a CIMValue and sets the isNull | the arraytype, the Arraysize of a CIMValue and sets the isNull |
Attribute. This function is used to set up CIMValues an NULL but | Attribute. This function is used to set up CIMValues an NULL but |
with valid CIMType and array characteristics (ex. when update from | with valid CIMType and array characteristics (ex. when update from |
|
|
or <VALUE.REFARRAY> tags. If the CIMValue is Null, no element is | or <VALUE.REFARRAY> tags. If the CIMValue is Null, no element is |
returned. | returned. |
@param out Sint8 Array to hold the XML representation | @param out Sint8 Array to hold the XML representation |
@param forceTag Boolean parameter that if set forces the XML tags to |
|
be output even if the CIMValue is NULL. |
|
@return Returns the XML representation of the CIMValue | @return Returns the XML representation of the CIMValue |
object in the input parameter out. | object in the input parameter out. |
*/ | */ |
void toXml(Array<Sint8>& out, Boolean forceTag) const; |
void toXml(Array<Sint8>& out) const; |
| |
/** toXML - Converts a CIMValue object to XML. There is no input | /** toXML - Converts a CIMValue object to XML. There is no input |
parameter and the result is returned as a String rather | parameter and the result is returned as a String rather |
|
|
element as value wrapped in the <VALUE>, <VALUE.ARRAY>, | element as value wrapped in the <VALUE>, <VALUE.ARRAY>, |
<VALUE.REFERENCE>, or <VALUE.REFARRAY> tags. If the | <VALUE.REFERENCE>, or <VALUE.REFARRAY> tags. If the |
CIMValue is Null, no element is returned. | CIMValue is Null, no element is returned. |
@param forceTag Boolean parameter that if set forces the XML tags to |
|
be output even if the CIMValue is NULL. |
|
@return Returns the XML representation of the CIMValue | @return Returns the XML representation of the CIMValue |
object in String form. | object in String form. |
*/ | */ |
String toXml(Boolean forceTag) const; |
String toXml() const; |
| |
/** CIMMethod print - Format and print the Value as XML to std output | /** CIMMethod print - Format and print the Value as XML to std output |
stream | stream |
@param forceTag Boolean parameter that if set forces the XML tags to |
|
be output even if the CIMValue is NULL. |
|
@param o Stream to output to. Defaults to cout. | @param o Stream to output to. Defaults to cout. |
@return None | @return None |
<PRE> | <PRE> |
Example: | Example: |
CIMValue value(Boolean(true)); | CIMValue value(Boolean(true)); |
value.print(true); // Prints "true" |
value.print(); // Prints "true" |
</PRE> | </PRE> |
*/ | */ |
void print(Boolean forceTag, PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const; |
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const; |
| |
/** toMof - Converts a CIMValueObject to Mof. | /** toMof - Converts a CIMValueObject to Mof. |
@out Sint8 Array to hold the Mof representation | @out Sint8 Array to hold the Mof representation |
|
|
| |
private: | private: |
| |
void _init(); |
CIMValueRep* _rep; |
|
|
CIMType _type; |
|
Boolean _isArray; |
|
Boolean _isNull; |
|
Union _u; |
|
| |
friend class CIMMethodRep; | friend class CIMMethodRep; |
friend class CIMParameterRep; | friend class CIMParameterRep; |
|
|
const CIMValue& x, | const CIMValue& x, |
const CIMValue& y); | const CIMValue& y); |
}; | }; |
|
|
/** operator == compares two CIMValue objects for equality. | /** operator == compares two CIMValue objects for equality. |
@param x - First CIMvalue to compare | @param x - First CIMvalue to compare |
@parm y - Second CIMValue to compare | @parm y - Second CIMValue to compare |
|
|
| |
/** operator != compares two CIMValue objects for nonequality | /** operator != compares two CIMValue objects for nonequality |
*/ | */ |
inline Boolean operator!=(const CIMValue& x, const CIMValue& y) |
PEGASUS_COMMON_LINKAGE Boolean operator!=(const CIMValue& x, const CIMValue& y); |
{ |
|
return !operator==(x, y); |
|
} |
|
| |
#define PEGASUS_ARRAY_T CIMValue | #define PEGASUS_ARRAY_T CIMValue |
# include "ArrayInter.h" | # include "ArrayInter.h" |