CIMPropertyList Class Reference

#include <CIMPropertyList.h>

Public Member Functions

 CIMPropertyList ()
 
 CIMPropertyList (const CIMPropertyList &x)
 
 CIMPropertyList (const Array< CIMName > &propertyNames)
 
 ~CIMPropertyList ()
 
void set (const Array< CIMName > &propertyNames)
 
CIMPropertyListoperator= (const CIMPropertyList &x)
 
void clear ()
 
Boolean isNull () const
 
Uint32 size () const
 
const CIMNameoperator[] (Uint32 index) const
 
Array< CIMNamegetPropertyNameArray () const
 
Uint32 getCIMNameTag (Uint32 index) const
 
void append (Array< String > &propertyListArray)
 
void appendCIMNameTag (Uint32 nameTag)
 
Boolean contains (const CIMName &name) const
 
Boolean useThisProperty (const CIMName &name) const
 
String toString () const
 

Detailed Description

The CIMPropertyList class represents a propertyList parameter in a CIM operation request, as defined in the DMTF Specification for CIM Operations over HTTP.

This class consists of an array of property names and a flag indicating whether the list is null. A null property list indicates that no filtering is performed on the basis of this parameter. A non-null property list indicates that any property not specified in the list is to be filtered from the CIM operation response. (An empty property list implies that all properties should be filtered from the response.)

A null property list is created by using the default constructor or the clear method. An empty property list is created by setting the value to an empty Array.

Constructor & Destructor Documentation

◆ CIMPropertyList() [1/3]

CIMPropertyList::CIMPropertyList ( )

Constructs a null property list.

Example:

    CIMPropertyList pl;
    assert(pl.isNull());

◆ CIMPropertyList() [2/3]

CIMPropertyList::CIMPropertyList ( const CIMPropertyList x)

Constructs a CIMPropertyList object from the value of a specified CIMPropertyList object.

Parameters
xThe CIMPropertyList object from which to construct a new CIMPropertyList object.

◆ CIMPropertyList() [3/3]

CIMPropertyList::CIMPropertyList ( const Array< CIMName > &  propertyNames)

Constructs a non-null property list with the specified property names.

Example:

    Array<CIMName> n;
    n.append("name");
    n.append("type");
    CIMPropertyList pl(n);
Parameters
propertyNamesAn Array of CIMNames specifying the property names in the list. UninitializedObjectException if any CIMName in the array argument is NULL

◆ ~CIMPropertyList()

CIMPropertyList::~CIMPropertyList ( )

Destructs the CIMPropertyList object.

Member Function Documentation

◆ clear()

void CIMPropertyList::clear ( )

Sets the property list to a null value.

◆ contains()

Boolean CIMPropertyList::contains ( const CIMName name) const

Determine if the propertylist contains the property name defined in the input argument. This does not cover the concept of NULL propertylist. A NULL or empty list will return false.

Parameters
nameCIMName containing the property name to be matched against the propertylist
Returns
True if the argument name is in the list. Otherwise returns false.
Version
2.14

◆ getPropertyNameArray()

Array<CIMName> CIMPropertyList::getPropertyNameArray ( ) const

Gets an Array of the property names in the property list.

Example:

    Array<CIMName> n = pl.getPropertyNameArray();
Returns
An Array of CIMName objects containing the property names in the property list.

◆ isNull()

Boolean CIMPropertyList::isNull ( ) const

Determines whether the property list is null.

Returns
True if the property list is null, false otherwise.

◆ operator=()

CIMPropertyList& CIMPropertyList::operator= ( const CIMPropertyList x)

Assigns the value of the specified CIMPropertyList object to this object.

Parameters
xThe CIMPropertyList object from which to assign this CIMPropertyList object.
Returns
A reference to this CIMPropertyList object.

◆ operator[]()

const CIMName& CIMPropertyList::operator[] ( Uint32  index) const

Gets the property name at a specified index.

Example:

    Array<CIMName> n;
    n.append("name");
    n.append("type");
    CIMPropertyList pl(n);
    assert(pl[0] == CIMName("name"));
Parameters
indexThe index of the property name to be retrieved.
Returns
A CIMName containing the property name at the specified index.
Exceptions
IndexOutOfBoundsExceptionIf the index is outside the range of property names in the property list or if the property list is null.

◆ set()

void CIMPropertyList::set ( const Array< CIMName > &  propertyNames)

Sets the property list with the specified property names. The resulting property list is non-null.

Example:

    Array<CIMName> n;
    n.append("name");
    n.append("type");
    CIMPropertyList pl;
    pl.set(n);
    assert(pl.size() = 2);
Parameters
propertyNamesAn Array of CIMNames specifying the property names in the list. UninitializedObjectException if any CIMName in the array argument is NULL

◆ size()

Uint32 CIMPropertyList::size ( ) const

Gets the number of property names in the property list.

Returns
An integer count of the property names in the CIMPropertyList. A value of 0 is returned if the list is null or empty.

◆ toString()

String CIMPropertyList::toString ( ) const

Return as a String the comma-separated list of property names in a property list. If the list is empty or NULL set the corresponding string value (EMPTY or NULL). This method is only for display of information in a property list.

Returns
String containing the list of properties comma-separated.

◆ useThisProperty()

Boolean CIMPropertyList::useThisProperty ( const CIMName name) const

Convience function to determine if the propertyList is either NULL or the property is in the list. This can be used as a single method by a provider to determine if a property is to be included in the response

Parameters
nameCIMName containing the property name to be matched against the propertylist
Returns
True if the argument name is in the list or the list is null. Otherwise returns false.
Version
2.14

Example:

    if (p.useThisProperty("prop1")
        instance.addProperty("prop1",...);
    if (p.useThisProperty("prop2")
        instance.addProperty("prop2",,,,);

The documentation for this class was generated from the following file: