1 mike 1.12 //%/////////////////////////////////////////////////////////////////////////////
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 // 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 // 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 //
12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
13 // 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 // 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 // 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 mike 1.12 //
23 // Author: Mike Brasher (mbrasher@bmc.com)
24 //
25 // Modified By:
26 //
27 //%/////////////////////////////////////////////////////////////////////////////
28
29 #ifndef Pegasus_PropertyRep_h
30 #define Pegasus_PropertyRep_h
31
32 #include <Pegasus/Common/Config.h>
33 #include <Pegasus/Common/Exception.h>
34 #include <Pegasus/Common/String.h>
35 #include <Pegasus/Common/CIMValue.h>
36 #include <Pegasus/Common/CIMQualifier.h>
37 #include <Pegasus/Common/CIMQualifierList.h>
38 #include <Pegasus/Common/Sharable.h>
39 #include <Pegasus/Common/Pair.h>
40
41 PEGASUS_NAMESPACE_BEGIN
42
43 mike 1.12 class CIMClassRep;
44 class CIMProperty;
45 class CIMConstProperty;
46 class DeclContext;
47
48 class PEGASUS_COMMON_LINKAGE CIMPropertyRep : public Sharable
49 {
50 public:
51
52 CIMPropertyRep(
53 const String& name,
54 const CIMValue& value,
55 Uint32 arraySize,
56 const String& referenceClassName,
57 const String& classOrigin,
58 Boolean propagated);
59
60 ~CIMPropertyRep();
61
62 const String& getName() const
63 {
64 mike 1.12 return _name;
65 }
66
67 void setName(const String& name);
68
69 const CIMValue& getValue() const
70 {
71 return _value;
72 }
73
74 void setValue(const CIMValue& value);
75
76 Uint32 getArraySize() const
77 {
78 return _arraySize;
79 }
80
81 const String& getReferenceClassName() const
82 {
83 return _referenceClassName;
84 }
85 mike 1.12
86 const String& getClassOrigin() const
87 {
88 return _classOrigin;
89 }
90
91 void setClassOrigin(const String& classOrigin);
92
93 Boolean getPropagated() const
94 {
95 return _propagated;
96 }
97
98 void setPropagated(Boolean propagated)
99 {
100 _propagated = propagated;
101 }
102
103 void addQualifier(const CIMQualifier& qualifier)
104 {
105 _qualifiers.add(qualifier);
106 mike 1.12 }
107
108 Uint32 findQualifier(const String& name) const
109 {
110 return _qualifiers.find(name);
111 }
112
113 Boolean existsQualifier(const String& name) const
114 {
115 return (findQualifier(name) != PEG_NOT_FOUND) ? true : false;
116 }
117
118 CIMQualifier getQualifier(Uint32 pos)
119 {
120 return _qualifiers.getQualifier(pos);
121 }
122
123 CIMConstQualifier getQualifier(Uint32 pos) const
124 {
125 return _qualifiers.getQualifier(pos);
126 }
127 mike 1.12
128 void removeQualifier(Uint32 pos)
129 {
130 _qualifiers.removeQualifier(pos);
131 }
132
133 Uint32 getQualifierCount() const
134 {
135 return _qualifiers.getCount();
136 }
137
138 void resolve(
139 DeclContext* declContext,
140 const String& nameSpace,
141 Boolean isInstancePart,
142 const CIMConstProperty& property);
143
144 void resolve(
145 DeclContext* declContext,
146 const String& nameSpace,
147 Boolean isInstancePart);
148 mike 1.12
149 void toXml(Array<Sint8>& out) const;
150
151 void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const;
152
153 Boolean identical(const CIMPropertyRep* x) const;
154
155 Boolean isKey() const;
156
157 CIMPropertyRep* clone() const
158 {
159 return new CIMPropertyRep(*this);
160 }
161
162 private:
163
164 CIMPropertyRep();
165
166 // Cloning constructor:
167
168 CIMPropertyRep(const CIMPropertyRep& x);
169 mike 1.12
170 CIMPropertyRep& operator=(const CIMPropertyRep& x);
171
172 String _name;
173 CIMValue _value;
174 Uint32 _arraySize;
175 String _referenceClassName;
176 String _classOrigin;
177 Boolean _propagated;
178 CIMQualifierList _qualifiers;
179
180 friend class CIMClassRep;
181 };
182
183 PEGASUS_NAMESPACE_END
184
185 #endif /* Pegasus_PropertyRep_h */
|