general indent beautification
This commit is contained in:
@@ -11,9 +11,9 @@ using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
|
||||
static Structure::const_shared_pointer resultStructure =
|
||||
getFieldCreate()->createFieldBuilder()->
|
||||
add("c", pvDouble)->
|
||||
createStructure();
|
||||
getFieldCreate()->createFieldBuilder()->
|
||||
add("c", pvDouble)->
|
||||
createStructure();
|
||||
|
||||
// s1 starts with s2 check
|
||||
static bool starts_with(const std::string& s1, const std::string& s2) {
|
||||
@@ -27,17 +27,17 @@ class SumServiceImpl :
|
||||
{
|
||||
// NTURI support
|
||||
PVStructure::shared_pointer args(
|
||||
(starts_with(pvArguments->getStructure()->getID(), "epics:nt/NTURI:1.")) ?
|
||||
pvArguments->getSubField<PVStructure>("query") :
|
||||
pvArguments
|
||||
);
|
||||
(starts_with(pvArguments->getStructure()->getID(), "epics:nt/NTURI:1.")) ?
|
||||
pvArguments->getSubField<PVStructure>("query") :
|
||||
pvArguments
|
||||
);
|
||||
|
||||
// get fields and check their existence
|
||||
PVScalar::shared_pointer af = args->getSubField<PVScalar>("a");
|
||||
PVScalar::shared_pointer bf = args->getSubField<PVScalar>("b");
|
||||
if (!af || !bf)
|
||||
throw RPCRequestException(Status::STATUSTYPE_ERROR, "scalar 'a' and 'b' fields are required");
|
||||
|
||||
|
||||
// get the numbers (and convert if neccessary)
|
||||
double a, b;
|
||||
try
|
||||
@@ -48,9 +48,9 @@ class SumServiceImpl :
|
||||
catch (std::exception &e)
|
||||
{
|
||||
throw RPCRequestException(Status::STATUSTYPE_ERROR,
|
||||
std::string("failed to convert arguments to double: ") + e.what());
|
||||
std::string("failed to convert arguments to double: ") + e.what());
|
||||
}
|
||||
|
||||
|
||||
// create return structure and set data
|
||||
PVStructure::shared_pointer result = getPVDataCreate()->createPVStructure(resultStructure);
|
||||
result->getSubField<PVDouble>("c")->put(a+b);
|
||||
|
||||
Reference in New Issue
Block a user