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 kumpf 1.9 Uint32 findProperty(const String& name) const;
|
114 mike 1.1
|
115 kumpf 1.9 Boolean existsProperty(const String& name) const;
|
116 mike 1.1
117 CIMProperty getProperty(Uint32 pos);
118
119 CIMConstProperty getProperty(Uint32 pos) const
120 {
121 return ((CIMObjectRep*)this)->getProperty(pos);
122 }
123
124 void removeProperty(Uint32 pos);
125
126 Uint32 getPropertyCount() const;
127
128 virtual Boolean identical(const CIMObjectRep* x) const;
129
130 virtual void toXml(Array<Sint8>& out) const = 0;
131
132 virtual void print(PEGASUS_STD(ostream)& os = PEGASUS_STD(cout)) const = 0;
133
134 virtual CIMObjectRep* clone() const = 0;
135
136 protected:
137 mike 1.1
138 CIMObjectRep();
139
140 CIMObjectRep(const CIMObjectRep& x);
141
|
142 kumpf 1.9 CIMReference _reference;
143 CIMQualifierList _qualifiers;
144 Array<CIMProperty> _properties;
145 Boolean _resolved;
146
147 private:
148
149 // This method is declared and made private so that the compiler does
150 // not implicitly define a default copy constructor.
|
151 mike 1.1 CIMObjectRep& operator=(const CIMObjectRep& x)
152 {
|
153 kumpf 1.9 PEGASUS_ASSERT(0);
|
154 mike 1.1 return *this;
155 }
156
157 friend class CIMObject;
158 };
159
160 PEGASUS_NAMESPACE_END
161
162 #endif /* Pegasus_CIMObjectRep_h */
|