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 kumpf 1.10 #include <Pegasus/Common/Sharable.h>
|
35 mike 1.1 #include <Pegasus/Common/CIMProperty.h>
36 #include <Pegasus/Common/CIMQualifier.h>
|
37 kumpf 1.8 #include <Pegasus/Common/CIMQualifierList.h>
|
38 mike 1.1 #include <Pegasus/Common/Array.h>
39
40 PEGASUS_NAMESPACE_BEGIN
41
42 /** This class defines the internal representation of the CIMObject class.
43
44 This base class has two implementations: CIMClassRep CIMInstanceRep. The
45 CIMObjectRep pointer member of CIMObject points to one of these.
46
47 This class contains what is common to CIMClass and CIMInstance.
48 */
49 class PEGASUS_COMMON_LINKAGE CIMObjectRep : public Sharable
50 {
51 public:
52
|
53 kumpf 1.12 CIMObjectRep(const CIMObjectPath& className);
|
54 mike 1.1
55 virtual ~CIMObjectRep();
56
|
57 chip 1.3 const String& getClassName() const
|
58 chip 1.2 {
|
59 chip 1.4 return _reference.getClassName();
60 }
61
|
62 kumpf 1.12 const CIMObjectPath& getPath() const
|
63 chip 1.4 {
64 return _reference;
|
65 mike 1.1 }
66
67 void addQualifier(const CIMQualifier& qualifier)
68 {
69 _qualifiers.add(qualifier);
70 }
71
72 Uint32 findQualifier(const String& name) const
73 {
74 return _qualifiers.find(name);
75 }
76
77 Boolean existsQualifier(const String& name) const
78 {
79 return ((_qualifiers.find(name) != PEG_NOT_FOUND) ? true : false);
80 }
81
82 CIMQualifier getQualifier(Uint32 pos)
83 {
84 return _qualifiers.getQualifier(pos);
85 }
86 mike 1.1
87 CIMConstQualifier getQualifier(Uint32 pos) const
88 {
89 return _qualifiers.getQualifier(pos);
90 }
91
|
92 karl 1.5 Boolean isTrueQualifer(String& name) const
93 {
94 return _qualifiers.isTrue(name);
95 }
96
|
97 mike 1.1 Uint32 getQualifierCount() const
98 {
99 return _qualifiers.getCount();
100 }
101
102 void removeQualifier(Uint32 pos)
103 {
104 _qualifiers.removeQualifier(pos);
105 }
106
107 virtual void addProperty(const CIMProperty& x);
108
|
109 kumpf 1.9 Uint32 findProperty(const String& name) const;
|
110 mike 1.1
|
111 kumpf 1.9 Boolean existsProperty(const String& name) const;
|
112 mike 1.1
113 CIMProperty getProperty(Uint32 pos);
114
115 CIMConstProperty getProperty(Uint32 pos) const
116 {
117 return ((CIMObjectRep*)this)->getProperty(pos);
118 }
119
120 void removeProperty(Uint32 pos);
121
122 Uint32 getPropertyCount() const;
123
124 virtual Boolean identical(const CIMObjectRep* x) const;
125
126 virtual void toXml(Array<Sint8>& out) const = 0;
127
128 virtual CIMObjectRep* clone() const = 0;
129
130 protected:
131
132 CIMObjectRep();
133 mike 1.1
134 CIMObjectRep(const CIMObjectRep& x);
135
|
136 kumpf 1.12 CIMObjectPath _reference;
|
137 kumpf 1.9 CIMQualifierList _qualifiers;
138 Array<CIMProperty> _properties;
139 Boolean _resolved;
140
141 private:
142
143 // This method is declared and made private so that the compiler does
144 // not implicitly define a default copy constructor.
|
145 mike 1.1 CIMObjectRep& operator=(const CIMObjectRep& x)
146 {
|
147 kumpf 1.14 //PEGASUS_ASSERT(0);
|
148 mike 1.1 return *this;
149 }
150
151 friend class CIMObject;
152 };
153
154 PEGASUS_NAMESPACE_END
155
156 #endif /* Pegasus_CIMObjectRep_h */
|