1 karl 1.22 //%2006////////////////////////////////////////////////////////////////////////
|
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 karl 1.22 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.2 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.4 // 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.2 // 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.17 //
|
21 kumpf 1.4 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.2 // 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.4 // 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.2 // 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_CIMPropertyList_h
35 #define Pegasus_CIMPropertyList_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/Array.h>
|
39 kumpf 1.7 #include <Pegasus/Common/CIMName.h>
|
40 kumpf 1.6 #include <Pegasus/Common/Linkage.h>
|
41 mike 1.2
42 PEGASUS_NAMESPACE_BEGIN
43
|
44 kumpf 1.3 class CIMPropertyListRep;
|
45 mike 1.2
|
46 kumpf 1.23 /**
47 The CIMPropertyList class represents a propertyList parameter in a CIM
48 operation request, as defined in the DMTF Specification for CIM
49 Operations over HTTP.
50
51 <p>This class consists of an array of property names and a flag
52 indicating whether the list is null. A null property list indicates
53 that no filtering is performed on the basis of this parameter. A
54 non-null property list indicates that any property not specified in the
55 list is to be filtered from the CIM operation response. (An empty
56 property list implies that all properties should be filtered from the
57 response.)
58
59 <p>A null property list is created by using the default constructor or the
60 clear method. An empty property list is created by setting the value to
61 an empty Array.
|
62 mike 1.2 */
63 class PEGASUS_COMMON_LINKAGE CIMPropertyList
64 {
65 public:
66
|
67 kumpf 1.23 /**
68 Constructs a null property list.
69 <p><b>Example:</b>
|
70 karl 1.13 <pre>
71 CIMPropertyList pl;
|
72 jim.wunderlich 1.21 assert(pl.isNull());
|
73 karl 1.13 </pre>
|
74 mike 1.2 */
75 CIMPropertyList();
76
|
77 kumpf 1.23 /**
78 Constructs a CIMPropertyList object from the value of a specified
79 CIMPropertyList object.
80 @param x The CIMPropertyList object from which to construct a new
81 CIMPropertyList object.
|
82 mike 1.2 */
83 CIMPropertyList(const CIMPropertyList& x);
84
|
85 kumpf 1.23 /**
86 Constructs a non-null property list with the specified property names.
87 <p><b>Example:</b>
|
88 karl 1.13 <pre>
89 Array<CIMName> n;
90 n.append("name");
91 n.append("type");
92 CIMPropertyList pl(n);
93 </pre>
|
94 kumpf 1.23 @param propertyNames An Array of CIMNames specifying the property
95 names in the list.
|
96 mike 1.2 */
|
97 kumpf 1.7 CIMPropertyList(const Array<CIMName>& propertyNames);
|
98 mike 1.2
|
99 kumpf 1.23 /**
100 Destructs the CIMPropertyList object.
|
101 kumpf 1.3 */
102 ~CIMPropertyList();
103
|
104 kumpf 1.23 /**
105 Sets the property list with the specified property names. The
106 resulting property list is non-null.
107 <p><b>Example:</b>
|
108 karl 1.13 <pre>
109 Array<CIMName> n;
110 n.append("name");
111 n.append("type");
112 CIMPropertyList pl;
113 pl.set(n);
|
114 kumpf 1.23 assert(pl.size() = 2);
|
115 karl 1.13 </pre>
|
116 kumpf 1.23 @param propertyNames An Array of CIMNames specifying the property
117 names in the list.
|
118 mike 1.2 */
|
119 kumpf 1.7 void set(const Array<CIMName>& propertyNames);
|
120 mike 1.2
|
121 kumpf 1.23 /**
122 Assigns the value of the specified CIMPropertyList object to this
123 object.
124 @param x The CIMPropertyList object from which to assign this
125 CIMPropertyList object.
126 @return A reference to this CIMPropertyList object.
|
127 mike 1.2 */
128 CIMPropertyList& operator=(const CIMPropertyList& x);
129
|
130 kumpf 1.23 /**
131 Sets the property list to a null value.
|
132 mike 1.2 */
133 void clear();
134
|
135 kumpf 1.23 /**
136 Determines whether the property list is null.
137 @return True if the property list is null, false otherwise.
|
138 mike 1.2 */
|
139 kumpf 1.3 Boolean isNull() const;
|
140 mike 1.2
|
141 kumpf 1.23 /**
142 Gets the number of property names in the property list.
143 @return An integer count of the property names in the CIMPropertyList.
144 A value of 0 is returned if the list is null or empty.
|
145 mike 1.2 */
|
146 kumpf 1.5 Uint32 size() const;
|
147 mike 1.2
|
148 kumpf 1.23 /**
149 Gets the property name at a specified index.
150 <p><b>Example:</b>
151 <pre>
152 Array<CIMName> n;
153 n.append("name");
154 n.append("type");
155 CIMPropertyList pl(n);
156 assert(pl[0] == CIMName("name"));
157 </pre>
158 @param index The index of the property name to be retrieved.
159 @return A CIMName containing the property name at the specified index.
160 @exception IndexOutOfBoundsException If the index is outside the
161 range of property names in the property list or if the property
162 list is null.
|
163 mike 1.2 */
|
164 kumpf 1.8 const CIMName& operator[](Uint32 index) const;
|
165 mike 1.2
|
166 kumpf 1.23 /**
167 Gets an Array of the property names in the property list.
168 <p><b>Example:</b>
|
169 karl 1.13 <pre>
170 Array<CIMName> n = pl.getPropertyNameArray();
171 </pre>
|
172 kumpf 1.23 @return An Array of CIMName objects containing the property names
173 in the property list.
|
174 mike 1.2 */
|
175 kumpf 1.7 Array<CIMName> getPropertyNameArray() const;
|
176 mike 1.2
177 private:
178
|
179 a.arora 1.15 CIMPropertyListRep* _rep;
|
180 mike 1.2 };
181
182 PEGASUS_NAMESPACE_END
183
184 #endif /* Pegasus_CIMPropertyList_h */
|