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

  1 karl  1.18 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.17 // 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.12 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.17 // 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.18 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.2  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.4  // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16 mike  1.2  // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18 karl  1.17 // 
 19 kumpf 1.4  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.2  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22 kumpf 1.4  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25 mike  1.2  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            //%/////////////////////////////////////////////////////////////////////////////
 31            
 32            #ifndef Pegasus_CIMPropertyList_h
 33            #define Pegasus_CIMPropertyList_h
 34            
 35            #include <Pegasus/Common/Config.h>
 36            #include <Pegasus/Common/Array.h>
 37 kumpf 1.7  #include <Pegasus/Common/CIMName.h>
 38 kumpf 1.6  #include <Pegasus/Common/Linkage.h>
 39 mike  1.2  
 40            PEGASUS_NAMESPACE_BEGIN
 41            
 42 kumpf 1.3  class CIMPropertyListRep;
 43 mike  1.2  
 44 kumpf 1.9  /** The CIMPropertyList class is used to represent a list of CIM
 45                properties in Pegasus.
 46 mike  1.2  
 47                This class comprises an array of propertyNames and a flag indicating whether
 48 karl  1.10     the list is null. There are three possibilities which must be represented by
 49 karl  1.13     the CIMPropertyList object because the CIMOperations that use CIMPropertyList
 50 karl  1.10     define functional differences based on these three conditions.
 51                The property list is:
 52 mike  1.2  
 53                <ul>
 54 karl  1.13     <li>Non-empty (and non-null) - Operations where some properties are to be
 55                returned by the operation. The values in the list are valid property names.
 56                <li>Empty (and non-null)- Operations where NO properties are to be
 57                returned by the operation. The propertyList is empty but not Null.
 58                <li>Null - Operations where there is no propertyList filter. The list
 59            .       is Null (a specific attributed of the list).  There are, of course,
 60                    no properties in the list.
 61 mike  1.2      </ul>
 62            
 63 karl  1.11     To create a null property list use the default constructor or use the
 64                clear() method.
 65 karl  1.13 
 66 karl  1.11     To create an empty property list use the constructor which takes
 67                a property array (pass an empty property array which produces an empty
 68                but not Null property list object).
 69 mike  1.2  
 70 kumpf 1.9      Methods are provided for accessing elements of the the internal property
 71 mike  1.2      list. There are none for modifying elements (the entire array must be
 72                formed and passed to the constructor or replaced by calling set()).
 73            */
 74            class PEGASUS_COMMON_LINKAGE CIMPropertyList
 75            {
 76            public:
 77            
 78 karl  1.13     /** Default constructor (sets isNull attribute of the list to true).
 79                    An array created with this constructor is Null.
 80                    <pre>
 81                        CIMPropertyList pl;
 82 dave.sudlik 1.19             assert(pl.isNull());
 83 karl        1.13         </pre>
 84 mike        1.2      */
 85                      CIMPropertyList();
 86                  
 87 karl        1.13     /** Copies the property list to the value specified for the parameter x.
 88                          @param x Specifies the name of the CIMPropertyList object to be copied.
 89 mike        1.2      */
 90                      CIMPropertyList(const CIMPropertyList& x);
 91                  
 92 karl        1.13     /** Constructor that initializes propertyNames and creates an array with
 93                          non-null values (sets isNull to false).
 94                          @param Array of CIMNames with which the propertyList object is
 95                          initialized. For example:
 96                          <pre>
 97                              Array<CIMName> n;
 98                              n.append("name");
 99                              n.append("type");
100                              CIMPropertyList pl(n);
101                          </pre>
102 mike        1.2      */
103 kumpf       1.7      CIMPropertyList(const Array<CIMName>& propertyNames);
104 mike        1.2  
105 karl        1.13     /** CIMPropertyList destructor.
106 kumpf       1.3      */
107                      ~CIMPropertyList();
108                  
109 karl        1.10     /** Modifier for propertyNames (sets isNull to false) and
110 karl        1.13         sets the CIMName values in the input array into the
111                          propertyList object.
112                          @param Array of CIMNames. For example:
113                          <pre>
114                              Array<CIMName> n;
115                              n.append("name");
116                              n.append("type");
117                              CIMPropertyList pl;
118                              pl.set(n);
119                              assert pl.size() = 2);
120                          </pre>
121 mike        1.2      */
122 kumpf       1.7      void set(const Array<CIMName>& propertyNames);
123 mike        1.2  
124 karl        1.13     /** Assigns the values of the CIMPropertyList instance to the 
125                          CIMPropertyList.
126                          @param x Specifies the name of the CIMPropertyList instance 
127                          whose values are to be assigned to the CIMPropertyList object.
128 mike        1.2      */
129                      CIMPropertyList& operator=(const CIMPropertyList& x);
130                  
131                      /** Clears the propertyNames array (sets isNull to true).
132                      */
133                      void clear();
134                  
135                      /** Returns true if the property list is null.
136 karl        1.13         @return A Boolean value of true if the property list is Null.
137                          It may be null because it was created without input or because it
138                          was set to Null with the clear() method. Otherwise, a value of
139                          false is returned.  For example:
140                          <pre>
141                              CIMPropertyList pl;
142                              assert(pl.isNull());    // Newly created object is Null
143                          </pre>
144                          Therefore the a new instance of the CIMPropertyList object is
145                          created, pl, with null values.
146 mike        1.2      */
147 kumpf       1.3      Boolean isNull() const;
148 mike        1.2  
149 karl        1.13     /** Returns the number of propertyNames in the list.
150 karl        1.11         @return Uint32 with count of number of properties in the
151                          list. Returns 0 if property list is Null but this is not
152                          sufficient to determine if it is Null. Use isNull to determine
153                          if it is Null.
154 mike        1.2      */
155 kumpf       1.5      Uint32 size() const;
156 mike        1.2  
157 karl        1.13     /** Return the property at the given index.
158                          @param index Specifies the index value that contains the property
159                          list to retrieve.
160                          @return CIMName at the defined location.
161                          @exception out_of_index exception if the index is
162                          outside of the size of the propertyList. For example:
163                      <pre>
164                          Array<CIMName> n;
165                          n.append("name");
166                          n.append("type");
167 dave.sudlik 1.19         CIMPropertyList pl(n);
168 karl        1.13         assert(pl[0] == CIMName("name"));
169                      </pre>
170 mike        1.2      */
171 kumpf       1.8      const CIMName& operator[](Uint32 index) const;
172 mike        1.2  
173 karl        1.10     /** Get an array of the property names.
174 karl        1.13         @return Array of CIMName containing the property names
175                          from the propertyList object.
176                          <pre>
177                              Array<CIMName> n = pl.getPropertyNameArray();
178                          </pre>
179 mike        1.2      */
180 kumpf       1.7      Array<CIMName> getPropertyNameArray() const;
181 mike        1.2  
182                  private:
183                  
184 a.arora     1.15     CIMPropertyListRep* _rep;
185 mike        1.2  };
186                  
187                  PEGASUS_NAMESPACE_END
188                  
189                  #endif /* Pegasus_CIMPropertyList_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2