1 karl 1.28 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.1 //
|
3 karl 1.23 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.21 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.23 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.26 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.28 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 chip 1.2 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
18 mike 1.1 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 kumpf 1.16 //
|
21 chip 1.2 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.1 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
24 chip 1.2 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
27 mike 1.1 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_CIMObjectRep_h
35 #define Pegasus_CIMObjectRep_h
36
37 #include <Pegasus/Common/Config.h>
|
38 kumpf 1.19 #include <Pegasus/Common/Linkage.h>
|
39 mike 1.1 #include <Pegasus/Common/String.h>
|
40 kumpf 1.10 #include <Pegasus/Common/Sharable.h>
|
41 kumpf 1.19 #include <Pegasus/Common/CIMName.h>
|
42 mike 1.1 #include <Pegasus/Common/CIMProperty.h>
43 #include <Pegasus/Common/CIMQualifier.h>
|
44 kumpf 1.8 #include <Pegasus/Common/CIMQualifierList.h>
|
45 mike 1.1 #include <Pegasus/Common/Array.h>
|
46 marek 1.32 #include <Pegasus/Common/OrderedSet.h>
47 #include <Pegasus/Common/CIMPropertyRep.h>
|
48 mike 1.1
49 PEGASUS_NAMESPACE_BEGIN
50
51 /** This class defines the internal representation of the CIMObject class.
52
53 This base class has two implementations: CIMClassRep CIMInstanceRep. The
54 CIMObjectRep pointer member of CIMObject points to one of these.
55
56 This class contains what is common to CIMClass and CIMInstance.
57 */
|
58 mike 1.29 class CIMObjectRep : public Sharable
|
59 mike 1.1 {
60 public:
61
|
62 kumpf 1.12 CIMObjectRep(const CIMObjectPath& className);
|
63 mike 1.1
64 virtual ~CIMObjectRep();
65
|
66 kumpf 1.19 const CIMName& getClassName() const
|
67 chip 1.2 {
|
68 kumpf 1.30 return _reference.getClassName();
|
69 chip 1.4 }
70
|
71 kumpf 1.12 const CIMObjectPath& getPath() const
|
72 chip 1.4 {
|
73 kumpf 1.30 return _reference;
|
74 mike 1.1 }
|
75 kumpf 1.15
76 /**
77 Sets the object path for the object
78 @param path CIMObjectPath containing the object path
79 */
80 void setPath (const CIMObjectPath & path);
|
81 mike 1.1
82 void addQualifier(const CIMQualifier& qualifier)
83 {
|
84 kumpf 1.30 _qualifiers.add(qualifier);
|
85 mike 1.1 }
86
|
87 kumpf 1.19 Uint32 findQualifier(const CIMName& name) const
|
88 mike 1.1 {
|
89 kumpf 1.30 return _qualifiers.find(name);
|
90 mike 1.1 }
91
|
92 kumpf 1.20 CIMQualifier getQualifier(Uint32 index)
|
93 mike 1.1 {
|
94 kumpf 1.30 return _qualifiers.getQualifier(index);
|
95 mike 1.1 }
96
|
97 kumpf 1.20 CIMConstQualifier getQualifier(Uint32 index) const
|
98 mike 1.1 {
|
99 kumpf 1.30 return _qualifiers.getQualifier(index);
|
100 mike 1.1 }
101
|
102 kumpf 1.19 Boolean isTrueQualifer(CIMName& name) const
|
103 karl 1.5 {
|
104 kumpf 1.30 return _qualifiers.isTrue(name);
|
105 karl 1.5 }
106
|
107 mike 1.1 Uint32 getQualifierCount() const
108 {
|
109 kumpf 1.30 return _qualifiers.getCount();
|
110 mike 1.1 }
111
|
112 kumpf 1.20 void removeQualifier(Uint32 index)
|
113 mike 1.1 {
|
114 kumpf 1.30 _qualifiers.removeQualifier(index);
|
115 mike 1.1 }
116
117 virtual void addProperty(const CIMProperty& x);
118
|
119 marek 1.32 Uint32 findProperty(const CIMName& name, Uint32 nameTag) const
120 {
121 return _properties.find(name, nameTag);
122 }
123
124 Uint32 findProperty(const CIMName& name) const
125 {
126 return _properties.find(name, generateCIMNameTag(name));
127 }
|
128 mike 1.1
|
129 kumpf 1.20 CIMProperty getProperty(Uint32 index);
|
130 mike 1.1
|
131 kumpf 1.20 CIMConstProperty getProperty(Uint32 index) const
|
132 mike 1.1 {
|
133 kumpf 1.30 return ((CIMObjectRep*)this)->getProperty(index);
|
134 mike 1.1 }
135
|
136 kumpf 1.20 void removeProperty(Uint32 index);
|
137 mike 1.1
|
138 marek 1.32 Uint32 getPropertyCount() const
139 {
140 return _properties.size();
141 }
|
142 mike 1.1
143 virtual Boolean identical(const CIMObjectRep* x) const;
144
145 virtual CIMObjectRep* clone() const = 0;
146
147 protected:
148
149 CIMObjectRep(const CIMObjectRep& x);
150
|
151 kumpf 1.12 CIMObjectPath _reference;
|
152 kumpf 1.9 CIMQualifierList _qualifiers;
|
153 marek 1.32 typedef OrderedSet<CIMProperty,
154 CIMPropertyRep,
155 PEGASUS_PROPERTY_ORDEREDSET_HASHSIZE> PropertySet;
156 PropertySet _properties;
|
157 kumpf 1.9 Boolean _resolved;
158
159 private:
160
|
161 kumpf 1.31 CIMObjectRep(); // Unimplemented
162 CIMObjectRep& operator=(const CIMObjectRep& x); // Unimplemented
|
163 mike 1.1
164 friend class CIMObject;
|
165 schuur 1.22 friend class BinaryStreamer;
|
166 mike 1.1 };
167
168 PEGASUS_NAMESPACE_END
169
170 #endif /* Pegasus_CIMObjectRep_h */
|