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


C++ OperationContext::insert方法代码示例

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


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

示例1: getResponseContext

OperationContext ClientCIMOMHandleRep::getResponseContext()
{
    OperationContext ctx;

    Thread* curThrd = Thread::getCurrent();
    if (curThrd == NULL)
    {
        ctx.insert(ContentLanguageListContainer(ContentLanguageList()));
    }
    else
    {
        ContentLanguageList* contentLangs = (ContentLanguageList*)
            curThrd->reference_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES);
        curThrd->dereference_tsd();

        if (contentLangs == NULL)
        {
            ctx.insert(ContentLanguageListContainer(ContentLanguageList()));
        }
        else
        {
            ctx.insert(ContentLanguageListContainer(*contentLangs));
            // delete the old tsd to free the memory
            curThrd->delete_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES);
        }
    }

    return ctx;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:29,代码来源:ClientCIMOMHandleRep.cpp

示例2: deliver

void EnableIndicationsResponseHandler::deliver(const CIMIndication & cimIndication)
{
    OperationContext context;

    Array<CIMObjectPath> subscriptionInstanceNames;

    context.insert(SubscriptionInstanceNamesContainer(subscriptionInstanceNames));

    deliver(context, cimIndication);
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:10,代码来源:OperationResponseHandler.cpp

示例3: return

ThreadReturnType PEGASUS_THREAD_CDECL
CIMListenerIndicationDispatcherRep::deliver_routine(void *param)
{
    CIMListenerIndicationDispatchEvent* event =
        static_cast<CIMListenerIndicationDispatchEvent*>(param);

    if(event!=NULL)
    {
        CIMIndicationConsumer* consumer = event->getConsumer();
        OperationContext context;
            context.insert(ContentLanguageListContainer(
                        event->getContentLanguages()));
        if(consumer)
        {
            consumer->consumeIndication(context,
                event->getURL(),event->getIndicationInstance());
        }

        delete event;
    }

    return (0);
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:23,代码来源:CIMListenerIndicationDispatcher.cpp

示例4: _generateIndication


//.........这里部分代码省略.........
            (methodName.equal ("SendTestIndicationMatchingInstance")) ||
            (methodName.equal ("SendTestIndicationUnmatchingNamespace")) ||
            (methodName.equal ("SendTestIndicationUnmatchingClassName")))
        {
            indicationInstance.addProperty
                (CIMProperty ("MethodName", CIMValue (methodName.getString())));
        }
        else
        {
            indicationInstance.addProperty
                (CIMProperty ("MethodName",
                    CIMValue (String ("generateIndication"))));
        }

        //
        //  For SendTestIndicationExtraProperty, add an extra property,
        //  ExtraProperty, that is not a member of the indication class
        //
        if (methodName.equal ("SendTestIndicationExtraProperty"))
        {
            indicationInstance.addProperty
                (CIMProperty ("ExtraProperty",
                    CIMValue (String ("extraProperty"))));
        }

        CIMIndication cimIndication (indicationInstance);

        //
        //  For SendTestIndicationSubclass,
        //  SendTestIndicationMatchingInstance,
        //  SendTestIndicationUnmatchingNamespace or
        //  SendTestIndicationUnmatchingClassName, include
        //  SubscriptionInstanceNamesContainer in operation context
        //
        if ((methodName.equal ("SendTestIndicationSubclass")) ||
            (methodName.equal ("SendTestIndicationMatchingInstance")) ||
            (methodName.equal ("SendTestIndicationUnmatchingNamespace")) ||
            (methodName.equal ("SendTestIndicationUnmatchingClassName")))
        {
            Array <CIMObjectPath> subscriptionInstanceNames;
            Array <CIMKeyBinding> subscriptionKeyBindings;

            String filterString;
            filterString.append ("CIM_IndicationFilter.CreationClassName=\"CIM_IndicationFilter\",Name=\"PIFilter01\",SystemCreationClassName=\"");
            filterString.append (System::getSystemCreationClassName ());
            filterString.append ("\",SystemName=\"");
            filterString.append (System::getFullyQualifiedHostName ());
            filterString.append ("\"");
            subscriptionKeyBindings.append (CIMKeyBinding ("Filter",
                filterString, CIMKeyBinding::REFERENCE));

            String handlerString;
            handlerString.append ("CIM_IndicationHandlerCIMXML.CreationClassName=\"CIM_IndicationHandlerCIMXML\",Name=\"PIHandler01\",SystemCreationClassName=\"");
            handlerString.append (System::getSystemCreationClassName ());
            handlerString.append ("\",SystemName=\"");
            handlerString.append (System::getFullyQualifiedHostName ());
            handlerString.append ("\"");
            subscriptionKeyBindings.append (CIMKeyBinding ("Handler",
                handlerString, CIMKeyBinding::REFERENCE));

            CIMObjectPath subscriptionPath ("",
                CIMNamespaceName ("root/PG_InterOp"),
                CIMName ("CIM_IndicationSubscription"),
                subscriptionKeyBindings);
            subscriptionInstanceNames.append (subscriptionPath);

	    OperationContext context;
            context.insert (SubscriptionInstanceNamesContainer
                (subscriptionInstanceNames));

            handler->deliver (context, indicationInstance);
        }
        else
        {
	    // deliver an indication without trapOid
            handler->deliver (indicationInstance);
        }

        //
        //  Only deliver extra indication with trapOid for SendTestIndication
        //
        if ((!methodName.equal ("SendTestIndicationNormal")) &&
            (!methodName.equal ("SendTestIndicationSubclass")) &&
            (!methodName.equal ("SendTestIndicationMissingProperty")) &&
            (!methodName.equal ("SendTestIndicationExtraProperty")) &&
            (!methodName.equal ("SendTestIndicationMatchingInstance")) &&
            (!methodName.equal ("SendTestIndicationUnmatchingNamespace")) &&
            (!methodName.equal ("SendTestIndicationUnmatchingClassName")))
        {
	    // deliver another indication with a trapOid which contains in the
	    // operationContext container
	    OperationContext context;

 	    // add trap OID to the context
	    context.insert
                (SnmpTrapOidContainer("1.3.6.1.4.1.900.2.3.9002.9600"));
            handler->deliver (context, indicationInstance);
        }
    }
}
开发者ID:,项目名称:,代码行数:101,代码来源:

