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


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

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


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

示例1: getList

static CIMPropertyList getList(const char** l) {
  CIMPropertyList pl;
  if (l) {
    Array<CIMName> n;
    while (*l) {
      n.append(*l++);
    }
    pl.set(n);
  }
  return pl;
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:11,代码来源:CMPI_Broker.cpp

示例2: getPropertyList

CIMPropertyList WQLSelectStatementRep::getPropertyList(
        const CIMObjectPath& inClassName)
{
    if(_ctx == NULL){
        MessageLoaderParms parms(
            "WQL.WQLSelectStatementRep.QUERY_CONTEXT_IS_NULL",
            "Trying to process a query with a NULL Query Context.");
      throw QueryRuntimeException(parms);
    }

    if(_allProperties)
     return CIMPropertyList();

    CIMName className = inClassName.getClassName();
    if (className.isNull())
    {
     // If the caller passed in an empty className, then the
     // FROM class is to be used.
     className = _className;
    }

    // check if inClassName is the From class
    if(!(className == _className)){
        // check if inClassName is a subclass of the From class
        if(!_ctx->isSubClass(_className,className)){
            MessageLoaderParms parms(
                "WQL.WQLSelectStatementRep.CLASS_NOT_FROM_LIST_CLASS",
                "Class $0 does not match the FROM class or any of its"
                    " subclasses.",
                className.getString());
            throw QueryRuntimeException(parms);
        }
    }

    Array<CIMName> names =
            getWherePropertyList(inClassName).getPropertyNameArray();
    Array<CIMName> selectList =
            getSelectPropertyList(inClassName).getPropertyNameArray();

    // check for duplicates and remove them
    for(Uint32 i = 0; i < names.size(); i++){
        for(Uint32 j = 0; j < selectList.size(); j++){
            if(names[i] == selectList[j])
                selectList.remove(j);
            }
    }

    names.appendArray(selectList);
    CIMPropertyList list = CIMPropertyList();
    list.set(names);
    return list;
}
开发者ID:xenserver,项目名称:openpegasus,代码行数:52,代码来源:WQLSelectStatementRep.cpp

示例3: main


//.........这里部分代码省略.........
    // Class B Refrence Names Test
    ASRT(testReferenceNames(CIMObjectPath("TST_ClassB"), CIMName(), "", 4));
    ASRT(testReferenceNames(CIMObjectPath("TST_ClassB"), CIMName(), "to", 2));
    ASRT(testReferenceNames(CIMObjectPath("TST_ClassB"), CIMName(), "from", 4));

    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI2"), "", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI2"), "to", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI2"), "from", 1));

    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI2"), "", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI2"), "to", 0));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI2"), "from", 1));

    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI5"), "", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI5"), "to", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassB"), CIMName("TST_AssocI5"), "from", 1));

    // TODO TestReferences for class c and class d

    // testRefernceName Instances from static store
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""), CIMName(), "", 2));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""), CIMName(), "to", 2));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""), CIMName(), "from", 2));

    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI1"), "", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI1"), "to", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI1"), "from", 1));

    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI3"), "", 1));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI3"), "to", 0));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI3"), "from", 1));

    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI5"), "", 0));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI5"), "to", 0));
    ASRT(testReferenceNames(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName("TST_AssocI5"), "from", 0));

    // Lets make the previous a common test between ref and ref names.

    // References
    // Limited test since we learned most in the previous test of reference
    // names
    CIMPropertyList NullPL;

    CIMPropertyList emptyPL;

    CIMPropertyList fullPL;
    Array<CIMName> fullPLinput;
    fullPLinput.append("name");
    fullPL.set(fullPLinput);


    CIMPropertyList errorPL;
    Array<CIMName> errorPLinput;
    errorPLinput.append("junk");
    errorPL.set(errorPLinput);

    ASRT(testReferences(CIMObjectPath("TST_ClassA"), CIMName(), "", emptyPL,2));

    ASRT(testReferences(
        CIMObjectPath("TST_ClassA.name=\"InstanceA1\""),
        CIMName(), "", fullPL,2));

    // Testing associators and and associator names functions.

    ASRT(testAssocNames(
        CIMObjectPath("TST_ClassA"), CIMName(), CIMName(), "", "", 3));

    cout << "+++++ passed all tests" << endl;
    return 0;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:101,代码来源:AssociationTestProvider.cpp


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