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.19 #include <Pegasus/Common/CIMName.h>
|
41 mike 1.1 #include <Pegasus/Common/CIMProperty.h>
42 #include <Pegasus/Common/CIMQualifier.h>
|
43 kumpf 1.8 #include <Pegasus/Common/CIMQualifierList.h>
|
44 mike 1.1 #include <Pegasus/Common/Array.h>
|
45 marek 1.32 #include <Pegasus/Common/OrderedSet.h>
46 #include <Pegasus/Common/CIMPropertyRep.h>
|
47 mike 1.1
48 PEGASUS_NAMESPACE_BEGIN
49
50 /** This class defines the internal representation of the CIMObject class.
51
52 This base class has two implementations: CIMClassRep CIMInstanceRep. The
53 CIMObjectRep pointer member of CIMObject points to one of these.
54
55 This class contains what is common to CIMClass and CIMInstance.
56 */
|
57 thilo.boehm 1.36 class CIMObjectRep
|
58 mike 1.1 {
59 public:
60
|
61 kumpf 1.12 CIMObjectRep(const CIMObjectPath& className);
|
62 mike 1.1
63 virtual ~CIMObjectRep();
64
|
65 kumpf 1.19 const CIMName& getClassName() const
|
66 chip 1.2 {
|
67 kumpf 1.30 return _reference.getClassName();
|
68 chip 1.4 }
69
|
70 kumpf 1.12 const CIMObjectPath& getPath() const
|
71 chip 1.4 {
|
72 kumpf 1.30 return _reference;
|
73 mike 1.1 }
|
74 kumpf 1.15
75 /**
76 Sets the object path for the object
77 @param path CIMObjectPath containing the object path
78 */
79 void setPath (const CIMObjectPath & path);
|
80 mike 1.1
81 void addQualifier(const CIMQualifier& qualifier)
82 {
|
83 kumpf 1.30 _qualifiers.add(qualifier);
|
84 mike 1.1 }
85
|
86 kumpf 1.19 Uint32 findQualifier(const CIMName& name) const
|
87 mike 1.1 {
|
88 kumpf 1.30 return _qualifiers.find(name);
|
89 mike 1.1 }
90
|
91 kumpf 1.20 CIMQualifier getQualifier(Uint32 index)
|
92 mike 1.1 {
|
93 kumpf 1.30 return _qualifiers.getQualifier(index);
|
94 mike 1.1 }
95
|
96 kumpf 1.20 CIMConstQualifier getQualifier(Uint32 index) const
|
97 mike 1.1 {
|
98 kumpf 1.30 return _qualifiers.getQualifier(index);
|
99 mike 1.1 }
100
|
101 kumpf 1.19 Boolean isTrueQualifer(CIMName& name) const
|
102 karl 1.5 {
|
103 kumpf 1.30 return _qualifiers.isTrue(name);
|
104 karl 1.5 }
105
|
106 mike 1.1 Uint32 getQualifierCount() const
107 {
|
108 kumpf 1.30 return _qualifiers.getCount();
|
109 mike 1.1 }
110
|
111 kumpf 1.20 void removeQualifier(Uint32 index)
|
112 mike 1.1 {
|
113 kumpf 1.30 _qualifiers.removeQualifier(index);
|
114 mike 1.1 }
115
116 virtual void addProperty(const CIMProperty& x);
117
|
118 marek 1.32 Uint32 findProperty(const CIMName& name, Uint32 nameTag) const
119 {
120 return _properties.find(name, nameTag);
121 }
122
123 Uint32 findProperty(const CIMName& name) const
124 {
125 return _properties.find(name, generateCIMNameTag(name));
126 }
|
127 mike 1.1
|
128 marek 1.34 CIMProperty getProperty(Uint32 index)
129 {
130 return _properties[index];
131 }
|
132 mike 1.1
|
133 kumpf 1.20 CIMConstProperty getProperty(Uint32 index) const
|
134 mike 1.1 {
|
135 kumpf 1.30 return ((CIMObjectRep*)this)->getProperty(index);
|
136 mike 1.1 }
137
|
138 marek 1.34 void removeProperty(Uint32 index)
139 {
140 _properties.remove(index);
141 }
|
142 mike 1.1
|
143 marek 1.32 Uint32 getPropertyCount() const
144 {
145 return _properties.size();
146 }
|
147 mike 1.1
148 virtual Boolean identical(const CIMObjectRep* x) const;
149
150 virtual CIMObjectRep* clone() const = 0;
151
|
152 thilo.boehm 1.36 void Inc()
153 {
154 _refCounter++;
155 }
156
157 void Dec()
158 {
159 if (_refCounter.decAndTestIfZero())
160 delete this;
161 }
162
|
163 mike 1.1 protected:
164
165 CIMObjectRep(const CIMObjectRep& x);
166
|
167 kumpf 1.12 CIMObjectPath _reference;
|
168 kumpf 1.9 CIMQualifierList _qualifiers;
|
169 marek 1.32 typedef OrderedSet<CIMProperty,
170 CIMPropertyRep,
171 PEGASUS_PROPERTY_ORDEREDSET_HASHSIZE> PropertySet;
172 PropertySet _properties;
|
173 kumpf 1.9
174 private:
175
|
176 kumpf 1.31 CIMObjectRep(); // Unimplemented
177 CIMObjectRep& operator=(const CIMObjectRep& x); // Unimplemented
|
178 mike 1.1
|
179 thilo.boehm 1.36 // reference counter as member to avoid
180 // virtual function resolution overhead
181 AtomicInt _refCounter;
182
|
183 mike 1.1 friend class CIMObject;
|
184 schuur 1.22 friend class BinaryStreamer;
|
185 mike 1.1 };
186
187 PEGASUS_NAMESPACE_END
188
189 #endif /* Pegasus_CIMObjectRep_h */
|