CIMInstance.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_Instance_h
33 #define Pegasus_Instance_h
34 
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Linkage.h>
37 #include <Pegasus/Common/CIMName.h>
38 #include <Pegasus/Common/CIMObject.h>
39 #include <Pegasus/Common/CIMPropertyList.h>
40 
41 PEGASUS_NAMESPACE_BEGIN
42 
44 //
45 // CIMInstance
46 //
48 
49 class CIMConstInstance;
50 class CIMInstanceRep;
51 class Resolver;
52 
64 class PEGASUS_COMMON_LINKAGE CIMInstance
65 {
66 public:
67 
75  CIMInstance();
76 
83  CIMInstance(const CIMInstance& x);
84 
93  explicit CIMInstance(const CIMObject& x);
94 
99  CIMInstance(const CIMName& className);
100 
108  CIMInstance& operator=(const CIMInstance& x);
109 
113  ~CIMInstance();
114 
121  const CIMName& getClassName() const;
122 
129  const CIMObjectPath& getPath() const;
130 
137  void setPath (const CIMObjectPath & path);
138 
148  CIMInstance& addQualifier(const CIMQualifier& qualifier);
149 
157  Uint32 findQualifier(const CIMName& name) const;
158 
168  CIMQualifier getQualifier(Uint32 index);
169 
179  CIMConstQualifier getQualifier(Uint32 index) const;
180 
189  void removeQualifier(Uint32 index);
190 
197  Uint32 getQualifierCount() const;
198 
208  CIMInstance& addProperty(const CIMProperty& x);
209 
217  Uint32 findProperty(const CIMName& name) const;
218 
228  CIMProperty getProperty(Uint32 index);
229 
239  CIMConstProperty getProperty(Uint32 index) const;
240 
249  void removeProperty(Uint32 index);
250 
257  Uint32 getPropertyCount() const;
258 
270  CIMObjectPath buildPath(const CIMConstClass& cimClass) const;
271 
279  CIMInstance clone() const;
280 
289  Boolean identical(const CIMConstInstance& x) const;
290 
295  Boolean isUninitialized() const;
296 
297 #ifdef PEGASUS_USE_DEPRECATED_INTERFACES
298 
299 // This function has been deprecated. Property filtering is now done by the
300 // CIMOM infrastructure.
301  void filter(
302  Boolean includeQualifiers,
303  Boolean includeClassOrigin,
304  const CIMPropertyList & propertyList);
305 #endif
306 
332 void instanceFilter(
333  Boolean includeQualifiers,
334  Boolean includeClassOrigin,
335  const CIMPropertyList & propertyList);
336 
337 private:
338 
339  CIMInstanceRep* _rep;
340 
341  CIMInstance(CIMInstanceRep* rep);
342 
343  friend class CIMConstInstance;
344  friend class CIMObject;
345  friend class CIMConstObject;
346  friend class Resolver;
347  friend class XmlWriter;
348  friend class MofWriter;
349  friend class BinaryStreamer;
350  friend class CIMClassRep;
351  friend class SCMOInstance;
352  friend class SCMOClass;
353 };
354 
356 //
357 // CIMConstInstance
358 //
360 
368 class PEGASUS_COMMON_LINKAGE CIMConstInstance
369 {
370 public:
371 
380 
389 
397  CIMConstInstance(const CIMInstance& x);
398 
407  explicit CIMConstInstance(const CIMObject& x);
408 
418  explicit CIMConstInstance(const CIMConstObject& x);
419 
424  CIMConstInstance(const CIMName& className);
425 
433  CIMConstInstance& operator=(const CIMConstInstance& x);
434 
442  CIMConstInstance& operator=(const CIMInstance& x);
443 
447  ~CIMConstInstance();
448 
455  const CIMName& getClassName() const;
456 
463  const CIMObjectPath& getPath() const;
464 
472  Uint32 findQualifier(const CIMName& name) const;
473 
483  CIMConstQualifier getQualifier(Uint32 index) const;
484 
491  Uint32 getQualifierCount() const;
492 
500  Uint32 findProperty(const CIMName& name) const;
501 
511  CIMConstProperty getProperty(Uint32 index) const;
512 
519  Uint32 getPropertyCount() const;
520 
532  CIMObjectPath buildPath(const CIMConstClass& cimClass) const;
533 
542  CIMInstance clone() const;
543 
552  Boolean identical(const CIMConstInstance& x) const;
553 
558  Boolean isUninitialized() const;
559 
560 private:
561 
562  CIMInstanceRep* _rep;
563 
564  friend class CIMInstance;
565  friend class CIMObject;
566  friend class CIMConstObject;
567  friend class XmlWriter;
568  friend class MofWriter;
569  friend class BinaryStreamer;
570  friend class SCMOInstance;
571 };
572 
573 #define PEGASUS_ARRAY_T CIMInstance
574 # include <Pegasus/Common/ArrayInter.h>
575 #undef PEGASUS_ARRAY_T
576 
577 PEGASUS_NAMESPACE_END
578 
579 #endif /* Pegasus_Instance_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: CIMQualifier.h:68
Definition: CIMPropertyList.h:61
Definition: CIMName.h:64
Definition: CIMInstance.h:368
Definition: CIMObject.h:75
Definition: CIMObject.h:376