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

  1 karl  1.15 //%2006////////////////////////////////////////////////////////////////////////
  2 kumpf 1.1  //
  3 karl  1.6  // 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.2  // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.6  // 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.12 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.15 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 kumpf 1.1  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15            // 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            // 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 karl  1.15 // 
 21 kumpf 1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22            // 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            // 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            // 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            #include "OperationContextInternal.h"
 35            
 36            PEGASUS_NAMESPACE_BEGIN
 37            
 38            //
 39            // LocaleContainer
 40            //
 41            
 42 kumpf 1.1  const String LocaleContainer::NAME = "LocaleContainer";
 43            
 44 kumpf 1.19 LocaleContainer::LocaleContainer(const OperationContext::Container& container)
 45 kumpf 1.1  {
 46 kumpf 1.19     const LocaleContainer* p = dynamic_cast<const LocaleContainer*>(&container);
 47 kumpf 1.1  
 48 kumpf 1.19     if (p == 0)
 49 kumpf 1.1      {
 50                    throw DynamicCastFailedException();
 51                }
 52            
 53                *this = *p;
 54            }
 55            
 56 kumpf 1.19 LocaleContainer::LocaleContainer(const String& languageId)
 57 kumpf 1.1  {
 58                _languageId = languageId;
 59            }
 60            
 61 kumpf 1.19 LocaleContainer::~LocaleContainer()
 62 kumpf 1.1  {
 63            }
 64            
 65 kumpf 1.19 LocaleContainer& LocaleContainer::operator=(const LocaleContainer&container)
 66 brian.campbell 1.7  {
 67 kumpf          1.19     if (this == &container)
 68 chip           1.11     {
 69 kumpf          1.19         return *this;
 70 chip           1.11     }
 71 brian.campbell 1.7  
 72 chip           1.11     _languageId = container._languageId;
 73                     
 74 kumpf          1.19     return *this;
 75 brian.campbell 1.7  }
 76                     
 77 kumpf          1.19 String LocaleContainer::getName() const
 78 kumpf          1.1  {
 79 kumpf          1.19     return NAME;
 80 kumpf          1.1  }
 81                     
 82 kumpf          1.19 OperationContext::Container* LocaleContainer::clone() const
 83 kumpf          1.1  {
 84 kumpf          1.19     return new LocaleContainer(*this);
 85 kumpf          1.1  }
 86                     
 87 kumpf          1.19 void LocaleContainer::destroy()
 88 kumpf          1.1  {
 89                         delete this;
 90                     }
 91                     
 92 kumpf          1.19 String LocaleContainer::getLanguageId() const
 93 kumpf          1.1  {
 94 kumpf          1.19     return _languageId;
 95 kumpf          1.1  }
 96                     
 97                     //
 98                     // ProviderIdContainer
 99                     //
