afafa09547
ioc: check for mis-matched onStartSubscription()/onDisableSubscription() ioc: fix subscription lifetime ioc: catch exceptions in dbEvent callbacks ioc: avoid unnecessary virtual ioc: minor ioc: fix qsrv -S ioc: qsrvGroupSourceInit() catch+log ioc: runOnServer avoid std::function ioc: cleanup and simplifications. Avoid some redundant std::map lookups. Make Group partially const to prevent implicit ctor. ioc: avoid typedefs only used once ioc: overhaul Group::show(). shows triggers ioc: MappingType ioc: pvxsgl -> pvxgl ioc: separate group config singleton from server singleton ioc: remove unnecessary forward declarations ioc: restructure pvxsInitHook ioc: qsrv runtime disable by default ioc: compat w/ older Base ioc: link pvxsIoc w/ DB libs ioc: Channel proper detection of invalid PV ioc: no need to keep vector<dbCommon*> around ioc: fix initial group update for mappings w/o dbChannel ioc: redo testing split out group tests, only run with Base >= 7.0 ioc: minor ioc: loc_bad_alloc ioc: avoid symbol/DTYP clash with pva2pva ioc: test record alias in group json ioc: test put failure when SPC_NOMOD and DISP=1 ioc: test channel filters ioc: unnecessary capture ioc: avoid sharing Value between multiple subscriptions It is possible to create two subscriptions through the same channel. ioc: group subscription include queueSize ioc: eliminate unused atomicMonitor ioc: consolidate GroupSource::get() avoid some indirection ioc: pvRequest override of atomicPutGet ioc: fix group non-atomic put ioc: test asTrap hooks ioc: test putOrder also sets field order ioc: simplify GroupConfigProcessor::loadConfigFiles() Also ensure that groupMapMutex is held ioc: testqgroup cover JSON def. ioc: dbLoadGroup() use macros ioc: pvxsl() take integer argument ioc: display.form and info(Q:form ioc: "NO_ALARM" -> "" ioc: use dbServer at least for informational callbacks. ioc: consolidate createRequestAndSubscriptionHandlers() ioc: eliminate ChannelAndLock properties dbChannel doesn't need a separate DBManyLock ioc: test that putOrder also controls field order ioc: MappingType -> MappingInfo Handle info(Q:time:tag Add +type:"const" ioc: cleanup includes ioc: test dbNotifyCancel() ioc: inline checkForTrailingCommentsAtEnd()
91 lines
2.9 KiB
C++
91 lines
2.9 KiB
C++
/*
|
|
* Copyright - See the COPYRIGHT that is included with this distribution.
|
|
* pvxs is distributed subject to a Software License Agreement found
|
|
* in file LICENSE that is included with this distribution.
|
|
*
|
|
* Author George S. McIntyre <george@level-n.com>, 2023
|
|
*
|
|
*/
|
|
#include <string>
|
|
|
|
#include "groupprocessorcontext.h"
|
|
#include "utilpvt.h"
|
|
|
|
namespace pvxs {
|
|
namespace ioc {
|
|
|
|
/**
|
|
* Assign the given value appropriately given the current context.
|
|
* The context holds the current field, key, depth, etc.
|
|
*
|
|
* @param value the value to assign
|
|
*/
|
|
void GroupProcessorContext::assign(const Value& value) {
|
|
canAssign();
|
|
auto& groupPvConfig = groupConfigProcessor->groupConfigMap[groupName];
|
|
|
|
if (depth == 2) {
|
|
if (field == "+atomic") {
|
|
groupPvConfig.atomic = value.as<bool>();
|
|
groupPvConfig.atomicIsSet = true;
|
|
|
|
} else if (field == "+id") {
|
|
groupPvConfig.structureId = value.as<std::string>();
|
|
|
|
} else {
|
|
groupConfigProcessor->groupProcessingWarnings += "Unknown group option ";
|
|
groupConfigProcessor->groupProcessingWarnings += field;
|
|
}
|
|
field.clear();
|
|
|
|
} else if (depth == 3) {
|
|
auto& groupField = groupPvConfig.fieldConfigMap[field];
|
|
|
|
if (key == "+type") {
|
|
auto tname = value.as<std::string>();
|
|
MappingInfo::type_t type = groupField.info.type;
|
|
if(tname == "scalar") {
|
|
type = MappingInfo::Scalar;
|
|
} else if(tname == "plain") {
|
|
type = MappingInfo::Plain;
|
|
} else if(tname == "any") {
|
|
type = MappingInfo::Any;
|
|
} else if(tname == "meta") {
|
|
type = MappingInfo::Meta;
|
|
} else if(tname == "proc") {
|
|
type = MappingInfo::Proc;
|
|
} else if(tname == "structure") {
|
|
type = MappingInfo::Structure;
|
|
} else if(tname == "const") {
|
|
type = MappingInfo::Const;
|
|
} else {
|
|
groupConfigProcessor->groupProcessingWarnings += SB()<<"Unknown mapping +type:\""<<tname<<"\" ignored";
|
|
}
|
|
groupField.info.type = type;
|
|
|
|
} else if (key == "+channel") {
|
|
groupField.channel = channelPrefix + value.as<std::string>();
|
|
|
|
} else if (key == "+id") {
|
|
groupField.structureId = value.as<std::string>();
|
|
|
|
} else if (key == "+trigger") {
|
|
groupField.trigger = value.as<std::string>();
|
|
|
|
} else if (key == "+putorder") {
|
|
groupField.putOrder = value.as<int64_t>();
|
|
|
|
} else if (key == "+const") {
|
|
groupField.info.cval = value;
|
|
|
|
} else {
|
|
groupConfigProcessor->groupProcessingWarnings += "Unknown group field option ";
|
|
groupConfigProcessor->groupProcessingWarnings += field + ":" + key;
|
|
}
|
|
key.clear();
|
|
}
|
|
}
|
|
|
|
} // pvxs
|
|
} // ioc
|