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


C++ CIMParamValue::getValue方法代码示例

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


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

示例1:

void
CIMParamValueToXML(CIMParamValue const& pv, std::ostream& ostr)
{
	ostr << "<PARAMVALUE NAME=\"" << pv.getName() << "\"";
	if (pv.getValue())
	{
		String type = pv.getValue().getCIMDataType().toString();
		if (type == "REF")
		{
			type = "reference";
		}
		ostr << " PARAMTYPE=\"" << type << "\"";
		
		if (pv.getValue().getCIMDataType().isEmbeddedObjectType())
		{
			ostr << " EmbeddedObject=\"object\"";
		}

		ostr << ">";
		CIMtoXML(pv.getValue(), ostr);
	}
	else
	{
		ostr << '>';
	}
	ostr << "</PARAMVALUE>";
}
开发者ID:kkaempf,项目名称:openwbem,代码行数:27,代码来源:OW_CIMtoXML.cpp

示例2: 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());
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:34,代码来源:ParamValue.cpp

示例3: invokeMethod

void UNIX_BGPEndpointStatisticsProvider::invokeMethod(
	const OperationContext& context,
	const CIMObjectPath& objectReference,
	const CIMName& methodName,
	const Array<CIMParamValue>& inParameters,
	MethodResultResponseHandler& handler)
{
	if (!objectReference.getClassName().equal("UNIX_BGPEndpointStatistics") && !objectReference.getClassName().equal("CIM_BGPEndpointStatistics")) {
		String classMessage;
		classMessage.append("UNIX_BGPEndpointStatistics Provider");
		classMessage.append (" does not support class ");
		classMessage.append (objectReference.getClassName().getString());
		throw CIMNotSupportedException(classMessage);
	}


	handler.processing();
	// Make cimom handle invokeMethod request with input parameters.
	CIMObjectPath localReference = CIMObjectPath(
		String(""),
		CIMNamespaceName("root/cimv2"),
		objectReference.getClassName(),
		objectReference.getKeyBindings());
	
	if (methodName.equal("ResetSelectedStats")) {

		if (inParameters.size() != 1)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking ResetSelectedStats method.
		Uint32 invokeResetSelectedStatsReturnValue;

		Array<String> inSelectedStatistics;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "SelectedStatistics"))
			{
				p.getValue().get(inSelectedStatistics);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeResetSelectedStatsReturnValue = _p.invokeResetSelectedStats(

			inSelectedStatistics
		);
		_p.finalize();
		handler.deliver(invokeResetSelectedStatsReturnValue);

	}
	else {
		String message;
		message.append("UNIX_BGPEndpointStatistics");
		message.append (" does not support invokeMethod");
		throw CIMNotSupportedException(message);
	}
}
开发者ID:brunolauze,项目名称:openpegasus-providers,代码行数:60,代码来源:UNIX_BGPEndpointStatisticsProvider.cpp

示例4: extractInstanceParameter

CIMInstance CIMHelper::extractInstanceParameter(const Array<CIMParamValue>& inParameters, String name)
{
    for(Uint32 i = 0; i < inParameters.size(); i++)
    {
    	CIMParamValue paramValue = inParameters[i];
    	CIMName paramName = paramValue.getParameterName();
    	if (paramName.equal(name))
    	{
    		CIMInstance value;
    		paramValue.getValue().get(value);
    		return value;
    	}
    }
    return CIMInstance();
}
开发者ID:brunolauze,项目名称:pegasus-providers,代码行数:15,代码来源:CIMHelper.cpp

示例5: extractStringParameter

String CIMHelper::extractStringParameter(const Array<CIMParamValue>& inParameters, String name)
{
    for(Uint32 i = 0; i < inParameters.size(); i++)
    {
    	CIMParamValue paramValue = inParameters[i];
    	CIMName paramName = paramValue.getParameterName();
    	if (paramName.equal(name))
    	{
    		String s;
    		paramValue.getValue().get(s);
    		return s;
    	}
    }
    return CIMHelper::EmptyString;
}
开发者ID:brunolauze,项目名称:pegasus-providers,代码行数:15,代码来源:CIMHelper.cpp

示例6: invokeMethod

