(file) Return to CIMMethodRep.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 karl  1.33 //%2006////////////////////////////////////////////////////////////////////////
  2 mike  1.15 //
  3 karl  1.29 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 karl  1.28 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.29 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.31 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.33 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.15 //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 kumpf 1.21 // of this software and associated documentation files (the "Software"), to
 16            // deal in the Software without restriction, including without limitation the
 17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18 mike  1.15 // sell copies of the Software, and to permit persons to whom the Software is
 19            // furnished to do so, subject to the following conditions:
 20            // 
 21 kumpf 1.21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike  1.15 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24 kumpf 1.21 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27 mike  1.15 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29            //
 30            //==============================================================================
 31            //
 32            //%/////////////////////////////////////////////////////////////////////////////
 33            
 34            #ifndef Pegasus_MethodRep_h
 35            #define Pegasus_MethodRep_h
 36            
 37            #include <Pegasus/Common/Config.h>
 38 kumpf 1.24 #include <Pegasus/Common/Linkage.h>
 39 marek 1.37 #include <Pegasus/Common/Constants.h>
 40 kumpf 1.26 #include <Pegasus/Common/InternalException.h>
 41 mike  1.15 #include <Pegasus/Common/String.h>
 42 kumpf 1.24 #include <Pegasus/Common/CIMName.h>
 43 mike  1.15 #include <Pegasus/Common/CIMQualifier.h>
 44            #include <Pegasus/Common/CIMQualifierList.h>
 45            #include <Pegasus/Common/CIMParameter.h>
 46 marek 1.37 #include <Pegasus/Common/CIMParameterRep.h>
 47 mike  1.15 #include <Pegasus/Common/Pair.h>
 48 marek 1.37 #include <Pegasus/Common/OrderedSet.h>
 49 mike  1.15 
 50            PEGASUS_NAMESPACE_BEGIN
 51            
 52            class CIMConstMethod;
 53            class DeclContext;
 54            
 55 thilo.boehm 1.41 class CIMMethodRep
 56 mike        1.15 {
 57                  public:
 58                  
 59                      CIMMethodRep(
 60 kumpf       1.35         const CIMName& name,
 61                          CIMType type,
 62                          const CIMName& classOrigin,
 63                          Boolean propagated);
 64 mike        1.15 
 65 thilo.boehm 1.41     const CIMName& getName() const
 66 mike        1.15     {
 67 kumpf       1.35         return _name;
 68 mike        1.15     }
 69                  
 70 kumpf       1.40     Uint32 getNameTag() const
 71 marek       1.37     {
 72                          return _nameTag;
 73                      }
 74                  
 75                      void increaseOwnerCount()
 76                      {
 77                          _ownerCount++;
 78                          return;
 79                      }
 80                  
 81                      void decreaseOwnerCount()
 82                      {
 83 thilo.boehm 1.41         _ownerCount--;
 84 marek       1.37         return;
 85                      }
 86                      
 87 kumpf       1.24     void setName(const CIMName& name);
 88 mike        1.15 
 89                      CIMType getType() const
 90                      {
 91 kumpf       1.35         return _type;
 92 mike        1.15     }
 93                  
 94 marek       1.39     void setType(CIMType type)
 95                      {
 96                          _type = type;
 97                      }
 98 mike        1.15 
 99 kumpf       1.24     const CIMName& getClassOrigin() const
100 mike        1.15     {
101 kumpf       1.35         return _classOrigin;
102 mike        1.15     }
103                  
104 marek       1.39     void setClassOrigin(const CIMName& classOrigin)
105                      {
106                          _classOrigin = classOrigin;
107                      }
108 mike        1.15 
109                      Boolean getPropagated() const
110                      {
111 kumpf       1.35         return _propagated;
112 mike        1.15     }
113                  
114                      void setPropagated(Boolean propagated)
115                      {
116 kumpf       1.35         _propagated = propagated;
117 mike        1.15     }
118                  
119                      void addQualifier(const CIMQualifier& qualifier)
120                      {
121 kumpf       1.35         _qualifiers.add(qualifier);
122 mike        1.15     }
123 kumpf       1.18 
124 kumpf       1.24     Uint32 findQualifier(const CIMName& name) const
125 mike        1.15     {
126 kumpf       1.35         return _qualifiers.find(name);
127 mike        1.15     }
128                  
129 kumpf       1.27     CIMQualifier getQualifier(Uint32 index)
130 mike        1.15     {
131 kumpf       1.35         return _qualifiers.getQualifier(index);
132 mike        1.15     }
133                  
134                  
135 kumpf       1.27     CIMConstQualifier getQualifier(Uint32 index) const
136 mike        1.15     {
137 kumpf       1.35         return _qualifiers.getQualifier(index);
138 mike        1.15     }
139 kumpf       1.18 
140 kumpf       1.27     void removeQualifier(Uint32 index)
141 mike        1.15     {
142 kumpf       1.35         _qualifiers.removeQualifier(index);
143 mike        1.15     }
144                  
145                  
146                      Uint32 getQualifierCount() const
147                      {
148 kumpf       1.35         return _qualifiers.getCount();
149 mike        1.15     }
150                  
151                      void addParameter(const CIMParameter& x);
152                  
153 marek       1.39     Uint32 findParameter(const CIMName& name) const
154                      {
155                          return _parameters.find(name, generateCIMNameTag(name));
156                      }
157 mike        1.15 
158 marek       1.39     CIMParameter getParameter(Uint32 index)
159                      {
160                          return _parameters[index];
161                      }
162 mike        1.15 
163 kumpf       1.27     CIMConstParameter getParameter(Uint32 index) const
164 mike        1.15     {
165 kumpf       1.35         return ((CIMMethodRep*)this)->getParameter(index);
166 mike        1.15     }
167                  
168 marek       1.39     void removeParameter (Uint32 index)
169                      {
170                          _parameters.remove (index);
171                      }
172 kumpf       1.25 
173 marek       1.39     Uint32 getParameterCount() const
174                      {
175                          return _parameters.size();
176                      }
177 mike        1.15 
178                      void resolve(
179 kumpf       1.35         DeclContext* declContext,
180                          const CIMNamespaceName& nameSpace,
181                          const CIMConstMethod& method);
182 mike        1.15 
183                      void resolve(
184 kumpf       1.35         DeclContext* declContext,
185                          const CIMNamespaceName& nameSpace);
186 mike        1.15 
187                      Boolean identical(const CIMMethodRep* x) const;
188                  
189                      CIMMethodRep* clone() const
190                      {
191 kumpf       1.35         return new CIMMethodRep(*this);
192 mike        1.15     }
193                  
194 thilo.boehm 1.41     void Inc()
195                      {
196                          _refCounter++;
197                      }
198                  
199                      void Dec()
200                      {
201                          if (_refCounter.decAndTestIfZero())
202                              delete this;
203                      }
204                  
205 mike        1.15 private:
206                  
207                      CIMMethodRep(const CIMMethodRep& x);
208                  
209 kumpf       1.36     CIMMethodRep();    // Unimplemented
210                      CIMMethodRep& operator=(const CIMMethodRep& x);    // Unimplemented
211 mike        1.15 
212 kumpf       1.24     CIMName _name;
213 mike        1.15     CIMType _type;
214 kumpf       1.24     CIMName _classOrigin;
215 mike        1.15     Boolean _propagated;
216                      CIMQualifierList _qualifiers;
217 marek       1.37     Uint32 _nameTag;
218                      Uint32 _ownerCount;
219                  
220 thilo.boehm 1.41     // reference counter as member to avoid
221                      // virtual function resolution overhead
222                      AtomicInt _refCounter;
223                  
224 marek       1.37     typedef OrderedSet<CIMParameter,
225                                         CIMParameterRep,
226                                         PEGASUS_PARAMETER_ORDEREDSET_HASHSIZE> ParameterSet;
227                      ParameterSet _parameters;
228 mike        1.15 
229                      friend class CIMClassRep;
230 mike        1.42     friend class CIMBuffer;
231 mike        1.15 };
232                  
233                  PEGASUS_NAMESPACE_END
234                  
235                  #endif /* Pegasus_MethodRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2