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


C++ IDviInvocation::InvocationReportError方法代码示例

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


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

示例1: Invoke

void DviService::Invoke(IDviInvocation& aInvocation, const Brx& aActionName)
{
    iLock.Wait();
    TBool disabled = iDisabled;
    if (disabled) {
        iLock.Signal();
        aInvocation.InvocationReportError(502, Brn("Action not available"));
    }
    iCurrentInvocationCount++;
    (void)iDisabledSem.Clear();
    iLock.Signal();

    {
        AutoFunctor a(MakeFunctor(*this, &DviService::InvocationCompleted));
        for (TUint i=0; i<iDvActions.size(); i++) {
            if (iDvActions[i].Action()->Name() == aActionName) {
                try {
                    iDvActions[i].Functor()(aInvocation);
                }
                catch (Exception& e) {
                    Brn msg(e.Message());
                    aInvocation.InvocationReportError(801, msg);
                }
                catch (...) {
                    aInvocation.InvocationReportError(801, Brn("Unknown error"));
                }
                return;
            }
        }
    }

    aInvocation.InvocationReportError(501, Brn("Action not implemented"));
}
开发者ID:broonie,项目名称:ohNet,代码行数:33,代码来源:DviService.cpp

示例2: Invoke

void DviService::Invoke(IDviInvocation& aInvocation, const Brx& aActionName)
{
    iLock.Wait();
#if 0 // debug logging
    {
        Bws<512> debugBuf("Service: ");
        debugBuf.Append(iServiceType.Name());
        debugBuf.Append(", Action: ");
        debugBuf.Append(aActionName);
        debugBuf.Append("\n");
        Log::Print(debugBuf);
    }
#endif
    TBool disabled = iDisabled;
    if (disabled) {
        iLock.Signal();
        aInvocation.InvocationReportError(502, Brn("Action not available"));
    }
    iCurrentInvocationCount++;
    (void)iDisabledSem.Clear();
    iLock.Signal();

    {
        AutoFunctor a(MakeFunctor(*this, &DviService::InvocationCompleted));
        for (TUint i=0; i<iDvActions.size(); i++) {
            if (iDvActions[i].Action()->Name() == aActionName) {
                try {
                    iDvActions[i].Functor()(aInvocation);
                }
                catch (InvocationError&) {
                    // avoid calls to aInvocation.InvocationReportError in other catch blocks
                    throw;
                }
                catch (Exception& e) {
                    Brn msg(e.Message());
                    aInvocation.InvocationReportError(801, msg);
                }
                catch (...) {
                    aInvocation.InvocationReportError(801, Brn("Unknown error"));
                }
                return;
            }
        }
    }

    aInvocation.InvocationReportError(501, Brn("Action not implemented"));
}
开发者ID:SiMet,项目名称:ohNet,代码行数:47,代码来源:DviService.cpp

示例3: Invoke

void DviService::Invoke(IDviInvocation& aInvocation, TUint aVersion, const Brx& aActionName)
{
    for (TUint i=0; i<iDvActions.size(); i++) {
        if (iDvActions[i].Action()->Name() == aActionName) {
            iDvActions[i].Functor()(aInvocation, aVersion);
            return;
        }
    }

    aInvocation.InvocationReportError(501, Brn("Action not implemented"));
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:11,代码来源:DviService.cpp

示例4: DvInvocationReportError

int32_t DvInvocationReportError(DvInvocationC aInvocation, uint32_t aCode, const char* aDescription)
{
    IDviInvocation* invocation = InvocationFromHandle(aInvocation);
    try {
        Brn desc(aDescription);
        invocation->InvocationReportError(aCode, desc);
    }
    catch (WriterError&) {
        return -1;
    }
    catch (InvocationError&) {}
    return 0;
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:13,代码来源:DvProviderC.cpp


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