void UNIX_AutonomousSystemProvider::invokeMethod(
	const OperationContext& context,
	const CIMObjectPath& objectReference,
	const CIMName& methodName,
	const Array<CIMParamValue>& inParameters,
	MethodResultResponseHandler& handler)
{
	if (!objectReference.getClassName().equal("UNIX_AutonomousSystem") && !objectReference.getClassName().equal("CIM_AutonomousSystem")) {
		String classMessage;
		classMessage.append("UNIX_AutonomousSystem Provider");
		classMessage.append (" does not support class ");
		classMessage.append (objectReference.getClassName().getString());
		throw CIMNotSupportedException(classMessage);
	}


	handler.processing();
	// Make cimom handle invokeMethod request with input parameters.
	CIMObjectPath localReference = CIMObjectPath(
		String(""),
		CIMNamespaceName("root/cimv2"),
		objectReference.getClassName(),
		objectReference.getKeyBindings());
	
	if (methodName.equal("RequestStateChange")) {

		if (inParameters.size() != 3)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking RequestStateChange method.
		Uint32 invokeRequestStateChangeReturnValue;

		Uint16 inRequestedState;
		CIMInstance inJob;
		CIMDateTime inTimeoutPeriod;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "RequestedState"))
			{
				p.getValue().get(inRequestedState);
			}
			if (String::equalNoCase(p.getParameterName(), "Job"))
			{
				p.getValue().get(inJob);
			}
			if (String::equalNoCase(p.getParameterName(), "TimeoutPeriod"))
			{
				p.getValue().get(inTimeoutPeriod);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeRequestStateChangeReturnValue = _p.invokeRequestStateChange(

			inRequestedState,
			inJob,
			inTimeoutPeriod
		);
		_p.finalize();
		handler.deliver(invokeRequestStateChangeReturnValue);

	}
	else {
		String message;
		message.append("UNIX_AutonomousSystem");
		message.append (" does not support invokeMethod");
		throw CIMNotSupportedException(message);
	}
}
开发者ID:brunolauze,项目名称:openpegasus-providers,代码行数:72,代码来源:UNIX_AutonomousSystemProvider.cpp

示例7: invokeMethod

void UNIX_CPUDiagnosticTestProvider::invokeMethod(
	const OperationContext& context,
	const CIMObjectPath& objectReference,
	const CIMName& methodName,
	const Array<CIMParamValue>& inParameters,
	MethodResultResponseHandler& handler)
{
	if (!objectReference.getClassName().equal("UNIX_CPUDiagnosticTest") && !objectReference.getClassName().equal("CIM_CPUDiagnosticTest")) {
		String classMessage;
		classMessage.append("UNIX_CPUDiagnosticTest Provider");
		classMessage.append (" does not support class ");
		classMessage.append (objectReference.getClassName().getString());
		throw CIMNotSupportedException(classMessage);
	}


	handler.processing();
	// Make cimom handle invokeMethod request with input parameters.
	CIMObjectPath localReference = CIMObjectPath(
		String(""),
		CIMNamespaceName("root/cimv2"),
		objectReference.getClassName(),
		objectReference.getKeyBindings());
	
	if (methodName.equal("RunTest")) {

		if (inParameters.size() != 3)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking RunTest method.
		Uint32 invokeRunTestReturnValue;

		CIMInstance inSystemElement;
		CIMInstance inSetting;
		CIMInstance inResult;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "SystemElement"))
			{
				p.getValue().get(inSystemElement);
			}
			if (String::equalNoCase(p.getParameterName(), "Setting"))
			{
				p.getValue().get(inSetting);
			}
			if (String::equalNoCase(p.getParameterName(), "Result"))
			{
				p.getValue().get(inResult);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeRunTestReturnValue = _p.invokeRunTest(

			inSystemElement,
			inSetting,
			inResult
		);
		_p.finalize();
		handler.deliver(invokeRunTestReturnValue);

	}
	else if (methodName.equal("ClearResults")) {

		if (inParameters.size() != 2)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking ClearResults method.
		Uint32 invokeClearResultsReturnValue;

		CIMInstance inSystemElement;
		Array<String> inResultsNotCleared;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "SystemElement"))
			{
				p.getValue().get(inSystemElement);
			}
			if (String::equalNoCase(p.getParameterName(), "ResultsNotCleared"))
			{
				p.getValue().get(inResultsNotCleared);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeClearResultsReturnValue = _p.invokeClearResults(

			inSystemElement,
			inResultsNotCleared
		);
		_p.finalize();
		handler.deliver(invokeClearResultsReturnValue);

	}
