本文整理汇总了C++中CIMParamValue::isUninitialized方法的典型用法代码示例。如果您正苦于以下问题:C++ CIMParamValue::isUninitialized方法的具体用法?C++ CIMParamValue::isUninitialized怎么用?C++ CIMParamValue::isUninitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIMParamValue
的用法示例。
在下文中一共展示了CIMParamValue::isUninitialized方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testUninitializedObject
void testUninitializedObject()
{
CIMParamValue uninitializedParamValue;
String name("name");
CIMValue value(String("value"));
PEGASUS_TEST_ASSERT(uninitializedParamValue.isUninitialized());
// Copy constructor allows an uninitialized object
{
CIMParamValue initializedParamValue(uninitializedParamValue);
}
// Assignment operator allows an uninitialized object
{
CIMParamValue initializedParamValue(name, value);
initializedParamValue = uninitializedParamValue;
}
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.getParameterName());
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.getValue());
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.isTyped());
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.setParameterName(name));
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.setValue(value));
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.setIsTyped(true));
TEST_UNINITIALIZED_OBJECT_EXCEPTION(
uninitializedParamValue.clone());
}
示例2: deliverParamValue
void InvokeMethodResponseHandler::deliverParamValue(const CIMParamValue & cimParamValue)
{
if(cimParamValue.isUninitialized())
{
MessageLoaderParms message(
"Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
"The object is not initialized.");
throw CIMException(CIM_ERR_FAILED, message);
}
SimpleMethodResultResponseHandler::deliverParamValue(cimParamValue);
}
示例3: test01
void test01()
{
CIMParamValue pv;
PEGASUS_TEST_ASSERT(pv.isUninitialized());
String p1("message");
CIMValue v1(String("argument_Test"));
CIMParamValue a1(p1, v1);
// Test call to CIMParamValue::setValue(CIMValue& value)
// this test uses the above values for a1, p1 and v1.
CIMParamValue a7(p1, v1);
CIMValue v7(String("argument_Test7"));
a7.setValue( v7);
PEGASUS_TEST_ASSERT(a1.getValue().toString() != a7.getValue().toString());
PEGASUS_TEST_ASSERT(a1.getParameterName() == a7.getParameterName());
// Test call to CIMParamValue::setParameterName(String& parameterName)
// this test uses the above values for a1, p1 and v1.
CIMParamValue a8(p1, v1);
String p8("message8");
a8.setParameterName( p8);
PEGASUS_TEST_ASSERT(a1.getValue().toString() == a8.getValue().toString());
PEGASUS_TEST_ASSERT(a1.getParameterName() != a8.getParameterName());
PEGASUS_TEST_ASSERT(a8.isTyped());
a8.setIsTyped(false);
PEGASUS_TEST_ASSERT(!a8.isTyped());
String p2("message2");
CIMValue v2(String("argument_Test2"));
CIMParamValue a2(p2, v2);
String p3("message3");
CIMValue v3(String("argument_Test3"));
CIMParamValue a3(p3, v3);
String p4("message4");
CIMValue v4(String("argument_Test4"));
CIMParamValue a4(p4, v4);
CIMParamValue a5 = a4;
String p6("message6");
CIMValue v6(String("argument_Test6"));
CIMParamValue a6(p6, v6);
Array<CIMParamValue> aa;
aa.append(a1);
aa.append(a2);
aa.append(CIMParamValue("message3", CIMValue(200000)));
aa.append(CIMParamValue("message4", CIMValue(String("test4"))));
//
// clone
//
CIMParamValue a4clone = a4.clone();
aa.append(a4clone);
if (verbose)
{
for (Uint32 i=0; i< aa.size(); i++)
{
XmlWriter::printParamValueElement(aa[i], cout);
}
}
//
// toXml
//
Buffer xmlOut;
XmlWriter::appendParamValueElement(xmlOut, a4clone);
}