100                     
101                     const String ProviderIdContainer::NAME = "ProviderIdContainer";
102                     
103 kumpf          1.19 ProviderIdContainer::ProviderIdContainer(
104                         const OperationContext::Container& container)
105 kumpf          1.1  {
106 kumpf          1.19     const ProviderIdContainer* p =
107                             dynamic_cast<const ProviderIdContainer*>(&container);
108 kumpf          1.1  
109 kumpf          1.19     if (p == 0)
110 kumpf          1.1      {
111                             throw DynamicCastFailedException();
112                         }
113                     
114                         *this = *p;
115                     }
116                     
117 chip           1.11 ProviderIdContainer::ProviderIdContainer(
118 kumpf          1.19     const CIMInstance& module,
119                         const CIMInstance& provider,
120 chip           1.14     Boolean isRemoteNameSpace,
121 kumpf          1.19     const String& remoteInfo)
122 chip           1.13     : _module(module),
123                         _provider(provider),
124                         _isRemoteNameSpace(isRemoteNameSpace),
125                         _remoteInfo(remoteInfo)
126 kumpf          1.1  {
127                     }
128                     
129 kumpf          1.19 ProviderIdContainer::~ProviderIdContainer()
130 kumpf          1.1  {
131                     }
132                     
133 kumpf          1.19 ProviderIdContainer& ProviderIdContainer::operator=(
134                         const ProviderIdContainer& container)
135 brian.campbell 1.7  {
136 kumpf          1.19     if (this == &container)
137 brian.campbell 1.7      {
138 kumpf          1.19         return *this;
139 brian.campbell 1.7      }
140                     
141                         _module = container._module;
142                         _provider = container._provider;
143 chip           1.13     _isRemoteNameSpace = container._isRemoteNameSpace;
144 brian.campbell 1.7      _remoteInfo = container._remoteInfo;
145                     
146 kumpf          1.19     return *this;
147 brian.campbell 1.7  }
148                     
149 kumpf          1.19 String ProviderIdContainer::getName() const
150 kumpf          1.1  {
151 kumpf          1.19     return NAME;
152 kumpf          1.1  }
153                     
154 kumpf          1.19 OperationContext::Container* ProviderIdContainer::clone() const
155 kumpf          1.1  {
156 kumpf          1.19     return new ProviderIdContainer(*this);
157 kumpf          1.1  }
158                     
159 kumpf          1.19 void ProviderIdContainer::destroy()
160 kumpf          1.1  {
161                         delete this;
162                     }
163                     
164 kumpf          1.19 CIMInstance ProviderIdContainer::getModule() const
165 kumpf          1.1  {
166 kumpf          1.19     return _module;
167 kumpf          1.1  }
168                     
169 kumpf          1.19 CIMInstance ProviderIdContainer::getProvider() const
170 kumpf          1.1  {
171 kumpf          1.19     return _provider;
172 kumpf          1.1  }
173                     
174 kumpf          1.19 Boolean ProviderIdContainer::isRemoteNameSpace() const
175 schuur         1.5  {
176 kumpf          1.19     return _isRemoteNameSpace;
177 schuur         1.5  }
178                     
179 kumpf          1.19 String ProviderIdContainer::getRemoteInfo() const
180 schuur         1.5  {
181 kumpf          1.19     return _remoteInfo;
182 schuur         1.5  }
183                     
184 chip           1.11 //
185                     // CachedClassDefinitionContainer
186                     //
187                     
188 kumpf          1.19 const String CachedClassDefinitionContainer::NAME =
189                         "CachedClassDefinitionContainer";
190 chip           1.11 
191 kumpf          1.19 CachedClassDefinitionContainer::CachedClassDefinitionContainer(
192                         const OperationContext::Container& container)
193 chip           1.11 {
194 kumpf          1.19     const CachedClassDefinitionContainer* p =
195                             dynamic_cast<const CachedClassDefinitionContainer*>(&container);
196 chip           1.11 
197 kumpf          1.19     if (p == 0)
198 chip           1.11     {
199                             throw DynamicCastFailedException();
200                         }
201                     
202                         *this = *p;
203                     }
204                     
205                     
206 kumpf          1.19 CachedClassDefinitionContainer::CachedClassDefinitionContainer(
207                         const CIMClass& cimClass)
208 chip           1.11     : _cimClass(cimClass)
209                     {
210                     }
211                     
212 kumpf          1.19 CachedClassDefinitionContainer::~CachedClassDefinitionContainer()
213 chip           1.11 {
214                     }
215                     
216 kumpf          1.19 CachedClassDefinitionContainer& CachedClassDefinitionContainer::operator=(
217                         const CachedClassDefinitionContainer& container)
218 chip           1.11 {
219 kumpf          1.19     if (this == &container)
220 chip           1.11     {
221 kumpf          1.19         return *this;
222 chip           1.11     }
223                     
224                         _cimClass = container._cimClass;
225                     
226 kumpf          1.19     return *this;
227 chip           1.11 }
228                     
229 kumpf          1.19 String CachedClassDefinitionContainer::getName() const
230 chip           1.11 {
231 kumpf          1.19     return NAME;
232 chip           1.11 }
233                     
234 kumpf          1.19 OperationContext::Container* CachedClassDefinitionContainer::clone() const
235 chip           1.11 {
236 kumpf          1.19     return new CachedClassDefinitionContainer(*this);
237 chip           1.11 }
238                     
239 kumpf          1.19 void CachedClassDefinitionContainer::destroy()
240 chip           1.11 {
241                         delete this;
242                     }
243                     
244 kumpf          1.19 CIMClass CachedClassDefinitionContainer::getClass() const
245 chip           1.11 {
246 kumpf          1.19     return _cimClass;
247 chip           1.11 }
248                     
249 a.dunfey       1.16 //
250                     // NormalizerContextContainer
251                     //
252                     
253                     const String NormalizerContextContainer::NAME = "NormalizerContextContainer";
254                     
255                     NormalizerContextContainer::NormalizerContextContainer(
256 kumpf          1.19     const OperationContext::Container& container)
257 a.dunfey       1.16 {
258 kumpf          1.19     const NormalizerContextContainer* p =
259                             dynamic_cast<const NormalizerContextContainer*>(&container);
260 a.dunfey       1.16 
261 kumpf          1.19     if (p == 0)
262 a.dunfey       1.16     {
263                             throw DynamicCastFailedException();
264                         }
265                     
266                         *this = *p;
267                     }
268                     
269                     
270                     NormalizerContextContainer::NormalizerContextContainer(
271 kumpf          1.19     AutoPtr<NormalizerContext>& context) : normalizerContext(context.get())
272 a.dunfey       1.16 {
273                       context.release();
274                     }
275                     
276 kumpf          1.18 NormalizerContextContainer::NormalizerContextContainer(
277 kumpf          1.19     const NormalizerContextContainer& container)
278 kumpf          1.18 #if defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) || \
279 mike           1.20     defined (PEGASUS_OS_DARWIN)
280 kumpf          1.18     : OperationContext::Container()
281                     #endif
282 marek          1.17 {
283 kumpf          1.19     if (this != &container)
284 marek          1.17     {
285                             normalizerContext.reset(container.normalizerContext->clone().release());
286                         }
287                     }
288                     
289 a.dunfey       1.16 NormalizerContextContainer::~NormalizerContextContainer()
290                     {
291                     }
292                     
293 kumpf          1.19 NormalizerContextContainer& NormalizerContextContainer::operator=(
294                         const NormalizerContextContainer& container)
295 a.dunfey       1.16 {
296 kumpf          1.19     if (this == &container)
297 a.dunfey       1.16     {
298 kumpf          1.19         return *this;
299 a.dunfey       1.16     }
300                     
301                         normalizerContext.reset(container.normalizerContext->clone().release());
302                     
303 kumpf          1.19     return *this;
304 a.dunfey       1.16 }
305                     
306                     String NormalizerContextContainer::getName() const
307                     {
308 kumpf          1.19     return NAME;
309 a.dunfey       1.16 }
310                     
311 kumpf          1.19 OperationContext::Container* NormalizerContextContainer::clone() const
312 a.dunfey       1.16 {
313 kumpf          1.19     return new NormalizerContextContainer(*this);
314 a.dunfey       1.16 }
315                     
316                     void NormalizerContextContainer::destroy()
317                     {
318                         delete this;
319                     }
320                     
321 kumpf          1.19 NormalizerContext* NormalizerContextContainer::getContext() const
322 a.dunfey       1.16 {
323                         return normalizerContext.get();
324                     }
325                     
326 kumpf          1.1  PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2