1 martin 1.42 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.43 //
|
3 martin 1.42 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.43 //
|
10 martin 1.42 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.43 //
|
17 martin 1.42 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.43 //
|
20 martin 1.42 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.43 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.42 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.43 //
|
28 martin 1.42 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.11 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_QualifierRep_h
33 #define Pegasus_QualifierRep_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.23 #include <Pegasus/Common/Linkage.h>
|
37 marek 1.36 #include <Pegasus/Common/Constants.h>
|
38 kumpf 1.23 #include <Pegasus/Common/CIMName.h>
|
39 mike 1.11 #include <Pegasus/Common/CIMValue.h>
40 #include <Pegasus/Common/Array.h>
41 #include <Pegasus/Common/Pair.h>
|
42 kumpf 1.26 #include <Pegasus/Common/InternalException.h>
|
43 mike 1.11 #include <Pegasus/Common/CIMFlavor.h>
|
44 mike 1.31 #include <Pegasus/Common/Buffer.h>
|
45 marek 1.36 #include <Pegasus/Common/OrderedSet.h>
|
46 mike 1.11
47 PEGASUS_NAMESPACE_BEGIN
48
49 class CIMConstQualifier;
50 class CIMQualifier;
51
|
52 thilo.boehm 1.40 class CIMQualifierRep
|
53 mike 1.11 {
54 public:
55
56 CIMQualifierRep(
|
57 kumpf 1.34 const CIMName& name,
58 const CIMValue& value,
59 const CIMFlavor& flavor,
60 Boolean propagated);
|
61 mike 1.11
|
62 kumpf 1.34 const CIMName& getName() const
63 {
64 return _name;
|
65 mike 1.11 }
66
|
67 kumpf 1.39 Uint32 getNameTag() const
|
68 marek 1.36 {
69 return _nameTag;
70 }
71
72 void increaseOwnerCount()
73 {
74 _ownerCount++;
75 return;
76 }
77
78 void decreaseOwnerCount()
79 {
|
80 thilo.boehm 1.40 _ownerCount--;
|
81 marek 1.36 return;
82 }
83
|
84 kumpf 1.23 void setName(const CIMName& name);
|
85 mike 1.11
|
86 kumpf 1.34 CIMType getType() const
87 {
88 return _value.getType();
|
89 mike 1.11 }
90
|
91 kumpf 1.34 Boolean isArray() const
|
92 mike 1.11 {
|
93 kumpf 1.34 return _value.isArray();
|
94 mike 1.11 }
95
|
96 kumpf 1.34 const CIMValue& getValue() const
97 {
98 return _value;
|
99 mike 1.11 }
100
|
101 marek 1.38 void setValue(const CIMValue& value)
102 {
103 _value = value;
104 }
|
105 mike 1.11
|
106 kumpf 1.34 const CIMFlavor & getFlavor() const
|
107 mike 1.11 {
|
108 kumpf 1.34 return _flavor;
|
109 mike 1.11 }
110
|
111 kumpf 1.34 void setFlavor(const CIMFlavor & flavor)
|
112 karl 1.14 {
|
113 kumpf 1.34 _flavor = flavor;
|
114 karl 1.14 }
|
115 karl 1.15
|
116 kumpf 1.34 void unsetFlavor(const CIMFlavor & flavor)
|
117 karl 1.15 {
|
118 kumpf 1.24 _flavor.removeFlavor (flavor);
|
119 karl 1.15 }
120
|
121 marek 1.45 void resolveFlavor (const CIMFlavor & inheritedFlavor);
|
122 karl 1.14
|
123 kumpf 1.34 Boolean getPropagated() const
124 {
125 return _propagated;
|
126 mike 1.11 }
127
|
128 kumpf 1.34 void setPropagated(Boolean propagated)
|
129 mike 1.11 {
|
130 kumpf 1.34 _propagated = propagated;
|
131 mike 1.11 }
132
133 Boolean identical(const CIMQualifierRep* x) const;
134
135 CIMQualifierRep* clone() const
136 {
|
137 kumpf 1.34 return new CIMQualifierRep(*this);
|
138 mike 1.11 }
139
|
140 thilo.boehm 1.40 void Inc()
141 {
142 _refCounter++;
143 }
144
145 void Dec()
146 {
147 if (_refCounter.decAndTestIfZero())
148 delete this;
149 }
150
|
151 mike 1.11 private:
152
153 // Cloning constructor:
154
155 CIMQualifierRep(const CIMQualifierRep& x);
156
|
157 kumpf 1.35 CIMQualifierRep(); // Unimplemented
158 CIMQualifierRep& operator=(const CIMQualifierRep& x); // Unimplemented
|
159 mike 1.11
|
160 kumpf 1.23 CIMName _name;
|
161 mike 1.11 CIMValue _value;
|
162 kumpf 1.24 CIMFlavor _flavor;
|
163 mike 1.11 Boolean _propagated;
|
164 marek 1.36 Uint32 _nameTag;
|
165 thilo.boehm 1.40
166 // reference counter as member to avoid
167 // virtual function resolution overhead
168 AtomicInt _refCounter;
|
169 marek 1.36 Uint32 _ownerCount;
|
170 kumpf 1.44
|
171 marek 1.36 friend class CIMQualifierList;
|
172 mike 1.41 friend class CIMBuffer;
|
173 mike 1.11 };
174
175 PEGASUS_NAMESPACE_END
176
177 #endif /* Pegasus_QualifierRep_h */
|