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


C++ CIMObjectPath::toString方法代码示例

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


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

示例1: Run

void UNIX_ApplicationSystemDirectoryFixture::Run()
{
	CIMName className("UNIX_ApplicationSystemDirectory");
	CIMNamespaceName nameSpace("root/cimv2");
	UNIX_ApplicationSystemDirectory _p;
	UNIX_ApplicationSystemDirectoryProvider _provider;
	Uint32 propertyCount;
	CIMOMHandle omHandle;
	_provider.initialize(omHandle);
	_p.initialize();

	for(int pIndex = 0; _p.load(pIndex); pIndex++)
	{
		CIMInstance instance = _provider.constructInstance(className,
					nameSpace,
					_p);
		CIMObjectPath path = instance.getPath();
		cout << path.toString() << endl;
		propertyCount = instance.getPropertyCount();
		for(Uint32 i = 0; i < propertyCount; i++)
		{

			CIMProperty propertyItem = instance.getProperty(i);
			if (propertyItem.getType() == CIMTYPE_REFERENCE) {
				CIMValue subValue = propertyItem.getValue();
				CIMInstance subInstance;
				subValue.get(subInstance);
				CIMObjectPath subPath = subInstance.getPath();
				cout << "	Name: " << propertyItem.getName().getString() << ": " << subPath.toString() << endl;
				Uint32 subPropertyCount = subInstance.getPropertyCount();
				for(Uint32 j = 0; j < subPropertyCount; j++)
				{
					CIMProperty subPropertyItem = subInstance.getProperty(j);
					cout << "		Name: " << subPropertyItem.getName().getString() << " - Value: " << subPropertyItem.getValue().toString() << endl;
				}
			}
			else {
				cout << "	Name: " << propertyItem.getName().getString() << " - Value: " << propertyItem.getValue().toString() << endl;
			}

		}
		cout << "------------------------------------" << endl;
		cout << endl;
	}

	_p.finalize();
	
}
开发者ID:brunolauze,项目名称:openpegasus-providers,代码行数:48,代码来源:UNIX_ApplicationSystemDirectoryFixture.cpp

示例2: _testReferences

