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

  1 martin 1.26 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.27 //
  3 martin 1.26 // 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.27 //
 10 martin 1.26 // 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.27 //
 17 martin 1.26 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.27 //
 20 martin 1.26 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.27 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.26 // 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.27 //
 28 martin 1.26 //////////////////////////////////////////////////////////////////////////
 29 mike   1.2  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             #ifndef Pegasus_ParamValueRep_h
 33             #define Pegasus_ParamValueRep_h
 34             
 35             #include <Pegasus/Common/Config.h>
 36 kumpf  1.12 #include <Pegasus/Common/InternalException.h>
 37 mike   1.2  #include <Pegasus/Common/String.h>
 38 kumpf  1.4  #include <Pegasus/Common/CIMValue.h>
 39 kumpf  1.11 #include <Pegasus/Common/Linkage.h>
 40 mike   1.18 #include <Pegasus/Common/Buffer.h>
 41 mike   1.2  
 42             PEGASUS_NAMESPACE_BEGIN
 43             
 44 thilo.boehm 1.24 class CIMParamValueRep
 45 mike        1.2  {
 46                  public:
 47                  
 48                      CIMParamValueRep(
 49 kumpf       1.21         String parameterName,
 50                          CIMValue value,
 51                          Boolean isTyped=true);
 52 mike        1.2  
 53 kumpf       1.21     const String & getParameterName() const
 54                      {
 55                          return _parameterName;
 56 mike        1.2      }
 57                  
 58 kumpf       1.21     const CIMValue & getValue() const
 59                      {
 60                          return _value;
 61 mike        1.2      }
 62                  
 63 kumpf       1.21     Boolean isTyped() const
 64                      {
 65                          return _isTyped;
 66 kumpf       1.6      }
 67                  
 68                      void setParameterName(String& parameterName);
 69 mike        1.2  
 70 kumpf       1.5      void setValue(CIMValue& value);
 71 mike        1.2  
 72 kumpf       1.6      void setIsTyped(Boolean isTyped);
 73                  
 74 mike        1.2      CIMParamValueRep* clone() const
 75                      {
 76 kumpf       1.21         return new CIMParamValueRep(*this);
 77 mike        1.2      }
 78                  
 79 thilo.boehm 1.24     void Inc()
 80                      {
 81                         _refCounter++;
 82                      }
 83                  
 84                      void Dec()
 85                      {
 86                          if (_refCounter.decAndTestIfZero())
 87                              delete this;
 88                      }
 89                  
 90 mike        1.2  private:
 91                  
 92                      CIMParamValueRep(const CIMParamValueRep& x);
 93                  
 94 kumpf       1.22     CIMParamValueRep();    // Unimplemented
 95                      CIMParamValueRep& operator=(const CIMParamValueRep& x);    // Unimplemented
 96 mike        1.2  
 97 kumpf       1.6      String _parameterName;
 98 mike        1.2      CIMValue _value;
 99 kumpf       1.6      Boolean _isTyped;
100 thilo.boehm 1.24 
101                      // reference counter as member to avoid
102                      // virtual function resolution overhead
103                      AtomicInt _refCounter;
104                  
105 mike        1.25     friend class CIMBuffer;
106 mike        1.2  };
107                  
108                  PEGASUS_NAMESPACE_END
109                  
110                  #endif /* Pegasus_ParamValueRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2