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


C++ Invocation::Action方法代码示例

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


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

示例1: Write

void InvocationBodyWriter::Write(const Invocation& aInvocation)
{
    const Brn kXmlVers("<?xml version=\"1.0\"?>");
    const Brn kEnvelopeOpen("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/"
                            "\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">");
    const Brn kEnvelopeClose("</s:Envelope>");
    const Brn kBodyOpen("<s:Body>");
    const Brn kBodyClose("</s:Body>");
    const Brn kActionOpenStart("<u:");
    const Brn kActionNs(" xmlns:u=\"");
    const Brn kActionCloseStart("</u:");

    iWriteBuffer.Write(kXmlVers);
    iWriterAscii.WriteNewline();
    iWriteBuffer.Write(kEnvelopeOpen);
    iWriterAscii.WriteNewline();
    iWriteBuffer.Write(kBodyOpen);
    iWriterAscii.WriteNewline();
    iWriteBuffer.Write(kActionOpenStart);
    iWriteBuffer.Write(aInvocation.Action().Name());
    iWriteBuffer.Write(kActionNs);
    InvocationUpnp::WriteServiceType(iWriterAscii, aInvocation);
    iWriteBuffer.Write('\"');
    iWriteBuffer.Write('>');
    iWriterAscii.WriteNewline();
    const Invocation::VectorArguments& inArgs = aInvocation.InputArguments();
    const TUint count = (TUint)inArgs.size();
    for (TUint i=0; i<count; i++) {
        iWriteBuffer.Write('<');
        const Brx& argName = inArgs[i]->Parameter().Name();
        iWriteBuffer.Write(argName);
        iWriteBuffer.Write('>');
        inArgs[i]->ProcessInput(*this);
        iWriteBuffer.Write('<');
        iWriteBuffer.Write('/');
        iWriteBuffer.Write(argName);
        iWriteBuffer.Write('>');
        iWriterAscii.WriteNewline();
    }
    iWriteBuffer.Write(kActionCloseStart);
    iWriteBuffer.Write(aInvocation.Action().Name());
    iWriteBuffer.Write('>');
    iWriterAscii.WriteNewline();
    iWriteBuffer.Write(kBodyClose);
    iWriterAscii.WriteNewline();
    iWriteBuffer.Write(kEnvelopeClose);
    iWriterAscii.WriteNewline();
    iWriteBuffer.WriteFlush();
}
开发者ID:fuzzy01,项目名称:ohNet,代码行数:49,代码来源:ProtocolUpnp.cpp

示例2: a

void CpiDeviceLpec::Invocable::InvokeAction(Invocation& aInvocation)
{
    AutoMutex a(iDevice.iLock);
    iDevice.iResponseHandler = this;
    iInvocation = &aInvocation;
    iDevice.iWriteBuffer->Write(Lpec::kMethodAction);
    iDevice.iWriteBuffer->Write(' ');
    iDevice.iWriteBuffer->Write(iDevice.iLpecName);
    iDevice.iWriteBuffer->Write('/');
    iDevice.iWriteBuffer->Write(aInvocation.ServiceType().Name());
    iDevice.iWriteBuffer->Write(' ');
    Bws<Ascii::kMaxUintStringBytes> verBuf;
    (void)Ascii::AppendDec(verBuf, aInvocation.ServiceType().Version());
    iDevice.iWriteBuffer->Write(verBuf);
    iDevice.iWriteBuffer->Write(' ');
    iDevice.iWriteBuffer->Write(aInvocation.Action().Name());
    std::vector<Argument*> inputArgs = aInvocation.InputArguments();
    for (TUint i=0; i<inputArgs.size(); i++) {
        inputArgs[i]->ProcessInput(*this);
    }
    iDevice.iWriteBuffer->Write(Lpec::kMsgTerminator);
    iDevice.iWriteBuffer->WriteFlush();

    iSem.Wait(); // wait for response
    iInvocation = NULL;
    iDevice.iResponseHandler = NULL;
}
开发者ID:Jacik,项目名称:ohNet,代码行数:27,代码来源:CpiDeviceLpec.cpp


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