Uint32 _testReferences(
    CIMClient& client,
    CIMObjectPath instancePath,
    CIMName referenceClass)
{
    if (verbose)
    {
        cout << "\nObject Name: " << instancePath.toString() << endl;
    }

    // get the association reference instances
    //
    String role;
    Array<CIMObject> resultObjects =
        client.references(NAMESPACE, instancePath, referenceClass,role);
    Uint32 size = resultObjects.size();
    if (verbose)
    {
        if (size > 0)
        {
            cout << " \n     " <<  referenceClass.getString() << " :: ";
            for (Uint32 i = 0; i < size ; ++i)
            {
                cout << resultObjects[i].getPath().toString();
            }
            cout << endl;
        }
    }
    return size;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:30,代码来源:TestAggregationOutputClient.cpp

示例3: _testReferenceNames

void _testReferenceNames(CIMClient& client, CIMObjectPath instancePath,
                         Uint32 numExpectedObjects)
{
    if (verbose)
    {
        cout << "Object Name: " << instancePath.toString() << endl;
    }

    try
    {
        // get the reference instance names
        //
        Array<CIMObjectPath> resultObjectPaths;
        CIMName resultClass;
        String role;

        resultObjectPaths = client.referenceNames(
            providerNamespace,
            instancePath,
            resultClass,
            role);

        // verify result
        _verifyResult(resultObjectPaths.size(), numExpectedObjects);

        // display result
        _displayResult(resultObjectPaths);
    }
    catch (Exception& e)
    {
        _errorExit(e.getMessage());
    }
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:33,代码来源:cmpiAssociationTestClient.cpp

示例4: _testAssociatorNames

void _testAssociatorNames(CIMClient& client, CIMName assocClass,
                          CIMObjectPath instancePath, Uint32 numExpectedObjects)
{
    if (verbose)
    {
        cout << "Association Class: " << assocClass.getString() << endl;
        cout << "Object Name: " << instancePath.toString() << endl;
    }

    try
    {
        // Get the names of the CIM instances that are associated to the
        // specified source instance via an instance of the AssocClass.
        //
        CIMName resultClass;

        String role;
        String resultRole;

        Array<CIMObjectPath> resultObjectPaths =
            client.associatorNames(providerNamespace, instancePath,
                                   assocClass, resultClass, role, resultRole);
        // verify result
        _verifyResult(resultObjectPaths.size(), numExpectedObjects);

        // display result
        _displayResult(resultObjectPaths);
    }
    catch (Exception& e)
    {
         _errorExit(e.getMessage());
    }
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:33,代码来源:cmpiAssociationTestClient.cpp

示例5: _BubbleSort

static void _BubbleSort(Array<CIMKeyBinding>& x)
{
    Uint32 n = x.size();

    //
    //  If the key is a reference, the keys in the reference must also be
    //  sorted
    //
    for (Uint32 k = 0; k < n ; k++)
        if (x[k].getType () == CIMKeyBinding::REFERENCE)
        {
            CIMObjectPath tmp (x[k].getValue ());
            Array <CIMKeyBinding> keyBindings = tmp.getKeyBindings ();
            _BubbleSort (keyBindings);
            tmp.setKeyBindings (keyBindings);
            x[k].setValue (tmp.toString ());
        }

    if (n < 2)
        return;

    for (Uint32 i = 0; i < n - 1; i++)
    {
        for (Uint32 j = 0; j < n - 1; j++)
        {
            if (String::compareNoCase(x[j].getName().getString(),
                                      x[j+1].getName().getString()) > 0)
            {
                CIMKeyBinding t = x[j];
                x[j] = x[j+1];
                x[j+1] = t;
            }
        }
    }
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:35,代码来源:CIMObjectPath.cpp

示例6:

CIMObjectPath _buildSubscriptionPath
   (const CIMObjectPath & filterPath,
    const CIMObjectPath & handlerPath)
{
    CIMObjectPath path;

    Array <CIMKeyBinding> keyBindings;
    keyBindings.append (CIMKeyBinding ("Filter",
        filterPath.toString (), CIMKeyBinding::REFERENCE));
    keyBindings.append (CIMKeyBinding ("Handler",
        handlerPath.toString (), CIMKeyBinding::REFERENCE));

    path.setClassName (SUBSCRIPTION_CLASSNAME);
    path.setKeyBindings (keyBindings);

    return path;
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:17,代码来源:SendTestIndications.cpp

示例7: createInstance

void InstanceProvider::createInstance(
    const OperationContext & context,
    const CIMObjectPath & instanceReference,
    const CIMInstance & instanceObject,
    ObjectPathResponseHandler & handler)
{
    // Validate the class name
    if (!instanceObject.getClassName().equal("Sample_InstanceProviderClass"))
    {
        throw CIMNotSupportedException(
            instanceObject.getClassName().getString());
    }

    // Find the key property
    Uint32 idIndex = instanceObject.findProperty("Identifier");

    if (idIndex == PEG_NOT_FOUND)
    {
        throw CIMInvalidParameterException("Missing key value");
    }

    CIMInstance cimInstance = instanceObject.clone();

    // Create the new instance name
    CIMValue idValue = instanceObject.getProperty(idIndex).getValue();
    Array<CIMKeyBinding> keys;
    keys.append(CIMKeyBinding("Identifier", idValue));
    CIMObjectPath instanceName = CIMObjectPath(
        String(),
        CIMNamespaceName(),
        instanceObject.getClassName(),
        keys);

    cimInstance.setPath(instanceName);
    
    // Determine whether this instance already exists
    for(Uint32 i = 0, n = _instances.size(); i < n; i++)
    {
        if(instanceName == _instances[i].getPath())
        {
            throw CIMObjectAlreadyExistsException(instanceName.toString());
        }
    }

    // begin processing the request
    handler.processing();

    // add the new instance to the array
    _instances.append(cimInstance);

    // deliver the new instance name
    handler.deliver(instanceName);

    // complete processing the request
    handler.complete();
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:56,代码来源:InstanceProvider.cpp

示例8: filterPath

void _deleteSubscriptionInstance 
    (CIMClient & client, 
     const String & filterName,
     const String & handlerName,
     const CIMNamespaceName & filterNS,
     const CIMNamespaceName & handlerNS,
     const CIMNamespaceName & subscriptionNS)
{
    Array<CIMKeyBinding> filterKeyBindings;
    filterKeyBindings.append (CIMKeyBinding ("SystemCreationClassName",
        System::getSystemCreationClassName (), CIMKeyBinding::STRING));
    filterKeyBindings.append (CIMKeyBinding ("SystemName",
        System::getFullyQualifiedHostName (), CIMKeyBinding::STRING));
    filterKeyBindings.append (CIMKeyBinding ("CreationClassName",
        PEGASUS_CLASSNAME_INDFILTER.getString(), CIMKeyBinding::STRING));
    filterKeyBindings.append (CIMKeyBinding ("Name", filterName,
        CIMKeyBinding::STRING));
    CIMObjectPath filterPath ("", filterNS,
        PEGASUS_CLASSNAME_INDFILTER, filterKeyBindings);

    Array<CIMKeyBinding> handlerKeyBindings;
    handlerKeyBindings.append (CIMKeyBinding ("SystemCreationClassName",
        System::getSystemCreationClassName (), CIMKeyBinding::STRING));
    handlerKeyBindings.append (CIMKeyBinding ("SystemName",
        System::getFullyQualifiedHostName (), CIMKeyBinding::STRING));
    handlerKeyBindings.append (CIMKeyBinding ("CreationClassName",
        PEGASUS_CLASSNAME_INDHANDLER_CIMXML.getString(),
        CIMKeyBinding::STRING));
    handlerKeyBindings.append (CIMKeyBinding ("Name", handlerName,
        CIMKeyBinding::STRING));
    CIMObjectPath handlerPath ("", handlerNS,
        PEGASUS_CLASSNAME_INDHANDLER_CIMXML, handlerKeyBindings);

    Array<CIMKeyBinding> subscriptionKeyBindings;
    subscriptionKeyBindings.append (CIMKeyBinding ("Filter",
        filterPath.toString (), CIMKeyBinding::REFERENCE));
    subscriptionKeyBindings.append (CIMKeyBinding ("Handler",
        handlerPath.toString (), CIMKeyBinding::REFERENCE));
    CIMObjectPath subscriptionPath ("", CIMNamespaceName (),
        PEGASUS_CLASSNAME_INDSUBSCRIPTION, subscriptionKeyBindings);
    client.deleteInstance (subscriptionNS, subscriptionPath);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:42,代码来源:DisableEnable2.cpp

示例9: _testReferenceNames

Uint32 _testReferenceNames(CIMClient& client,
                           CIMObjectPath instancePath,
                           CIMName referenceClass)
{
    if (verbose)
    {
        cout << "\nObject Name: " << instancePath.toString() << endl;
    }

    // get the reference instance names
    //
    String role;

    Array<CIMObjectPath> resultObjectPaths =
        client.referenceNames(NAMESPACE, instancePath, referenceClass, role);
    return resultObjectPaths.size();
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:17,代码来源:TestAggregationOutputClient.cpp

示例10: getProviderIndicationDataInstance

CIMInstance ProviderIndicationCountTable::getProviderIndicationDataInstance(
    const CIMObjectPath& instanceName)
{
    PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
        "ProviderIndicationCountTable::getProviderIndicationDataInstance");

    //
    // Gets provider module name and provider name from the provider indication
    // data instance object path
    //
    String providerModuleName;
    String providerName;
    Array<CIMKeyBinding> keys = instanceName.getKeyBindings();

    for (Uint32 i = 0; i < keys.size(); i++)
    {
        if (keys[i].getName() == _PROPERTY_PROVIDERNAME)
        {
            providerName = keys[i].getValue();
        }
        else if (keys[i].getName() == _PROPERTY_PROVIDERMODULENAME)
        {
            providerModuleName = keys[i].getValue();
        }
    }

    String providerKey = _generateKey(providerModuleName, providerName);

    _ProviderIndicationCountTableEntry entry;

    WriteLock lock(_tableLock);

    if (_table.lookup(providerKey, entry))
    {
        CIMInstance providerIndDataInstance =
            _buildProviderIndDataInstance(entry);

        PEG_METHOD_EXIT();
        return providerIndDataInstance;
    }

    PEG_METHOD_EXIT();
    throw CIMObjectNotFoundException(instanceName.toString());
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:44,代码来源:ProviderIndicationCountTable.cpp

示例11: _testAssociatorNames

Uint32 _testAssociatorNames(CIMClient& client,
                            CIMName assocClass,
                            CIMObjectPath instancePath)
{
    if (verbose)
    {
        cout << "\nAssociation Class: " << assocClass.getString() << endl;
        cout << "\nObject Name: " << instancePath.toString() << endl;
    }

    // Get the names of the CIM instances that are associated to the
    // specified source instance via an instance of the AssocClass.
    //
    CIMName resultClass;
    String role;
    String resultRole;
    Array<CIMObjectPath> resultObjectPaths = client.associatorNames(
        NAMESPACE, instancePath, assocClass, resultClass, role, resultRole);
    return resultObjectPaths.size();
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:20,代码来源:TestAggregationOutputClient.cpp

示例12: createInstance

void LargeDataProvider::createInstance(
    const OperationContext & context,
    const CIMObjectPath & instanceReference,
    const CIMInstance & instanceObject,
    ObjectPathResponseHandler & handler)
{
    cout << "---------------------------------" << endl;
    cout << "LargeDataProvider::createInstance" << endl;
    cout << "---------------------------------" << endl;

    // convert a potential fully qualified reference into a local reference
    // (class name and keys only).
    CIMObjectPath localReference = CIMObjectPath(
        String(),
        String(),
        instanceReference.getClassName(),
        instanceReference.getKeyBindings());

    // instance index corresponds to reference index
    for(Uint32 i = 0, n = _instanceNames.size(); i < n; i++)
    {
        if(localReference == _instanceNames[i])
        {
            throw CIMObjectAlreadyExistsException(
                                  localReference.toString());
        }
    }

    // begin processing the request
    handler.processing();

    // add the new instance to the array
    _instances.append(instanceObject);
    _instanceNames.append(instanceReference);

    // deliver the new instance
    handler.deliver(_instanceNames[_instanceNames.size() - 1]);

    // complete processing the request
    handler.complete();
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:41,代码来源:LargeDataProvider.cpp

示例13: enumerateInstanceNames

/*****************************************************************************
 *
 * Implementation of InstanceProvider enumerateInstanceNames method
 *
 *****************************************************************************/
void InteropProvider::enumerateInstanceNames(
    const OperationContext & context,
    const CIMObjectPath & classReference,
    ObjectPathResponseHandler & handler)
{
    PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
        "InteropProvider::enumerateInstanceNames()");

    initProvider();

    PEG_TRACE((TRC_CONTROLPROVIDER, Tracer::LEVEL4,
        "%s enumerateInstanceNames. classReference= %s",
        thisProvider,
        (const char *) classReference.toString().getCString()));

    // test for legal namespace for this provider. Exception if not
    // namespaceSupported(classReference);
    // NOTE: Above is commented out because the routing tables will always
    // do the right thing and that's the only way requests get here.

    // begin processing the request
    handler.processing();

    // Utilize the local enumeration method to retrieve the instances and
    // extract the instance names.
    Array<CIMInstance> instances = localEnumerateInstances(
        context,
        classReference,
        CIMPropertyList());

    for (Uint32 i = 0 ; i < instances.size() ; i++)
    {
        handler.deliver(instances[i].getPath());
    }

    handler.complete();
    PEG_METHOD_EXIT();
}
开发者ID:eSDK,项目名称:eSDK_OBS_API,代码行数:43,代码来源:InteropInstanceProvider.cpp

示例14: _testAssociators

Uint32 _testAssociators(
    CIMClient& client,
    CIMName assocClass,
    CIMObjectPath instancePath)
{
    if (verbose)
    {
        cout << "\nAssociation Class: " << assocClass.getString() << endl;
        cout << "\nObject Name: " << instancePath.toString() << endl;
    }

    CIMName resultClass;
    String role;
    String resultRole;

    // Get the CIM instances that are associated with the specified source
    // instance via an instance of the AssocClass
    //
    Array<CIMObject> resultObjects =
        client.associators(NAMESPACE, instancePath, assocClass, resultClass,
                           role, resultRole);
    Uint32 size = resultObjects.size();
    if (verbose)
    {
        if (size > 0)
        {
            cout << " \n     " <<  assocClass.getString() << " :: ";
            for (Uint32 i = 0; i < size ; ++i)
            {
                cout << resultObjects[i].getPath().toString();
            }
            cout << endl;
        }
    }
    return size;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:36,代码来源:TestAggregationOutputClient.cpp

示例15: Str

 Str(const CIMObjectPath& x) : _cstr(x.toString().getCString()) { }
开发者ID:deleisha,项目名称:neopegasus,代码行数:1,代码来源:EnumerationContext.cpp


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