本文整理汇总了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;
}
示例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;
}
示例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;
}