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