epics::pvData::PVStructure::shared_pointer RpcClient::request(const epics::pvData::PVStructurePtr& pvRequest, double timeout) 
{
    try {
        epics::pvAccess::RPCClient::shared_pointer client = getRpcClient(pvRequest, timeout);
#if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION == 430
        epics::pvData::PVStructure::shared_pointer response = client->request(pvRequest, timeout);
#endif // if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION == 430

#if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION == 435
        // When client goes out of scope, it will destroy resources.
        bool lastRequest = false;
        epics::pvData::PVStructure::shared_pointer response = client->request(pvRequest, lastRequest);
#endif // if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION == 435

#if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION == 440
        epics::pvData::PVStructure::shared_pointer response = client->request(pvRequest, timeout);
#endif // if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION == 440

        return response;
    }
    catch (const epics::pvAccess::RPCRequestException& ex) {
        throw PvaException(ex.what());
    }
    catch (std::exception& ex) {
        throw PvaException(ex.what());
    }
    catch (...) {
        throw PvaException("Unexpected error caught in RpcClient::request().");
    }
}
Beispiel #2
0
epics::pvData::PVStructure::shared_pointer RpcClient::request(const epics::pvData::PVStructurePtr& arguments, double timeout)
{
    try {
        epics::pvAccess::RPCClient::shared_pointer client = getRpcClient(pvRequest, timeout);

#if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION >= 440
        epics::pvData::PVStructure::shared_pointer response = client->request(arguments, timeout);
#endif // if defined PVA_RPC_API_VERSION && PVA_RPC_API_VERSION >= 440

        return response;
    }
    catch (const epics::pvAccess::RPCRequestException& ex) {
        throw PvaException(ex.what());
    }
    catch (std::exception& ex) {
        throw PvaException(ex.what());
    }
    catch (...) {
        throw PvaException("Unexpected error caught in RpcClient::request().");
    }
}