(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.12 and 1.17

version 1.12, 2001/12/13 14:53:56 version 1.17, 2002/03/24 13:33:07
Line 22 
Line 22 
 // //
 // Author: Mike Brasher (mbrasher@bmc.com) // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // Modified By:  // Modified By: Karl schopmeyer (k.schopmeyer@opengroup.org)
   //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 47 
Line 48 
 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
Line 141 
Line 155 
     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 =
Line 152 
Line 169 
         assign(x); return *this;         assign(x); return *this;
     }     }
  
     /// CIMMethod assign      /** assign - The method to assign one CIMValue object to another CIMValue
       object.
   
       */
     void assign(const CIMValue& x);     void assign(const CIMValue& x);
  
     /// CIMMethod clear      /** clear - Clears the attributes and value of the CIMValue object.
       <pre>
       ATTNDOC:
       </pre>
       */
     void clear();     void clear();
  
     /** CIMMethod typeCompatible - Compares the types of two values.      /** typeCompatible - 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. Else returns false.
           <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;         return _type == x._type && _isArray == x._isArray;
     }     }
  
     /** CIMMethod 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 { return _isArray; }
  
     /** 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
         yet been set into the value.         yet been set into the value.
         If a CIMValue object is Null, any get on that object         If a CIMValue object is Null, any get on that object
Line 180 
Line 212 
     */     */
     Boolean isNull() const { return _isNull; }     Boolean isNull() const { return _isNull; }
  
     /** CIMMethod getArraySize      /** getArraySize = Returns 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;
  
       /** getType - Gets the CIMType attribute for the CIMValue.
           The CIMType is defined in ATTN:
           @return Returns the CIMType value
       */
     CIMType getType() const     CIMType getType() const
     {     {
         return CIMType(_type);         return CIMType(_type);
     }     }
  
     /// method setNullvalue - ATTN:      /** setNullvalue - Sets the CIMType, the Array indicator and if it is
           the arraytype, the Arraysize of a CIMValue and sets the isNull
           Attribute.  This function is used to set up CIMValues an NULL but
           with valid CIMType and array characteristics (ex. when update from
           XML)
           @param type - The CIMType for this CIMValue
           @paramisArray - Boolean indicating whether this is an array CIMValue
           @param arraySize (optional)  Uint32parameter indicating the array
           size
           @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);
  
     /// method set - ATTN:      /** set - Sets the type, Array attribute and puts the value provided
           into the value of the target CIMValue. This function sets the
           CIMValue to nonNull also. The result is a complete CIMValue object
           All of the CIMTypes defined in ATTN: and the Array types defined in
           ATTN: may be set.
           @param x Typed value (ex. Boolean(true).
           @return void
           <pre>
               CIMValue x;
               x.set(Uint16(9));
           </pre>
       */
     void set(Boolean x);     void set(Boolean x);
  
     /// CIMMethod Set      /// 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 char* x);
       ///
     void set(const CIMDateTime& x);     void set(const CIMDateTime& x);
       ///
     void set(const CIMReference& x);     void set(const CIMReference& x);
       ///
     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);
       ///
       void set(const Array<CIMReference>& x);
  
     /// CIMMethod get - ATTN      /** get - Gets the value of a CIMValue
           @param Variable in which we return the value:
           @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(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(CIMReference& x) const;
       ///
     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;
       ///
       void get(Array<CIMReference>& x) const;
  
     /** toXML - Converts a CIMValue object to XML.      /** toXML - Converts a CIMValue object to XML. The XML is appended
         @out Sint8 Array to hold the XML representation          to the Array provided with the call.  Returns the result as an
           XML element wrapped in the <VALUE>, <VALUE.ARRAY>, <VALUE.REFERENCE>,
           or <VALUE.REFARRAY> tags. If the CIMValue is Null, no element is
           returned.
           @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) const;      void toXml(Array<Sint8>& out, Boolean forceTag) const;
  
     /** toXML - Converts a CIMValue object to XML.      /** toXML - Converts a CIMValue object to XML. There is no input
           parameter and the result is returned as a String rather
           than appended to an 8-bit array as above.  Returns 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.
           @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 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
Line 345 
Line 434 
     */     */
     void toMof(Array<Sint8>& out) const;     void toMof(Array<Sint8>& out) const;
  
   
     /** toString - 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.
           @exception - Throws exception CIMValueInvalidType if the CIMValue
               has an invalid type. Normally this is a Pegasus internal error.
         <PRE>         <PRE>
         Example:         Example:
             String test;             String test;
Line 377 
Line 467 
         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);


Legend:
Removed from v.1.12  
changed lines
  Added in v.1.17

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2