本文整理汇总了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"));
}
示例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"));
}
示例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"));
}
示例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;
}