这篇教程C++ CIMName函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CIMName函数的典型用法代码示例。如果您正苦于以下问题:C++ CIMName函数的具体用法?C++ CIMName怎么用?C++ CIMName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CIMName函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PEG_METHOD_ENTER//// Class that determines whether or not the origin class in an association// operation is valid for the given association class, and also determines// the origin and target "roles". These values generally correspond to the// role and resultRole parameter of an associators/associatorNames operation.//bool InteropProvider::validAssocClassForObject( const OperationContext & context, const CIMName & assocClass, const CIMObjectPath & objectName, const CIMNamespaceName & opNamespace, String & originProperty, String & targetProperty){ PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::validAssocClassForObject()"); TARGET_CLASS assocClassEnum = translateClassInput(assocClass); TARGET_CLASS originClassEnum = NOCLASS; CIMName originClass = objectName.getClassName(); // If the association class is PG_ElementConformsToProfile, we'll have to // do some special processing in case the origin instance for the operation // is managed by another provider. if(assocClassEnum == PG_ELEMENTCONFORMSTOPROFILE) { // Test if the origin is an element managed by another provider // that has implemented a registered profile. if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP || (originClass != PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE &&#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT originClass != PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE &&#endif originClass != PEGASUS_CLASSNAME_PG_OBJECTMANAGER )) { // // Search the cached conformingElements list for the originClass, // returning false if it is not found // bool found = false; PEGASUS_ASSERT(conformingElements.size() == elementNamespaces.size()); for(Uint32 i = 0, n = conformingElements.size(); i < n; ++i) { CIMNameArray & elementList = conformingElements[i]; CIMNamespaceArray & namespaceList = elementNamespaces[i]; PEGASUS_ASSERT(elementList.size() == namespaceList.size()); for(Uint32 j = 0, m = elementList.size(); j < m; ++j) { CIMName & curElement = elementList[j]; if((curElement == originClass || curElement.getString().find(PEGASUS_DYNAMIC) == 0) && opNamespace == namespaceList[j]) { found = true; break; } } if(found) break; } if(!found) { PEG_METHOD_EXIT(); return false; } } } else { // Otherwise, just get the enum value representing the origin class // for this operation originClassEnum = translateClassInput(originClass); } CIMName expectedTargetRole; CIMName expectedOriginRole; Array<CIMName> propNames; String profileName; CIMPropertyList propertyList; CIMInstance tmpInstance; Uint32 index; propNames.clear(); // // Set the target and origin role values. Note that if these values are // not set following the switch block, that implies that the origin class // is not valid for the supplied association class. // switch(assocClassEnum) { case PG_NAMESPACEINMANAGER: if(originClassEnum == PG_OBJECTMANAGER) { expectedTargetRole = PROPERTY_DEPENDENT; expectedOriginRole = PROPERTY_ANTECEDENT; } else if(originClassEnum == PG_NAMESPACE) {//.........这里部分代码省略.........
开发者ID:deleisha,项目名称:neopegasus,代码行数:101,
示例2: _test2static void_test2 (CIMClient & client){ Uint32 exceptions = 0; CIMObjectPath instanceName; Array < CIMKeyBinding > keyBindings; keyBindings.append (CIMKeyBinding ("ElementNameName", "TestCMPI_ExecQuery", CIMKeyBinding::STRING)); instanceName.setNameSpace (providerNamespace); instanceName.setClassName ("TestCMPI_ExecQuery"); instanceName.setKeyBindings (keyBindings); /* Call the unsupported functions of the provider. */ try { CIMInstance instance (client.getInstance (providerNamespace, instanceName)); } catch (const CIMException &) { exceptions ++; } try { client.deleteInstance (providerNamespace, instanceName); } catch (const CIMException & ) { exceptions ++; } CIMClass thisClass = client.getClass( providerNamespace, "TestCMPI_ExecQuery", false, true, true, CIMPropertyList()); Array<CIMName> propertyNameList; propertyNameList.append(CIMName("ElementName")); CIMPropertyList myPropertyList(propertyNameList); // create the instance with the defined properties CIMInstance newInstance = thisClass.buildInstance(true, true, myPropertyList); newInstance.getProperty(0).setValue(CIMValue(String("TestCMPI_execQuery") )); try { CIMObjectPath objectPath (client.createInstance (providerNamespace, newInstance)); } catch (const CIMException &) { exceptions ++; } try { client.modifyInstance (providerNamespace, newInstance); } catch (const CIMException &) { exceptions ++; } try { Array < CIMInstance > instances = client.enumerateInstances (providerNamespace, CIMName ("TestCMPI_ExecQuery")); } catch (const CIMException &) { exceptions ++; } try { Array < CIMObjectPath > objectPaths = client.enumerateInstanceNames (providerNamespace, CIMName ("TestCMPI_ExecQuery")); } catch (const CIMException &) { exceptions ++; } PEGASUS_TEST_ASSERT(exceptions == 6);}
开发者ID:brunolauze,项目名称:pegasus,代码行数:91,
示例3: _test4void _test4(CIMClient & client){ static const String NAMESPACE("test/TestProvider"); static const String CLASSNAME("cmpiPerf_TestClassA"); Array<CIMObjectPath> cimInstanceNames = client.enumerateInstanceNames( NAMESPACE, CLASSNAME); cout<<"+++++++++empty property list filtered output++++++"<<endl; { Array<CIMName> propNames; for (Uint32 i = 0, n = cimInstanceNames.size(); i < n; i++) { CIMInstance cimInstance=client.getInstance( NAMESPACE, cimInstanceNames[i], true, false, false, CIMPropertyList(propNames)); if (verbose) { XmlWriter::printInstanceElement(cimInstance); } Uint32 propertyCount = cimInstance.getPropertyCount(); if(propertyCount == 0) { cout<<"Filter getInstance test on " <<"cmpiPerf_TestClassA SUCCEEDED :Filtering " <<"the ciminstance with a empty property list " <<"returned zero properties as expected"<<endl; } else { cout<<"Filter getInstance test on cmpiPerf_TestClassA" <<" FAILED:Filtering the ciminstance with a empty " <<"property list returned some properties " <<"which is not expected"<<endl; PEGASUS_TEST_ASSERT(false); } } } cout<<"+++++++++wrong property list filtered output++++++"<<endl; { Array<CIMName> propNames; propNames.append(CIMName(String("theK"))); for (Uint32 i = 0, n = cimInstanceNames.size(); i < n; i++) { CIMInstance cimInstance=client.getInstance( NAMESPACE, cimInstanceNames[i], true, false, false, CIMPropertyList(propNames)); if (verbose) { XmlWriter::printInstanceElement(cimInstance); } Uint32 propertyCount = cimInstance.getPropertyCount(); if(propertyCount == 0) { cout<<"Filter getInstance test on " <<"cmpiPerf_TestClassA SUCCEEDED :Filtering " <<"the ciminstance with a wrong property list " <<"returned zero properties as expected"<<endl; } else { cout<<"Filter getInstance test on cmpiPerf_TestClassA" <<" FAILED:Filtering the ciminstance with a wrong " <<"property list returned some properties " <<"which is not expected"<<endl; PEGASUS_TEST_ASSERT(false); } } } cout<<"+++++++++NULL property list filtered output++++++"<<endl; { for (Uint32 i = 0, n = cimInstanceNames.size(); i < n; i++) { CIMInstance cimInstance=client.getInstance( NAMESPACE, cimInstanceNames[i], true, false, false, CIMPropertyList()); if (verbose) { XmlWriter::printInstanceElement(cimInstance); } Uint32 propertyCount = cimInstance.getPropertyCount(); if(propertyCount == 24) { cout<<"Filter getInstance test on " <<"cmpiPerf_TestClassA SUCCEEDED :Filtering " <<"the ciminstance with a NULL property list " <<"returned all properties as expected"<<endl; }//.........这里部分代码省略.........
开发者ID:brunolauze,项目名称:pegasus,代码行数:101,
示例4: CIMNamespaceName// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================//// Author: Lyle Wilkinson, Hewlett-Packard Company <[email C++ CIMNamespaceName函数代码示例 C++ CIMException函数代码示例
|