• Main Page
  • Classes
  • Files
  • File List

/builddir/build/BUILD/pegasus/src/Pegasus/Common/CIMValue.h

00001 //%LICENSE////////////////////////////////////////////////////////////////
00002 //
00003 // Licensed to The Open Group (TOG) under one or more contributor license
00004 // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
00005 // this work for additional information regarding copyright ownership.
00006 // Each contributor licenses this file to you under the OpenPegasus Open
00007 // Source License; you may not use this file except in compliance with the
00008 // License.
00009 //
00010 // Permission is hereby granted, free of charge, to any person obtaining a
00011 // copy of this software and associated documentation files (the "Software"),
00012 // to deal in the Software without restriction, including without limitation
00013 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00014 // and/or sell copies of the Software, and to permit persons to whom the
00015 // Software is furnished to do so, subject to the following conditions:
00016 //
00017 // The above copyright notice and this permission notice shall be included
00018 // in all copies or substantial portions of the Software.
00019 //
00020 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00024 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00025 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00026 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00027 //
00029 //
00030 //%/////////////////////////////////////////////////////////////////////////////
00031 
00032 #ifndef Pegasus_Value_h
00033 #define Pegasus_Value_h
00034 
00035 #include <Pegasus/Common/String.h>
00036 #include <Pegasus/Common/Config.h>
00037 #include <Pegasus/Common/CIMType.h>
00038 #include <Pegasus/Common/CIMObjectPath.h>
00039 #include <Pegasus/Common/CIMObject.h>
00040 #include <Pegasus/Common/CIMDateTime.h>
00041 #include <Pegasus/Common/Exception.h>
00042 #include <Pegasus/Common/Array.h>
00043 #include <Pegasus/Common/Linkage.h>
00044 
00045 PEGASUS_NAMESPACE_BEGIN
00046 
00047 class CIMValueRep;
00048 class CIMObject;
00049 class CIMInstance;
00050 
00063 class PEGASUS_COMMON_LINKAGE CIMValue
00064 {
00065 public:
00069     CIMValue();
00070 
00080     CIMValue(CIMType type, Boolean isArray, Uint32 arraySize = 0);
00081 
00086     CIMValue(Boolean x);
00087 
00092     CIMValue(Uint8 x);
00093 
00098     CIMValue(Sint8 x);
00099 
00104     CIMValue(Uint16 x);
00105 
00110     CIMValue(Sint16 x);
00111 
00116     CIMValue(Uint32 x);
00117 
00122     CIMValue(Sint32 x);
00123 
00128     CIMValue(Uint64 x);
00129 
00134     CIMValue(Sint64 x);
00135 
00140     CIMValue(Real32 x);
00141 
00146     CIMValue(Real64 x);
00147 
00152     CIMValue(const Char16& x);
00153 
00158     CIMValue(const String& x);
00159 
00164     CIMValue(const CIMDateTime& x);
00165 
00170     CIMValue(const CIMObjectPath& x);
00171 
00180     CIMValue(const CIMObject& x);
00181 
00190     CIMValue(const CIMInstance& x);
00191 
00196     CIMValue(const Array<Boolean>& x);
00197 
00202     CIMValue(const Array<Uint8>& x);
00203 
00208     CIMValue(const Array<Sint8>& x);
00209 
00214     CIMValue(const Array<Uint16>& x);
00215 
00220     CIMValue(const Array<Sint16>& x);
00221 
00226     CIMValue(const Array<Uint32>& x);
00227 
00232     CIMValue(const Array<Sint32>& x);
00233 
00238     CIMValue(const Array<Uint64>& x);
00239 
00244     CIMValue(const Array<Sint64>& x);
00245 
00250     CIMValue(const Array<Real32>& x);
00251 
00256     CIMValue(const Array<Real64>& x);
00257 
00262     CIMValue(const Array<Char16>& x);
00263 
00268     CIMValue(const Array<String>& x);
00269 
00274     CIMValue(const Array<CIMDateTime>& x);
00275 
00280     CIMValue(const Array<CIMObjectPath>& x);
00281 
00290     CIMValue(const Array<CIMObject>& x);
00291 
00300     CIMValue(const Array<CIMInstance>& x);
00301 
00309     CIMValue(const CIMValue& x);
00310 
00314     ~CIMValue();
00315 
00324     CIMValue& operator=(const CIMValue& x);
00325 
00333     void assign(const CIMValue& x);
00334 
00338     void clear();
00339 
00346     Boolean typeCompatible(const CIMValue& x) const;
00347 
00352     Boolean isArray() const;
00353 
00359     Boolean isNull() const;
00360 
00367     Uint32 getArraySize() const;
00368 
00373     CIMType getType() const;
00374 
00383     void setNullValue(CIMType type, Boolean isArray, Uint32 arraySize = 0);
00384 
00389     void set(Boolean x);
00390 
00395     void set(Uint8 x);
00396 
00401     void set(Sint8 x);
00402 
00407     void set(Uint16 x);
00408 
00413     void set(Sint16 x);
00414 
00419     void set(Uint32 x);
00420 
00425     void set(Sint32 x);
00426 
00431     void set(Uint64 x);
00432 
00437     void set(Sint64 x);
00438 
00443     void set(Real32 x);
00444 
00449     void set(Real64 x);
00450 
00455     void set(const Char16& x);
00456 
00461     void set(const String& x);
00462 
00467     void set(const CIMDateTime& x);
00468 
00473     void set(const CIMObjectPath& x);
00474 
00483     void set(const CIMObject& x);
00484 
00493     void set(const CIMInstance& x);
00494 
00499     void set(const Array<Boolean>& x);
00500 
00505     void set(const Array<Uint8>& x);
00506 
00511     void set(const Array<Sint8>& x);
00512 
00517     void set(const Array<Uint16>& x);
00518 
00523     void set(const Array<Sint16>& x);
00524 
00529     void set(const Array<Uint32>& x);
00530 
00535     void set(const Array<Sint32>& x);
00536 
00541     void set(const Array<Uint64>& x);
00542 
00547     void set(const Array<Sint64>& x);
00548 
00553     void set(const Array<Real32>& x);
00554 
00559     void set(const Array<Real64>& x);
00560 
00565     void set(const Array<Char16>& x);
00566 
00571     void set(const Array<String>& x);
00572 
00577     void set(const Array<CIMDateTime>& x);
00578 
00583     void set(const Array<CIMObjectPath>& x);
00584 
00593     void set(const Array<CIMObject>& x);
00594 
00603     void set(const Array<CIMInstance>& x);
00604 
00629     void get(Boolean& x) const;
00630 
00642     void get(Uint8& x) const;
00643 
00654     void get(Sint8& x) const;
00655 
00666     void get(Uint16& x) const;
00667 
00678     void get(Sint16& x) const;
00679 
00696     void get(Uint32& x) const;
00697 
00708     void get(Sint32& x) const;
00709 
00720     void get(Uint64& x) const;
00721 
00732     void get(Sint64& x) const;
00733 
00744     void get(Real32& x) const;
00745 
00756     void get(Real64& x) const;
00757 
00768     void get(Char16& x) const;
00769 
00780     void get(String& x) const;
00781 
00792     void get(CIMDateTime& x) const;
00793 
00804     void get(CIMObjectPath& x) const;
00805 
00816     void get(CIMObject& x) const;
00817 
00828     void get(CIMInstance& x) const;
00829 
00840     void get(Array<Boolean>& x) const;
00841 
00852     void get(Array<Uint8>& x) const;
00853 
00864     void get(Array<Sint8>& x) const;
00865 
00876     void get(Array<Uint16>& x) const;
00877 
00888     void get(Array<Sint16>& x) const;
00889 
00900     void get(Array<Uint32>& x) const;
00901 
00912     void get(Array<Sint32>& x) const;
00913 
00924     void get(Array<Uint64>& x) const;
00925 
00936     void get(Array<Sint64>& x) const;
00937 
00948     void get(Array<Real32>& x) const;
00949 
00960     void get(Array<Real64>& x) const;
00961 
00972     void get(Array<Char16>& x) const;
00973 
00984     void get(Array<String>& x) const;
00985 
00996     void get(Array<CIMDateTime>& x) const;
00997 
01008     void get(Array<CIMObjectPath>& x) const;
01009 
01020     void get(Array<CIMObject>& x) const;
01021 
01032     void get(Array<CIMInstance>& x) const;
01033 
01040     Boolean equal(const CIMValue& x) const;
01041 
01048     String toString() const;
01049 
01050 #ifdef PEGASUS_USE_DEPRECATED_INTERFACES
01051 
01058     CIMValue(char x);
01059 
01067     CIMValue(const Array<char>& x);
01068 
01076     void set(char x);
01077 
01085     void set(const Array<char>& x);
01086 
01096     void get(char& x) const;
01097 
01108     void get(Array<char>& x) const;
01109 #endif
01110 
01111 private:
01112 
01113     void _get(const String*& data, Uint32& size) const;
01114 
01115     CIMValueRep* _rep;
01116 
01117     friend class CIMMethodRep;
01118     friend class CIMParameterRep;
01119     friend class CIMPropertyRep;
01120     friend class CIMQualifierRep;
01121     friend class CIMQualifierDeclRep;
01122     friend class BinaryStreamer;
01123     friend class XmlWriter;
01124     friend class SCMOClass;
01125     friend class SCMOInstance;
01126 };
01127 
01135 PEGASUS_COMMON_LINKAGE Boolean operator==(const CIMValue& x, const CIMValue& y);
01136 
01144 PEGASUS_COMMON_LINKAGE Boolean operator!=(const CIMValue& x, const CIMValue& y);
01145 
01146 #define PEGASUS_ARRAY_T CIMValue
01147 # include <Pegasus/Common/ArrayInter.h>
01148 #undef PEGASUS_ARRAY_T
01149 
01150 PEGASUS_NAMESPACE_END
01151 
01152 #ifdef PEGASUS_INTERNALONLY
01153 #include <Pegasus/Common/CIMValueInline.h>
01154 #endif
01155 
01156 #endif /* Pegasus_Value_h */