当前位置: 首页>>代码示例>>C++>>正文


C++ CIMPropertyList::getPropertyNameArray方法代码示例

本文整理汇总了C++中CIMPropertyList::getPropertyNameArray方法的典型用法代码示例。如果您正苦于以下问题:C++ CIMPropertyList::getPropertyNameArray方法的具体用法?C++ CIMPropertyList::getPropertyNameArray怎么用?C++ CIMPropertyList::getPropertyNameArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIMPropertyList的用法示例。


在下文中一共展示了CIMPropertyList::getPropertyNameArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: validateTextFormatParameters

void IndicationFormatter::validateTextFormatParameters (
    const CIMPropertyList & propertyList,
    const CIMClass & indicationClass,
    const Array<String> & textFormatParams)
{
    PEG_METHOD_ENTER (TRC_IND_FORMATTER,
	"IndicationFormatter::validateTextFormatParameters");

    Array <String> indicationClassProperties;
    String exceptionStr;

    // All the properties are selected
    if (propertyList.isNull ())
    {
       for (Uint32 i = 0; i < indicationClass.getPropertyCount (); i++)
       {
	   indicationClassProperties.append(
	       indicationClass.getProperty (i).getName ().getString());
       }
    }
    // partial properties are selected
    else
    {
        Array<CIMName> propertyNames = propertyList.getPropertyNameArray();

	for (Uint32 j = 0; j < propertyNames.size(); j++)
	{
	    indicationClassProperties.append(propertyNames[j].getString());
	}
    }

    // check if the textFormatParams is contained in the
    // indicationClassProperties
    for (Uint32 k = 0; k < textFormatParams.size(); k++)
    {
        if (!Contains(indicationClassProperties, textFormatParams[k]))
	{
	    // The property name in TextFormatParameters is not
	    // included in the select clause of the associated filter query
	    MessageLoaderParms parms(
	    "IndicationFormatter.IndicationFormatter._MSG_MISS_MATCHED_PROPERTY_NAME",
	    "The property name $0 in $1 does not match the properties in the select clause",
	    textFormatParams[k],
	    _PROPERTY_TEXTFORMATPARAMETERS.getString());

	    exceptionStr.append(MessageLoader::getMessage(parms));

	    PEG_METHOD_EXIT();
	    throw PEGASUS_CIM_EXCEPTION (
		CIM_ERR_INVALID_PARAMETER, exceptionStr);
	}
    }

    PEG_METHOD_EXIT();
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:55,代码来源:IndicationFormatter.cpp

示例2: filter

// KS Mar 05 - The following removal functions are very inefficient and should
// be optimized to avoid the multiple memory moves.  Actually, the remove
// qualifiers should be added as a function and optimized that once.
void CIMInstanceRep::filter(
    Boolean includeQualifiers,
    Boolean includeClassOrigin,
    const CIMPropertyList& propertyList)
{
    // Filter any qualifiers from this instance.
    if (!includeQualifiers && _qualifiers.getCount() > 0)
    {
        while (_qualifiers.getCount())
        {
            _qualifiers.removeQualifier(0);
        }
    }

    // For each property, remove if not in propertylist
    for (Uint32 i = 0 ; i < _properties.size(); i++)
    {
        CIMConstProperty p = getProperty(i);
        CIMName name = p.getName();
        Array<CIMName> pl = propertyList.getPropertyNameArray();
        if (propertyList.isNull() || Contains(pl, name))
        {
            // test ClassOrigin and possibly remove
            if (!includeClassOrigin)
            {
                _properties[i].setClassOrigin(CIMName());
            }
            // remove qualifiers if required.
            if (!includeQualifiers && _properties[i].getQualifierCount() > 0)
            {
                while (_properties[i].getQualifierCount() > 0)
                {
                    _properties[i].removeQualifier(0);
                }
            }
        }
        else
        {
            _properties.remove(i--);
        }
    }
    return;
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:46,代码来源:CIMInstanceRep.cpp

示例3: modifyInstance

/////////////////////////////////////////////////////////////////////////////
// WMIInstanceProvider::modifyInstance
//
// ///////////////////////////////////////////////////////////////////////////
void WMIInstanceProvider::modifyInstance(
    const String& nameSpace,
    const String& userName,
    const String& password,
    const CIMInstance& modifiedInstance,
    Boolean includeQualifiers,
    const CIMPropertyList& propertylist)
{
    PEG_METHOD_ENTER(TRC_WMIPROVIDER,"WMIClassProvider::modifyInstance()");

    HRESULT hr;
    CComPtr<IWbemClassObject> pClass;
    CComPtr<IWbemClassObject> pInstance;

    setup(nameSpace, userName, password);

    PEG_TRACE((TRC_WMIPROVIDER,
                  Tracer::LEVEL3,
                  "ModifyInstance() - nameSpace %s, userName %s",
                  nameSpace.getCString(),
                  userName.getCString()));

    if (!m_bInitialized)
    {
        PEG_TRACE((TRC_WMIPROVIDER, Tracer::LEVEL1,
            "WMIInstanceProvider::ModifyInstance - m_bInitilized= %x, "
            "throw CIM_ERR_FAILED exception",
            m_bInitialized));

        throw CIMException(CIM_ERR_FAILED);
    }

    // Check if the instance's class is valid.
    String className = modifiedInstance.getClassName().getString();

    if (!(_collector->getObject(&pClass, className)))
    {
        if (pClass)
            pClass.Release();

        throw CIMException(CIM_ERR_INVALID_CLASS);
    }
    else if (_collector->isInstance(pClass))
    {
        if (pClass)
            pClass.Release();

        throw CIMException(CIM_ERR_INVALID_PARAMETER);
    }

    if (pClass)
        pClass.Release();

    // Get the instance path
    CIMObjectPath objPath = modifiedInstance.getPath();

    // Get the name of the instance
    String instanceName = getObjectName(objPath);

    // Check if the instance exists
    if (!(_collector->getObject(&pInstance, instanceName)))
    {
        if (pInstance)
            pInstance.Release();

        throw CIMException(CIM_ERR_NOT_FOUND);
    }
    else if (!(_collector->isInstance(pInstance)))
    {
        if (pInstance)
            pInstance.Release();

        throw CIMException(CIM_ERR_INVALID_PARAMETER);
    }

    // Set the properties that are into propertylist
    Array<CIMName> listNames;
    listNames = propertylist.getPropertyNameArray();

    bool foundInArray;
    bool bPropertySet = false;

    for(Uint32 i = 0; i < modifiedInstance.getPropertyCount(); i++)
    {
        CComVariant v;
        CIMProperty property = modifiedInstance.getProperty(i).clone();
        String sPropName = property.getName().getString();

        // change only the properties defined into the array
        // if the array is null, change all properties
        if (propertylist.isNull())
        {
            foundInArray = true;
        }
        else
        {
//.........这里部分代码省略.........
开发者ID:rdobson,项目名称:openpegasus,代码行数:101,代码来源:WMIInstanceProvider.cpp


注:本文中的CIMPropertyList::getPropertyNameArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。