本文整理汇总了C++中CIMProperty::getPropagated方法的典型用法代码示例。如果您正苦于以下问题:C++ CIMProperty::getPropagated方法的具体用法?C++ CIMProperty::getPropagated怎么用?C++ CIMProperty::getPropagated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIMProperty
的用法示例。
在下文中一共展示了CIMProperty::getPropagated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test01
//.........这里部分代码省略.........
PEGASUS_TEST_ASSERT(class1.getQualifierCount() == 2);
CIMQualifier cq = class1.getQualifier( class1.findQualifier(
CIMName ("q1")));
PEGASUS_TEST_ASSERT(posQualifier <= class1.getQualifierCount());
class1.removeQualifier(posQualifier);
PEGASUS_TEST_ASSERT(class1.getQualifierCount() == 1);
PEGASUS_TEST_ASSERT(class1.findQualifier(CIMName ("q1")) == PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.findQualifier(CIMName ("q2")) == PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.isAssociation());
// ATTH: P3 Add tests for try block for outofbounds
//The property manipulation tests.
PEGASUS_TEST_ASSERT(class1.findProperty(
CIMName ("count")) != PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.findProperty(
CIMName ("message")) != PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.findProperty(
CIMName ("isActive")) == PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.getPropertyCount() == 2);
Uint32 posProperty;
posProperty = class1.findProperty(CIMName ("count"));
CIMConstProperty constprop = class1.getProperty(posProperty);
PEGASUS_TEST_ASSERT(constprop.getClassOrigin() == CIMName("YourClass"));
PEGASUS_TEST_ASSERT(constprop.getPropagated());
class1.removeProperty(posProperty);
PEGASUS_TEST_ASSERT(class1.findProperty(
CIMName ("message")) != PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.findProperty(
CIMName ("count")) == PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(class1.getPropertyCount() == 1);
CIMProperty cp = class1.getProperty( class1.findProperty
(CIMName ("message")));
PEGASUS_TEST_ASSERT(cp.getClassOrigin().isNull());
PEGASUS_TEST_ASSERT(!cp.getPropagated());
if(verbose)
{
XmlWriter::printClassElement(class1);
MofWriter::printClassElement(class1);
}
Buffer out;
MofWriter::appendClassElement(out, class1);
out.clear();
XmlWriter::appendClassElement(out, class1);
PEGASUS_TEST_ASSERT(!class1.isAbstract());
CIMName squal("q1");
PEGASUS_TEST_ASSERT(class1.findQualifier(squal) == PEG_NOT_FOUND);
PEGASUS_TEST_ASSERT(!class1.hasKeys());
Array<CIMName> keyNames;
class1.getKeyNames(keyNames);
示例2: if
void
CIMtoXML(CIMProperty const& cp, ostream& ostr)
{
bool isArray = false;
bool isRef = false;
if (cp.getName().empty())
{
OW_THROWCIMMSG(CIMException::FAILED, "property must have a name");
}
if (cp.getDataType())
{
isArray = cp.getDataType().isArrayType();
isRef = cp.getDataType().isReferenceType();
if (isArray)
{
ostr
<< "<PROPERTY.ARRAY NAME=\""
<< cp.getName()
<< "\" TYPE=\"";
CIMtoXML(cp.getDataType(), ostr);
ostr << "\" ";
if (cp.getDataType().getSize() != -1)
{
ostr
<< "ARRAYSIZE=\""
<< cp.getDataType().getSize()
<< "\" ";
}
}
else if (isRef)
{
ostr
<< "<PROPERTY.REFERENCE NAME=\""
<< cp.getName()
<< "\" REFERENCECLASS=\""
<< cp.getDataType().getRefClassName()
<< "\" ";
}
else
{
ostr
<< "<PROPERTY NAME=\""
<< cp.getName()
<< "\" TYPE=\"";
CIMtoXML(cp.getDataType(), ostr);
ostr << "\" ";
}
}
else
{
String msg("Property ");
msg += cp.getName();
msg += " has no type defined";
OW_THROWCIMMSG(CIMException::FAILED, msg.c_str());
}
if (!cp.getOriginClass().empty())
{
ostr
<< "CLASSORIGIN=\""
<< cp.getOriginClass()
<< "\" ";
}
if (cp.getPropagated())
{
ostr << "PROPAGATED=\"true\" ";
}
CIMValue val = cp.getValue();
if (cp.getDataType().isEmbeddedObjectType() || (val && val.getCIMDataType().isEmbeddedObjectType()))
{
ostr << "EmbeddedObject=\"object\" ";
}
ostr << '>';
for (size_t i = 0; i < cp.getQualifiers().size(); i++)
{
CIMtoXML(cp.getQualifiers()[i], ostr);
}
if (val)
{
// if there isn't an EmbeddedObject qualifier on an embedded object, then output one.
if (val.getType() == CIMDataType::EMBEDDEDINSTANCE || val.getType() == CIMDataType::EMBEDDEDCLASS)
{
if (!cp.getQualifier(CIMQualifier::CIM_QUAL_EMBEDDEDOBJECT))
{
CIMQualifier embeddedObject(CIMQualifier::CIM_QUAL_EMBEDDEDOBJECT);
embeddedObject.setValue(CIMValue(true));
CIMtoXML(embeddedObject, ostr);
}
}
CIMtoXML(val, ostr);
}
if (isArray)
{
ostr << "</PROPERTY.ARRAY>";
}
else if (isRef)
{
//.........这里部分代码省略.........