(file) Return to CIMValue.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMValue.h between version 1.14 and 1.20

version 1.14, 2002/02/20 23:14:19 version 1.20, 2002/05/14 05:10:33
Line 33 
Line 33 
 #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
Line 48 
Line 51 
 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
     CIMValue(Boolean x) { _init(); set(x); }          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);
  
     /// 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);
Line 151 
Line 167 
     ~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);
  
Line 180 
Line 192 
                 ...                 ...
         </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
Line 197 
Line 206 
         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
Line 208 
Line 217 
         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
Line 223 
Line 229 
         @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).
Line 302 
Line 312 
     void set(const Array<CIMReference>& 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;
     ///     ///
Line 365 
Line 380 
     ///     ///
     void get(Array<CIMReference>& x) const;     void get(Array<CIMReference>& x) const;
  
       /** Makes a deep copy (clone) of the given object. */
       CIMValue clone() 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 element wrapped in the <VALUE>, <VALUE.ARRAY>, <VALUE.REFERENCE>,         XML element wrapped in the <VALUE>, <VALUE.ARRAY>, <VALUE.REFERENCE>,
Line 389 
Line 407 
  
     /** 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 o Stream to output to. Defaults to cout.
         @return None         @return None
         <PRE>         <PRE>
         Example:         Example:
Line 422 
Line 441 
  
 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;
Line 439 
Line 453 
         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);
  
 inline Boolean operator!=(const CIMValue& x, const CIMValue& y)  /** operator != compares two CIMValue objects for nonequality
 {  */
     return !operator==(x, y);  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 "ArrayInter.h"


Legend:
Removed from v.1.14  
changed lines
  Added in v.1.20

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2