version 1.11.2.3, 2001/11/15 20:15:24
|
version 1.51.22.1, 2008/02/29 00:06:07
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
|
// 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 |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_Value_h | #ifndef Pegasus_Value_h |
|
|
#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/CIMObjectPath.h> |
|
#include <Pegasus/Common/CIMObject.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> |
|
#include <Pegasus/Common/Linkage.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
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 |
(see CIMType.h for a list of valid CIM data types). This class |
(see \Ref{CIMType} for a list of valid CIM data types). This class |
encapsulates a union which holds the current value. The class also | encapsulates a union which holds the current value. The class also |
has a type field indicating the type of that value. | has a type field indicating the type of that value. |
*/ | */ |
class PEGASUS_COMMON_LINKAGE CIMValue | class PEGASUS_COMMON_LINKAGE CIMValue |
{ | { |
public: | public: |
/// Constructor |
/** Constructor - Creates an NULL CIMValue object set to null and |
|
with type CIMType:none and !arraytype. |
|
*/ |
CIMValue(); | CIMValue(); |
| |
/// Constructor |
/** Constructor - Creates a NULL CIMValue object with the type and |
CIMValue(Boolean x) { _init(); set(x); } |
array indicator set as specified. |
|
@exception TypeMismatchException If the given type is not valid for a |
|
CIMValue object. |
|
*/ |
|
CIMValue(CIMType type, Boolean isArray, Uint32 arraySize = 0); |
|
|
|
/// Constructor. |
|
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 CIMDateTime& x); |
| |
/// Constructor |
/// Constructor. |
CIMValue(const CIMDateTime& x) { _init(); set(x); } |
CIMValue(const CIMObjectPath& x); |
| |
/// Constructor |
/** Constructor. |
CIMValue(const CIMReference& x) { _init(); set(x); } |
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) { _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<CIMObjectPath>& x); |
|
|
|
/** 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); |
| |
/// Destrustructor |
/// Destructor. |
~CIMValue(); | ~CIMValue(); |
| |
/// Operator = |
/** Operator = |
CIMValue& operator=(const CIMValue& x) |
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 |
assign(x); return *this; |
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); |
| |
/// CIMMethod assign |
/** Assigns one CIMValue object to another CIMValue object. |
|
@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); |
| |
/// CIMMethod clear |
/** Clears the attributes and value of the CIMValue object. |
|
*/ |
void clear(); | void clear(); |
| |
/** CIMMethod typeCompatible - Compares the types of two values. |
/** Compares the types of two CIMValues. This |
@return true if compatible. |
compares the type field and the array indicators. |
|
@return true if both are of the same type and both are either arrays |
|
or not, false otherwise. |
|
<pre> |
|
CIMValue a(Boolean(true); |
|
CIMValue b = a; |
|
if b.typeCompatible(a) |
|
... |
|
</pre> |
*/ | */ |
Boolean typeCompatible(const CIMValue& x) const |
Boolean typeCompatible(const CIMValue& x) const; |
{ |
|
return _type == x._type && _isArray == x._isArray; |
|
} |
|
| |
/** CIMMethod isArray - Determines if the value is an array |
/** Determines if the value is an array. |
@return TRUE if the value is an array |
@return true if the value is an array, false otherwise. |
*/ | */ |
Boolean isArray() const { return _isArray; } |
Boolean isArray() const; |
| |
/** Returns whether the CIMvalue object is null. |
/** Determines whether the CIMvalue object is Null. |
Null is the specific condition where no value has | Null is the specific condition where no value has |
yet been set into the value. |
yet been set. If a CIMValue object is Null, any get on that |
If a CIMValue object is Null, any get on that object |
object will create an exception. |
will create an exception. |
@return true if the CIMValue object is Null, false otherwise. |
@return Returns True if the CIMValue object is Null |
|
*/ | */ |
Boolean isNull() const { return _isNull; } |
Boolean isNull() const; |
| |
/** CIMMethod getArraySize |
/** Gets the size of an Array CIMValue. |
@return The number of entries in the array |
@return The number of entries in the array. |
*/ | */ |
Uint32 getArraySize() const; | Uint32 getArraySize() const; |
| |
CIMType getType() const |
/** Gets the CIMType attribute for the CIMValue. |
{ |
@return the CIMType value. |
return CIMType(_type); |
*/ |
} |
CIMType getType() const; |
| |
/// method setNullvalue - ATTN: |
/** Sets the CIMValue a NULL, but with valid CIMType and array |
|
characteristics. |
|
@param type - CIMType for this CIMValue. |
|
@param isArray - Boolean indicating whether this is an array CIMValue. |
|
@param arraySize - Optional parameter indicating the array size. |
|
<pre> |
|
CIMValue value; |
|
value.setNullValue(CIMType::BOOLEAN, false); |
|
</pre> |
|
*/ |
void setNullValue(CIMType type, Boolean isArray, Uint32 arraySize = 0); | void setNullValue(CIMType type, Boolean isArray, Uint32 arraySize = 0); |
| |
/// method set - ATTN: |
/** Sets the type, Array attribute and puts the value provided |
|
into the value of the target CIMValue. |
|
<pre> |
|
CIMValue x; |
|
x.set(Uint16(9)); |
|
</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); |
| |
/// CIMMethod Set |
/// |
void set(Uint8 x); | void set(Uint8 x); |
|
/// |
void set(Sint8 x); | void set(Sint8 x); |
|
/// |
void set(Uint16 x); | void set(Uint16 x); |
|
/// |
void set(Sint16 x); | void set(Sint16 x); |
|
/// |
void set(Uint32 x); | void set(Uint32 x); |
|
/// |
void set(Sint32 x); | void set(Sint32 x); |
|
/// |
void set(Uint64 x); | void set(Uint64 x); |
|
/// |
void set(Sint64 x); | void set(Sint64 x); |
|
/// |
void set(Real32 x); | void set(Real32 x); |
|
/// |
void set(Real64 x); | void set(Real64 x); |
|
/// |
void set(const Char16& x); | void set(const Char16& x); |
|
/// |
void set(const String& x); | void set(const String& x); |
|
/// |
void set(const char* x); |
|
|
|
void set(const CIMDateTime& x); | void set(const CIMDateTime& x); |
|
/// |
void set(const CIMReference& 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<Sint8>& x); | void set(const Array<Sint8>& x); |
|
/// |
void set(const Array<Uint16>& x); | void set(const Array<Uint16>& x); |
|
/// |
void set(const Array<Sint16>& x); | void set(const Array<Sint16>& x); |
|
/// |
void set(const Array<Uint32>& x); | void set(const Array<Uint32>& x); |
|
/// |
void set(const Array<Sint32>& x); | void set(const Array<Sint32>& x); |
|
/// |
void set(const Array<Uint64>& x); | void set(const Array<Uint64>& x); |
|
/// |
void set(const Array<Sint64>& x); | void set(const Array<Sint64>& x); |
|
/// |
void set(const Array<Real32>& x); | void set(const Array<Real32>& x); |
|
/// |
void set(const Array<Real64>& x); | void set(const Array<Real64>& x); |
|
/// |
void set(const Array<Char16>& x); | void set(const Array<Char16>& x); |
|
/// |
void set(const Array<String>& x); | void set(const Array<String>& x); |
|
/// |
void set(const Array<CIMDateTime>& x); | void set(const Array<CIMDateTime>& x); |
|
/// |
/// CIMMethod get - ATTN |
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. |
|
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. |
|
|
|
The behavior of get is undefined when the value is null. |
|
|
|
@param Variable in which to return the value. |
|
@exception TypeMismatchException If the CIMValue type is not compatible |
|
with the type of the output parameter. |
|
<pre> |
|
Uint32 v; |
|
CIMValue value(CIMValue::UINT32, UINT32(99)); |
|
value.get(v); |
|
</pre> |
|
|
|
<pre> |
|
Uint32 v; |
|
CIMValue value = property.getValue (); |
|
if ((value.getType () == CIMTYPE_UINT32) && (!value.isNull ())) |
|
value.get (v); |
|
</pre> |
|
*/ |
void get(Boolean& x) const; | void get(Boolean& x) const; |
|
/// |
void get(Uint8& x) const; | void get(Uint8& x) const; |
|
/// |
void get(Sint8& x) const; | void get(Sint8& x) const; |
|
/// |
void get(Uint16& x) const; | void get(Uint16& x) const; |
|
/// |
void get(Sint16& x) const; | void get(Sint16& x) const; |
|
/// |
void get(Uint32& x) const; | void get(Uint32& x) const; |
|
/// |
void get(Sint32& x) const; | void get(Sint32& x) const; |
|
/// |
void get(Uint64& x) const; | void get(Uint64& x) const; |
|
/// |
void get(Sint64& x) const; | void get(Sint64& x) const; |
|
/// |
void get(Real32& x) const; | void get(Real32& x) const; |
|
/// |
void get(Real64& x) const; | void get(Real64& x) const; |
|
/// |
void get(Char16& x) const; | void get(Char16& x) const; |
|
/// |
void get(String& x) const; | void get(String& x) const; |
|
/// |
void get(CIMDateTime& x) const; | void get(CIMDateTime& x) const; |
|
/// |
void get(CIMReference& 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<Sint16>& x) const; | void get(Array<Sint16>& x) const; |
|
/// |
void get(Array<Uint32>& x) const; | void get(Array<Uint32>& x) const; |
|
/// |
void get(Array<Sint32>& x) const; | void get(Array<Sint32>& x) const; |
|
/// |
void get(Array<Uint64>& x) const; | void get(Array<Uint64>& x) const; |
|
/// |
void get(Array<Sint64>& x) const; | void get(Array<Sint64>& x) const; |
|
/// |
void get(Array<Real32>& x) const; | void get(Array<Real32>& x) const; |
|
/// |
void get(Array<Real64>& x) const; | void get(Array<Real64>& x) const; |
|
/// |
void get(Array<Char16>& x) const; | void get(Array<Char16>& 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; |
|
/// |
/** toXML - Converts a CIMValue object to XML. |
void get(Array<CIMObjectPath>& x) const; |
@out Sint8 Array to hold the XML representation |
/// |
@return Returns the XML representation of the CIMValue |
void get(Array<CIMObject>& x) const; |
object in the input parameter out. |
/// |
*/ |
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
void toXml(Array<Sint8>& out) const; |
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
void get(Array<CIMInstance>& x) const; |
/** toXML - Converts a CIMValue object to XML. |
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
@return Returns the XML representation of the CIMValue |
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
object in String form. |
|
*/ |
/** Compares with another CIMValue object for equality. |
String toXml() const; |
@param x - CIMValue to compare with. |
|
@return true if they are identical in type, attribute and value, |
/** CIMMethod print - Format and print the Value to std output |
false otherwise. |
stream |
|
@return None |
|
<PRE> |
|
Example: |
|
CIMValue value(Boolean(true)); |
|
value.print(); // Prints "true" |
|
</PRE> |
|
*/ |
|
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const; |
|
|
|
/** toMof - Converts a CIMValueObject to Mof. |
|
@out Sint8 Array to hold the Mof representation |
|
@return Returns the Mof representation of the CIMValue |
|
object in the input parameter out. |
|
*/ | */ |
void toMof(Array<Sint8>& out) const; |
Boolean equal(const CIMValue& x) const; |
| |
|
/** Converts the CIMvalue to a string. Should only be |
/** toString - Converts the CIMvalue to a string. Should only be |
|
used for output purposes. To get an actual String value, use | used for output purposes. To get an actual String value, use |
get(String &). | get(String &). |
@return - String output for CIMValue. |
@return String output for CIMValue. |
<PRE> | <PRE> |
Example: |
|
String test; | String test; |
CIMValue value(Boolean(true)); | CIMValue value(Boolean(true)); |
test = value.toString(); // puts "TRUE" into test | test = value.toString(); // puts "TRUE" into test |
|
|
*/ | */ |
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 _init(); |
void _get(const String*& data, Uint32& size) const; |
| |
CIMType _type; |
CIMValueRep* _rep; |
Boolean _isArray; |
|
Boolean _isNull; |
|
Union _u; |
|
| |
friend class CIMMethodRep; | friend class CIMMethodRep; |
friend class CIMParameterRep; | friend class CIMParameterRep; |
friend class CIMPropertyRep; | friend class CIMPropertyRep; |
friend class CIMQualifierRep; | friend class CIMQualifierRep; |
friend class CIMQualifierDeclRep; | friend class CIMQualifierDeclRep; |
PEGASUS_COMMON_LINKAGE friend Boolean operator==( |
friend class BinaryStreamer; |
const CIMValue& x, |
friend class XmlWriter; |
const CIMValue& y); |
friend class SoapWriter; |
}; | }; |
| |
|
/** operator == compares two CIMValue objects for equality. |
|
@param x - First CIMValue to compare |
|
@param y - Second CIMValue to compare |
|
@return true if they are identical in type, attribute and value, |
|
false otherwise. |
|
*/ |
PEGASUS_COMMON_LINKAGE Boolean operator==(const CIMValue& x, const CIMValue& y); | PEGASUS_COMMON_LINKAGE Boolean operator==(const CIMValue& x, const CIMValue& y); |
| |
inline Boolean operator!=(const CIMValue& x, const CIMValue& y) |
/** operator != compares two CIMValue objects for inequality. |
{ |
@param x - First CIMValue to compare |
return !operator==(x, y); |
@param y - Second CIMValue to compare |
} |
@return true if they are NOT identical in type, attribute or value, |
|
false otherwise. |
|
*/ |
|
PEGASUS_COMMON_LINKAGE Boolean operator!=(const CIMValue& x, const CIMValue& y); |
| |
#define PEGASUS_ARRAY_T CIMValue | #define PEGASUS_ARRAY_T CIMValue |
# include "ArrayInter.h" |
# include <Pegasus/Common/ArrayInter.h> |
#undef PEGASUS_ARRAY_T | #undef PEGASUS_ARRAY_T |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
|
#ifdef PEGASUS_INTERNALONLY |
|
#include <Pegasus/Common/CIMValueInline.h> |
|
#endif |
|
|
#endif /* Pegasus_Value_h */ | #endif /* Pegasus_Value_h */ |