1 martin 1.39 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.40 //
|
3 martin 1.39 // 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.40 //
|
10 martin 1.39 // 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.40 //
|
17 martin 1.39 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.40 //
|
20 martin 1.39 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.40 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.39 // 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.40 //
|
28 martin 1.39 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.10 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_ParameterRep_h
33 #define Pegasus_ParameterRep_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.18 #include <Pegasus/Common/Linkage.h>
|
37 marek 1.33 #include <Pegasus/Common/Constants.h>
|
38 kumpf 1.20 #include <Pegasus/Common/InternalException.h>
|
39 mike 1.10 #include <Pegasus/Common/String.h>
|
40 kumpf 1.18 #include <Pegasus/Common/CIMName.h>
|
41 mike 1.10 #include <Pegasus/Common/CIMQualifier.h>
42 #include <Pegasus/Common/CIMQualifierList.h>
|
43 marek 1.33 #include <Pegasus/Common/OrderedSet.h>
|
44 mike 1.10
45 PEGASUS_NAMESPACE_BEGIN
46
47 class DeclContext;
48 class CIMConstParameter;
49 class CIMParameter;
50
|
51 kumpf 1.41 class CIMParameterRep
|
52 mike 1.10 {
53 public:
54
55 CIMParameterRep(
|
56 kumpf 1.30 const CIMName& name,
57 CIMType type,
58 Boolean isArray,
59 Uint32 arraySize,
60 const CIMName& referenceClassName);
|
61 mike 1.10
|
62 kumpf 1.30 const CIMName& getName() const
63 {
64 return _name;
|
65 mike 1.10 }
66
|
67 kumpf 1.36 Uint32 getNameTag() const
|
68 marek 1.33 {
69 return _nameTag;
70 }
|
71 kumpf 1.41
|
72 marek 1.33 void increaseOwnerCount()
73 {
74 _ownerCount++;
75 return;
76 }
77
78 void decreaseOwnerCount()
79 {
|
80 thilo.boehm 1.37 _ownerCount--;
|
81 marek 1.33 return;
82 }
|
83 kumpf 1.41
|
84 kumpf 1.18 void setName(const CIMName& name);
|
85 mike 1.10
86 Boolean isArray() const
87 {
|
88 kumpf 1.30 return _isArray;
|
89 mike 1.10 }
90
|
91 kumpf 1.12 Uint32 getArraySize() const
|
92 mike 1.10 {
|
93 kumpf 1.30 return _arraySize;
|
94 mike 1.10 }
95
|
96 kumpf 1.30 const CIMName& getReferenceClassName() const
|
97 mike 1.10 {
|
98 kumpf 1.30 return _referenceClassName;
|
99 mike 1.10 }
100
|
101 kumpf 1.31 CIMType getType() const
|
102 kumpf 1.30 {
103 return _type;
|
104 mike 1.10 }
105
106 void addQualifier(const CIMQualifier& qualifier)
107 {
|
108 kumpf 1.30 _qualifiers.add(qualifier);
|
109 mike 1.10 }
110
|
111 kumpf 1.18 Uint32 findQualifier(const CIMName& name) const
|
112 mike 1.10 {
|
113 kumpf 1.30 return _qualifiers.find(name);
|
114 mike 1.10 }
115
|
116 kumpf 1.21 CIMQualifier getQualifier(Uint32 index)
|
117 mike 1.10 {
|
118 kumpf 1.30 return _qualifiers.getQualifier(index);
|
119 mike 1.10 }
120
|
121 kumpf 1.21 CIMConstQualifier getQualifier(Uint32 index) const
|
122 mike 1.10 {
|
123 kumpf 1.30 return _qualifiers.getQualifier(index);
|
124 mike 1.10 }
125
|
126 marek 1.35 void removeQualifier (Uint32 index)
127 {
128 _qualifiers.removeQualifier (index);
129 }
130
|
131 kumpf 1.19
|
132 mike 1.10 Uint32 getQualifierCount() const
133 {
|
134 kumpf 1.30 return _qualifiers.getCount();
|
135 mike 1.10 }
136
|
137 kumpf 1.18 void resolve(DeclContext* declContext, const CIMNamespaceName& nameSpace);
|
138 mike 1.10
139 Boolean identical(const CIMParameterRep* x) const;
140
141 CIMParameterRep* clone() const
142 {
|
143 kumpf 1.30 return new CIMParameterRep(*this);
|
144 mike 1.10 }
145
|
146 thilo.boehm 1.37 void Inc()
147 {
148 _refCounter++;
149 }
150
151 void Dec()
152 {
153 if (_refCounter.decAndTestIfZero())
154 delete this;
155 }
156
|
157 mike 1.10 private:
158
159 CIMParameterRep(const CIMParameterRep& x);
160
|
161 kumpf 1.32 CIMParameterRep(); // Unimplemented
162 CIMParameterRep& operator=(const CIMParameterRep& x); // Unimplemented
|
163 mike 1.10
|
164 kumpf 1.18 CIMName _name;
|
165 mike 1.10 CIMType _type;
166 Boolean _isArray;
167 Uint32 _arraySize;
|
168 kumpf 1.18 CIMName _referenceClassName;
|
169 mike 1.10 CIMQualifierList _qualifiers;
|
170 marek 1.33 Uint32 _nameTag;
|
171 thilo.boehm 1.37
172 // reference counter as member to avoid
173 // virtual function resolution overhead
174 AtomicInt _refCounter;
|
175 marek 1.33 Uint32 _ownerCount;
|
176 thilo.boehm 1.37
|
177 mike 1.38 friend class CIMBuffer;
|
178 mike 1.10 };
179
180 PEGASUS_NAMESPACE_END
181
182 #endif /* Pegasus_ParameterRep_h */
|