version 1.13, 2002/02/18 13:59:48
|
version 1.17, 2002/03/24 13:33:07
|
|
|
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: Karl schopmeyer (k.schopmeyer@opengroup.org) | // Modified By: Karl schopmeyer (k.schopmeyer@opengroup.org) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
class PEGASUS_COMMON_LINKAGE CIMValue | class PEGASUS_COMMON_LINKAGE CIMValue |
{ | { |
public: | public: |
/// Constructor |
/** Constructor with no value. This constructor creates an NULL CIMValue |
|
object set to null and with type CIMType:none and !arraytype. |
|
*/ |
CIMValue(); | CIMValue(); |
| |
/// Constructor |
/** Constructor with only the Type. This constructor creates a NULL CIMValue |
|
object with the array indicator set as shown and with the |
|
*/ |
|
CIMValue(CIMType type, Boolean isArray, Uint32 arraySize = 0); |
|
|
|
/** Constructor with the Value constructor and a value. This constructs a |
|
CIMValue object with the type defined by the value constructor and the value |
|
installed |
|
<pre> |
|
ATTN: Add example |
|
</pre> |
|
*/ |
CIMValue(Boolean x) { _init(); set(x); } | CIMValue(Boolean x) { _init(); set(x); } |
| |
/// Constructor | /// Constructor |
|
|
CIMValue(const Array<CIMDateTime>& x) { _init(); set(x); } | CIMValue(const Array<CIMDateTime>& x) { _init(); set(x); } |
| |
/// Constructor | /// Constructor |
|
CIMValue(const Array<CIMReference>& x) { _init(); set(x); } |
|
|
|
/// Constructor |
CIMValue(const CIMValue& x); | CIMValue(const CIMValue& x); |
| |
/// Destrustructor |
/// Destructor |
~CIMValue(); | ~CIMValue(); |
| |
/// Operator = | /// Operator = |
|
|
@param arraySize (optional) Uint32parameter indicating the array | @param arraySize (optional) Uint32parameter indicating the array |
size | size |
@return void | @return void |
|
<pre> |
|
CIMValue value; // Create a CIMValue object |
|
value.setNullValue(CIMType::BOOLEAN, false); // Set it |
|
</pre> |
*/ | */ |
void setNullValue(CIMType type, Boolean isArray, Uint32 arraySize = 0); | void setNullValue(CIMType type, Boolean isArray, Uint32 arraySize = 0); |
| |
/** set - Sets the type, Array attribute and puts the value provided | /** set - Sets the type, Array attribute and puts the value provided |
into the value of the target CIMValue. This function sets the | into the value of the target CIMValue. This function sets the |
CIMValue to nonNull also. |
CIMValue to nonNull also. The result is a complete CIMValue object |
All of the CIMTypes defined in ATTN: and the Array types defined in | All of the CIMTypes defined in ATTN: and the Array types defined in |
ATTN: may be set. | ATTN: may be set. |
@param x Typed value (ex. Boolean(true). | @param x Typed value (ex. Boolean(true). |
|
|
void set(const Array<String>& x); | void set(const Array<String>& x); |
/// | /// |
void set(const Array<CIMDateTime>& x); | void set(const Array<CIMDateTime>& x); |
|
/// |
|
void set(const Array<CIMReference>& x); |
| |
/** get - Gets the value of a CIMValue | /** get - Gets the value of a CIMValue |
@param ATTNDOC: |
@param Variable in which we return the value: |
@return ATTNDOC: |
@return void |
|
<pre> |
|
Uint32 v; |
|
CIMValue value(CIMValue::UINT32, UINT32(99)); |
|
value.get(v); |
|
</pre> |
*/ | */ |
void get(Boolean& x) const; | void get(Boolean& x) const; |
/// | /// |
|
|
void get(Array<String>& x) const; | void get(Array<String>& x) const; |
/// | /// |
void get(Array<CIMDateTime>& x) const; | void get(Array<CIMDateTime>& x) const; |
|
/// |
|
void get(Array<CIMReference>& x) const; |
| |
/** toXML - Converts a CIMValue object to XML. The XML is appended | /** toXML - Converts a CIMValue object to XML. The XML is appended |
to the Array provided with the call.Returns the result as an | to the Array provided with the call.Returns the result as an |
XML elemet wrapped in the <VALUE> or <ARRAYVALUE> tags. If the |
XML element wrapped in the <VALUE>, <VALUE.ARRAY>, <VALUE.REFERENCE>, |
CIMValue is Null, no element is returned. |
or <VALUE.REFARRAY> tags. If the CIMValue is Null, no element is |
|
returned. |
@paramout Sint8 Array to hold the XML representation | @paramout 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) const; |
void toXml(Array<Sint8>& out, Boolean forceTag) 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 |
than appended to an 8-bit array as above. Returns the | than appended to an 8-bit array as above. Returns the |
element as value wrapped in the <VALUE> or ARRAYVALUE tags. If the |
element as value wrapped in the <VALUE>, <VALUE.ARRAY>, |
|
<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() const; |
String toXml(Boolean forceTag) 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. |
@return None | @return None |
<PRE> | <PRE> |
Example: | Example: |
CIMValue value(Boolean(true)); | CIMValue value(Boolean(true)); |
value.print(); // Prints "true" |
value.print(true); // Prints "true" |
</PRE> | </PRE> |
*/ | */ |
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const; |
void print(Boolean forceTag, 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 |
|
|
const CIMValue& x, | const CIMValue& x, |
const CIMValue& y); | const CIMValue& y); |
}; | }; |
|
/** operator == compares two CIMValue objects for equality. |
|
@param x - First CIMvalue to compare |
|
@parm y - Second CIMValue to compare |
|
@return True if they are identical in type, attribute and value. |
|
*/ |
PEGASUS_COMMON_LINKAGE Boolean operator==(const CIMValue& x, const CIMValue& y); | PEGASUS_COMMON_LINKAGE Boolean operator==(const CIMValue& x, const CIMValue& y); |
| |
|
/** operator != compares two CIMValue objects for nonequality |
|
*/ |
inline Boolean operator!=(const CIMValue& x, const CIMValue& y) | inline Boolean operator!=(const CIMValue& x, const CIMValue& y) |
{ | { |
return !operator==(x, y); | return !operator==(x, y); |