CIMValue.h
1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31 
32 #ifndef Pegasus_Value_h
33 #define Pegasus_Value_h
34 
35 #include <Pegasus/Common/String.h>
36 #include <Pegasus/Common/Config.h>
37 #include <Pegasus/Common/CIMType.h>
38 #include <Pegasus/Common/CIMObjectPath.h>
39 #include <Pegasus/Common/CIMObject.h>
40 #include <Pegasus/Common/CIMDateTime.h>
41 #include <Pegasus/Common/Exception.h>
42 #include <Pegasus/Common/Array.h>
43 #include <Pegasus/Common/Linkage.h>
44 
45 PEGASUS_NAMESPACE_BEGIN
46 
47 class CIMValueRep;
48 class CIMObject;
49 class CIMInstance;
50 
63 class PEGASUS_COMMON_LINKAGE CIMValue
64 {
65 public:
69  CIMValue();
70 
80  CIMValue(CIMType type, Boolean isArray, Uint32 arraySize = 0);
81 
86  CIMValue(Boolean x);
87 
92  CIMValue(Uint8 x);
93 
98  CIMValue(Sint8 x);
99 
104  CIMValue(Uint16 x);
105 
110  CIMValue(Sint16 x);
111 
116  CIMValue(Uint32 x);
117 
122  CIMValue(Sint32 x);
123 
128  CIMValue(Uint64 x);
129 
134  CIMValue(Sint64 x);
135 
140  CIMValue(Real32 x);
141 
146  CIMValue(Real64 x);
147 
152  CIMValue(const Char16& x);
153 
158  CIMValue(const String& x);
159 
164  CIMValue(const CIMDateTime& x);
165 
170  CIMValue(const CIMObjectPath& x);
171 
180  CIMValue(const CIMObject& x);
181 
190  CIMValue(const CIMInstance& x);
191 
196  CIMValue(const Array<Boolean>& x);
197 
202  CIMValue(const Array<Uint8>& x);
203 
208  CIMValue(const Array<Sint8>& x);
209 
214  CIMValue(const Array<Uint16>& x);
215 
220  CIMValue(const Array<Sint16>& x);
221 
226  CIMValue(const Array<Uint32>& x);
227 
232  CIMValue(const Array<Sint32>& x);
233 
238  CIMValue(const Array<Uint64>& x);
239 
244  CIMValue(const Array<Sint64>& x);
245 
250  CIMValue(const Array<Real32>& x);
251 
256  CIMValue(const Array<Real64>& x);
257 
262  CIMValue(const Array<Char16>& x);
263 
268  CIMValue(const Array<String>& x);
269 
274  CIMValue(const Array<CIMDateTime>& x);
275 
280  CIMValue(const Array<CIMObjectPath>& x);
281 
290  CIMValue(const Array<CIMObject>& x);
291 
300  CIMValue(const Array<CIMInstance>& x);
301 
309  CIMValue(const CIMValue& x);
310 
314  ~CIMValue();
315 
324  CIMValue& operator=(const CIMValue& x);
325 
333  void assign(const CIMValue& x);
334 
338  void clear();
339 
346  Boolean typeCompatible(const CIMValue& x) const;
347 
352  Boolean isArray() const;
353 
359  Boolean isNull() const;
360 
367  Uint32 getArraySize() const;
368 
373  CIMType getType() const;
374 
383  void setNullValue(CIMType type, Boolean isArray, Uint32 arraySize = 0);
384 
389  void set(Boolean x);
390 
395  void set(Uint8 x);
396 
401  void set(Sint8 x);
402 
407  void set(Uint16 x);
408 
413  void set(Sint16 x);
414 
419  void set(Uint32 x);
420 
425  void set(Sint32 x);
426 
431  void set(Uint64 x);
432 
437  void set(Sint64 x);
438 
443  void set(Real32 x);
444 
449  void set(Real64 x);
450 
455  void set(const Char16& x);
456 
461  void set(const String& x);
462 
467  void set(const CIMDateTime& x);
468 
473  void set(const CIMObjectPath& x);
474 
483  void set(const CIMObject& x);
484 
493  void set(const CIMInstance& x);
494 
499  void set(const Array<Boolean>& x);
500 
505  void set(const Array<Uint8>& x);
506 
511  void set(const Array<Sint8>& x);
512 
517  void set(const Array<Uint16>& x);
518 
523  void set(const Array<Sint16>& x);
524 
529  void set(const Array<Uint32>& x);
530 
535  void set(const Array<Sint32>& x);
536 
541  void set(const Array<Uint64>& x);
542 
547  void set(const Array<Sint64>& x);
548 
553  void set(const Array<Real32>& x);
554 
559  void set(const Array<Real64>& x);
560 
565  void set(const Array<Char16>& x);
566 
571  void set(const Array<String>& x);
572 
577  void set(const Array<CIMDateTime>& x);
578 
583  void set(const Array<CIMObjectPath>& x);
584 
593  void set(const Array<CIMObject>& x);
594 
603  void set(const Array<CIMInstance>& x);
604 
629  void get(Boolean& x) const;
630 
642  void get(Uint8& x) const;
643 
654  void get(Sint8& x) const;
655 
666  void get(Uint16& x) const;
667 
678  void get(Sint16& x) const;
679 
696  void get(Uint32& x) const;
697 
708  void get(Sint32& x) const;
709 
720  void get(Uint64& x) const;
721 
732  void get(Sint64& x) const;
733 
744  void get(Real32& x) const;
745 
756  void get(Real64& x) const;
757 
768  void get(Char16& x) const;
769 
780  void get(String& x) const;
781 
792  void get(CIMDateTime& x) const;
793 
804  void get(CIMObjectPath& x) const;
805 
816  void get(CIMObject& x) const;
817 
828  void get(CIMInstance& x) const;
829 
840  void get(Array<Boolean>& x) const;
841 
852  void get(Array<Uint8>& x) const;
853 
864  void get(Array<Sint8>& x) const;
865 
876  void get(Array<Uint16>& x) const;
877 
888  void get(Array<Sint16>& x) const;
889 
900  void get(Array<Uint32>& x) const;
901 
912  void get(Array<Sint32>& x) const;
913 
924  void get(Array<Uint64>& x) const;
925 
936  void get(Array<Sint64>& x) const;
937 
948  void get(Array<Real32>& x) const;
949 
960  void get(Array<Real64>& x) const;
961 
972  void get(Array<Char16>& x) const;
973 
984  void get(Array<String>& x) const;
985 
996  void get(Array<CIMDateTime>& x) const;
997 
1008  void get(Array<CIMObjectPath>& x) const;
1009 
1020  void get(Array<CIMObject>& x) const;
1021 
1032  void get(Array<CIMInstance>& x) const;
1033 
1040  Boolean equal(const CIMValue& x) const;
1041 
1048  String toString() const;
1049 
1050 #ifdef PEGASUS_USE_DEPRECATED_INTERFACES
1051 
1058  CIMValue(char x);
1059 
1067  CIMValue(const Array<char>& x);
1068 
1076  void set(char x);
1077 
1085  void set(const Array<char>& x);
1086 
1096  void get(char& x) const;
1097 
1108  void get(Array<char>& x) const;
1109 #endif
1110 
1111 private:
1112 
1113  void _get(const String*& data, Uint32& size) const;
1114 
1115  CIMValueRep* _rep;
1116 
1117  friend class CIMMethodRep;
1118  friend class CIMParameterRep;
1119  friend class CIMPropertyRep;
1120  friend class CIMQualifierRep;
1121  friend class CIMQualifierDeclRep;
1122  friend class BinaryStreamer;
1123  friend class XmlWriter;
1124  friend class SCMOClass;
1125  friend class SCMOInstance;
1126 };
1127 
1135 PEGASUS_COMMON_LINKAGE Boolean operator==(const CIMValue& x, const CIMValue& y);
1136 
1144 PEGASUS_COMMON_LINKAGE Boolean operator!=(const CIMValue& x, const CIMValue& y);
1145 
1146 #define PEGASUS_ARRAY_T CIMValue
1147 # include <Pegasus/Common/ArrayInter.h>
1148 #undef PEGASUS_ARRAY_T
1149 
1150 PEGASUS_NAMESPACE_END
1151 
1152 #ifdef PEGASUS_INTERNALONLY
1153 #include <Pegasus/Common/CIMValueInline.h>
1154 #endif
1155 
1156 #endif /* Pegasus_Value_h */
Definition: CIMObjectPath.h:388
Definition: CIMInstance.h:64
Definition: CIMValue.h:63
Definition: String.h:119
Definition: ArrayInter.h:44
Definition: CIMObject.h:75
Definition: CIMDateTime.h:119
Definition: Char16.h:47