示例5: mbDeliverIndication

    static CMPIStatus mbDeliverIndication(
        const CMPIBroker* eMb,
        const CMPIContext* ctx,
        const char *ns,
        const CMPIInstance* ind)
    {
        PEG_METHOD_ENTER(
            TRC_CMPIPROVIDERINTERFACE,
            "CMPI_Broker:mbDeliverIndication()");
        eMb = CM_BROKER;
        CMPI_Broker *mb = (CMPI_Broker*)eMb;
        IndProvRecord *indProvRec;
        OperationContext* context = CM_Context(ctx);

        SCMOInstance* scmoInst = SCMO_Instance(ind);
        CIMInstance indInst;
        scmoInst->getCIMInstance(indInst);

        // When an indication to be delivered comes from Remote providers,
        // the CMPIBroker contains the name of the provider in the form
        // of physical-name:logical-name. Search using logical-name. -V 5884
        String provider_name;
        CMPIUint32 n;

        if ( (n = mb->name.find(':') ) != PEG_NOT_FOUND)
        {
            provider_name = mb->name.subString (n + 1);
        }
        else
        {
            provider_name = mb->name;
        }
        ReadLock readLock(CMPIProviderManager::rwSemProvTab);
        if (CMPIProviderManager::indProvTab.lookup(provider_name, indProvRec))
        {
            if (indProvRec->isEnabled())
            {
                try
                {
                    context->get(SubscriptionInstanceNamesContainer::NAME);
                }
                catch (const Exception &e)
                {
                    PEG_TRACE((TRC_CMPIPROVIDERINTERFACE,Tracer::LEVEL1,
                        "Exception: %s",
                        (const char*)e.getMessage().getCString()));
                    Array<CIMObjectPath> subscriptionInstanceNames;
                    context->insert(
                        SubscriptionInstanceNamesContainer(
                            subscriptionInstanceNames));
                }
                CIMIndication cimIndication(indInst);
                try
                {
                    indProvRec->getHandler()->deliver(
                        *context,
   //                   OperationContext(*CM_Context(ctx)),
                        cimIndication);
                    PEG_METHOD_EXIT();
                    CMReturn(CMPI_RC_OK);
                }
                HandlerCatchReturnStatus();
            }
        }
        PEG_METHOD_EXIT();
        CMReturn(CMPI_RC_ERR_FAILED);
    }
开发者ID:rdobson,项目名称:openpegasus,代码行数:67,代码来源:CMPI_Broker.cpp


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