CIMObject.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_Object_h
33 #define Pegasus_Object_h
34 
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Linkage.h>
37 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/CIMName.h>
39 #include <Pegasus/Common/Array.h>
40 #include <Pegasus/Common/CIMProperty.h>
41 #include <Pegasus/Common/CIMQualifier.h>
42 #include <Pegasus/Common/CIMPropertyList.h>
43 
44 PEGASUS_NAMESPACE_BEGIN
45 
46 class CIMConstObject;
47 class CIMObjectRep;
48 class CIMClass;
49 class CIMConstClass;
50 class CIMInstance;
51 class CIMConstInstance;
52 class CIMProperty;
53 class CIMConstProperty;
54 class CIMQualifier;
55 class CIMConstQualifier;
56 
58 //
59 // CIMObject
60 //
62 
75 class PEGASUS_COMMON_LINKAGE CIMObject
76 {
77 public:
78 
86  CIMObject();
87 
94  CIMObject(const CIMObject& x);
95 
102  CIMObject(const CIMClass& x);
103 
110  CIMObject(const CIMInstance& x);
111 
119  CIMObject& operator=(const CIMObject& x);
120 
124  ~CIMObject();
125 
132  const CIMName& getClassName() const;
133 
140  const CIMObjectPath& getPath() const;
141 
148  void setPath (const CIMObjectPath & path);
149 
159  CIMObject& addQualifier(const CIMQualifier& qualifier);
160 
168  Uint32 findQualifier(const CIMName& name) const;
169 
179  CIMQualifier getQualifier(Uint32 index);
180 
190  CIMConstQualifier getQualifier(Uint32 index) const;
191 
200  void removeQualifier(Uint32 index);
201 
208  Uint32 getQualifierCount() const;
209 
219  CIMObject& addProperty(const CIMProperty& x);
220 
228  Uint32 findProperty(const CIMName& name) const;
229 
239  CIMProperty getProperty(Uint32 index);
240 
250  CIMConstProperty getProperty(Uint32 index) const;
251 
260  void removeProperty(Uint32 index);
261 
268  Uint32 getPropertyCount() const;
269 
277  CIMObject clone() const;
278 
287  Boolean identical(const CIMConstObject& x) const;
288 
293  Boolean isUninitialized() const;
294 
303  String toString() const;
304 
309  Boolean isClass() const;
310 
315  Boolean isInstance() const;
316 
340  void instanceFilter(
341  Boolean includeQualifiers,
342  Boolean includeClassOrigin,
343  const CIMPropertyList & propertyList);
344 
345 private:
346 
347  CIMObjectRep* _rep;
348 
349  CIMObject(CIMObjectRep* rep);
350 
351  friend class CIMConstObject;
352  friend class CIMClass;
353  friend class CIMConstClass;
354  friend class CIMInstance;
355  friend class CIMConstInstance;
356 };
357 
358 #define PEGASUS_ARRAY_T CIMObject
359 # include <Pegasus/Common/ArrayInter.h>
360 #undef PEGASUS_ARRAY_T
361 
362 
364 //
365 // CIMConstObject
366 //
368 
376 class PEGASUS_COMMON_LINKAGE CIMConstObject
377 {
378 public:
379 
387  CIMConstObject();
388 
396  CIMConstObject(const CIMConstObject& x);
397 
404  CIMConstObject(const CIMObject& x);
405 
412  CIMConstObject(const CIMClass& x);
413 
420  CIMConstObject(const CIMInstance& x);
421 
428  CIMConstObject(const CIMConstClass& x);
429 
438 
446  CIMConstObject& operator=(const CIMConstObject& x);
447 
451  ~CIMConstObject();
452 
459  const CIMName& getClassName() const;
460 
467  const CIMObjectPath& getPath() const;
468 
476  Uint32 findQualifier(const CIMName& name) const;
477 
487  CIMConstQualifier getQualifier(Uint32 index) const;
488 
495  Uint32 getQualifierCount() const;
496 
504  Uint32 findProperty(const CIMName& name) const;
505 
515  CIMConstProperty getProperty(Uint32 index) const;
516 
523  Uint32 getPropertyCount() const;
524 
533  CIMObject clone() const;
534 
543  Boolean identical(const CIMConstObject& x) const;
544 
549  Boolean isUninitialized() const;
550 
559  String toString () const;
560 
565  Boolean isClass() const;
566 
572  Boolean isInstance() const;
573 
574 private:
575 
576  CIMObjectRep* _rep;
577 
578  friend class CIMObject;
579  friend class CIMClass;
580  friend class CIMConstClass;
581  friend class CIMInstance;
582  friend class CIMConstInstance;
583 };
584 
585 PEGASUS_NAMESPACE_END
586 
587 #endif /* Pegasus_Object_h */
Definition: CIMProperty.h:100
Definition: CIMProperty.h:396
Definition: CIMObjectPath.h:388
Definition: CIMInstance.h:64
Definition: CIMQualifier.h:273
Definition: CIMClass.h:482
Definition: String.h:119
Definition: CIMQualifier.h:68
Definition: CIMPropertyList.h:61
Definition: CIMName.h:64
Definition: CIMClass.h:61
Definition: CIMInstance.h:368
Definition: CIMObject.h:75
Definition: CIMObject.h:376