//.........这里部分代码省略.........
开发者ID:brunolauze,项目名称:openpegasus-providers,代码行数:101,代码来源:UNIX_CPUDiagnosticTestProvider.cpp

示例8: invokeMethod

void UNIX_AggregatePSExtentProvider::invokeMethod(
	const OperationContext& context,
	const CIMObjectPath& objectReference,
	const CIMName& methodName,
	const Array<CIMParamValue>& inParameters,
	MethodResultResponseHandler& handler)
{
	if (!objectReference.getClassName().equal("UNIX_AggregatePSExtent") && !objectReference.getClassName().equal("CIM_AggregatePSExtent")) {
		String classMessage;
		classMessage.append("UNIX_AggregatePSExtent Provider");
		classMessage.append (" does not support class ");
		classMessage.append (objectReference.getClassName().getString());
		throw CIMNotSupportedException(classMessage);
	}


	handler.processing();
	// Make cimom handle invokeMethod request with input parameters.
	CIMObjectPath localReference = CIMObjectPath(
		String(""),
		CIMNamespaceName("root/cimv2"),
		objectReference.getClassName(),
		objectReference.getKeyBindings());
	
	if (methodName.equal("SetPowerState")) {

		if (inParameters.size() != 2)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking SetPowerState method.
		Uint32 invokeSetPowerStateReturnValue;

		Uint16 inPowerState;
		CIMDateTime inTime;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "PowerState"))
			{
				p.getValue().get(inPowerState);
			}
			if (String::equalNoCase(p.getParameterName(), "Time"))
			{
				p.getValue().get(inTime);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeSetPowerStateReturnValue = _p.invokeSetPowerState(

			inPowerState,
			inTime
		);
		_p.finalize();
		handler.deliver(invokeSetPowerStateReturnValue);

	}
	else if (methodName.equal("Reset")) {

		if (inParameters.size() != 0)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking Reset method.
		Uint32 invokeResetReturnValue;

		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeResetReturnValue = _p.invokeReset();
		_p.finalize();
		handler.deliver(invokeResetReturnValue);

	}
	else if (methodName.equal("EnableDevice")) {

		if (inParameters.size() != 1)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking EnableDevice method.
		Uint32 invokeEnableDeviceReturnValue;

		Boolean inEnabled;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "Enabled"))
			{
				p.getValue().get(inEnabled);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeEnableDeviceReturnValue = _p.invokeEnableDevice(

			inEnabled
//.........这里部分代码省略.........
开发者ID:brunolauze,项目名称:openpegasus-providers,代码行数:101,代码来源:UNIX_AggregatePSExtentProvider.cpp

示例9: invokeMethod

void UNIX_BatchJobProvider::invokeMethod(
	const OperationContext& context,
	const CIMObjectPath& objectReference,
	const CIMName& methodName,
	const Array<CIMParamValue>& inParameters,
	MethodResultResponseHandler& handler)
{
	if (!objectReference.getClassName().equal("UNIX_BatchJob") && !objectReference.getClassName().equal("CIM_BatchJob")) {
		String classMessage;
		classMessage.append("UNIX_BatchJob Provider");
		classMessage.append (" does not support class ");
		classMessage.append (objectReference.getClassName().getString());
		throw CIMNotSupportedException(classMessage);
	}


	handler.processing();
	// Make cimom handle invokeMethod request with input parameters.
	CIMObjectPath localReference = CIMObjectPath(
		String(""),
		CIMNamespaceName("root/cimv2"),
		objectReference.getClassName(),
		objectReference.getKeyBindings());
	
	if (methodName.equal("RequestStateChange")) {

		if (inParameters.size() != 0)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking RequestStateChange method.
		Uint32 invokeRequestStateChangeReturnValue;

		Uint16 inRequestedState;
		CIMDateTime inTimeoutPeriod;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "RequestedState"))
			{
				p.getValue().get(inRequestedState);
			}
			if (String::equalNoCase(p.getParameterName(), "TimeoutPeriod"))
			{
				p.getValue().get(inTimeoutPeriod);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeRequestStateChangeReturnValue = _p.invokeRequestStateChange(

			inRequestedState,
			inTimeoutPeriod
		);
		_p.finalize();
		handler.deliver(invokeRequestStateChangeReturnValue);

	}
	else if (methodName.equal("GetError")) {

		if (inParameters.size() != 0)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking GetError method.
		Uint32 invokeGetErrorReturnValue;

		String inError;
		
		for(Uint32 pi = 0; pi < inParameters.size(); pi++) {
			CIMParamValue p = inParameters[pi];
			if (String::equalNoCase(p.getParameterName(), "Error"))
			{
				p.getValue().get(inError);
			}
		}
		_p.initialize();
		_p.find(localReference.getKeyBindings());
		invokeGetErrorReturnValue = _p.invokeGetError(

			inError
		);
		_p.finalize();
		handler.deliver(invokeGetErrorReturnValue);

	}
	else if (methodName.equal("GetErrors")) {

		if (inParameters.size() != 0)
		{
			throw new CIMOperationFailedException("Incorrect in parameters");
		}
		
		//Invoking GetErrors method.
		Uint32 invokeGetErrorsReturnValue;

		Array<String> inErrors;
		
//.........这里部分代码省略.........
开发者ID:brunolauze,项目名称:openpegasus-providers,代码行数:101,代码来源:UNIX_BatchJobProvider.cpp

示例10: invokeMethod

/**
    When the "PropagateError" method is invoked, this function
    will read a CIM_Error embedded instance from the inParameters and use
    that instance to create an InstMethodIndication populating the Error[]
    property with the CIM_Error parameter and errorInstance stored in this
    class (if it's been created already). The output parameter of this method
    will contain the embedded instance received as input, and the newly
    created InstMethodIndication will be sent by the provider to any
    registered listeners.
*/
void EmbeddedInstanceProvider::invokeMethod(
        const OperationContext& context,
        const CIMObjectPath& objectReference,
        const CIMName& methodName,
        const Array<CIMParamValue>& inParameters,
        MethodResultResponseHandler& handler)
{
    // This should start sending indications with the stored Job instance
    // embedded in the InstMethodIndication
    handler.processing();
    if (!methodName.equal(CIMName("PropagateError")))
        throw CIMException(CIM_ERR_METHOD_NOT_AVAILABLE);

    if (inParameters.size() != 1)
    {
        throw CIMException(
            CIM_ERR_INVALID_PARAMETER, "Did not receive exactly 1 parameter");
    }

    CIMParamValue errorParam = inParameters[0];
    if (!String::equal(errorParam.getParameterName(), String("error")))
    {
        throw CIMException(
            CIM_ERR_INVALID_PARAMETER, "Did not find \"error\" parameter");
    }

    CIMInstance errorParamInst;
    errorParam.getValue().get(errorParamInst);
    if (errorParamInst.getPath().getClassName() != "PG_EmbeddedError")
    {
        throw CIMException(CIM_ERR_INVALID_PARAMETER);
    }
    errorParamInst.setPath(errorInstance->getPath());
    Array<CIMName> propList;
    for (unsigned int i = 0, n = errorParamInst.getPropertyCount(); i < n; i++)
    {
        propList.append(errorParamInst.getProperty(i).getName());
    }
    CIMInstance tmpErrorInstance(errorInstance->clone());
    if (!tmpErrorInstance.identical(errorParamInst))
    {
        throw Exception("Did not receive expected ErrorInstance");
    }

    // Build new indication instance
    CIMObjectPath indicationPath(System::getHostName(),
        CIMNamespaceName("test/EmbeddedInstance/Dynamic"),
        CIMName("PG_InstMethodIndication"));
    indicationInstance.reset(new CIMInstance("PG_InstMethodIndication"));
    indicationInstance->setPath(indicationPath);
    indicationInstance->addProperty(CIMProperty("MethodName",
        CIMValue(String("PropagateError"))));
    indicationInstance->addProperty(CIMProperty("PreCall",
        CIMValue(Boolean(false))));
    indicationInstance->addProperty(CIMProperty("SourceInstance",
        CIMValue(CIMObject(*errorInstance))));
    Array<CIMInstance> errorInstances;
    errorInstances.append(*errorInstance);
    errorInstances.append(*errorInstance);
    indicationInstance->addProperty(CIMProperty("Error",
        CIMValue(errorInstances)));

    handler.deliverParamValue(CIMParamValue(String("sameError"),
        CIMValue(errorParamInst)));
    handler.deliver(CIMValue(Uint32(1)));
    handler.complete();

    indicationHandler->deliver(*indicationInstance);
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:79,代码来源:EmbeddedInstanceProvider.cpp


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