Added the 'dbjlr <record> <level>' command that calls jlif::report() for all JSON_LINKs:
void (*report)(const jlink *, int level, int indent);
/* Optional, print status information about this link instance, then
* if (level > 0) print a link identifier (at indent+2) and call
* dbJLinkReport(child, level-1, indent+4)
* for each child.
*/
The report method is intended for individual status reports and not collecting summary statistics, but I've also added another optional jlif routine for recursing through all child links:
typedef long (*jlink_map_fn)(jlink *, void *ctx);
long (*map_children)(jlink *, jlink_map_fn rtn, void *ctx);
/* Optional, call dbJLinkMapChildren() on all embedded links.
* Stop immediately and return status if non-zero.
*/
There is also a top-level API for running that on all records:
long dbJLinkMapAll(char *recname, jlink_map_fn rtn, void *ctx)
Question about alarms and embedded links: Currently a link that wants to raise an alarm does so by calling recGblSetSevr(plink->record, stat, sevr), so for embedded links the parent link has no idea that the child raised an alarm or what alarm state it's in. Should I add an lset routine and a dbLink wrapper for handling alarms from child links, which for a top-level link (or when this is unimplemented in the parent) would call recGblSetSevr()? This way the parent could see and filter the child's alarms if it wanted to.
I think I'm done implementing for the weekend now. I'll check back for any comments later, but I have to produce a 45-minute talk to give at LBNL in 7 days time, and 4.6.0 is also due out this week too.
What if anything do you think is still missing or wrong in this code? Ahh, except for still having a broken dbPutLinkTest...
Added the 'dbjlr <record> <level>' command that calls jlif::report() for all JSON_LINKs: child, level-1, indent+4)
void (*report)(const jlink *, int level, int indent);
/* Optional, print status information about this link instance, then
* if (level > 0) print a link identifier (at indent+2) and call
* dbJLinkReport(
* for each child.
*/
The report method is intended for individual status reports and not collecting summary statistics, but I've also added another optional jlif routine for recursing through all child links: map_fn) (jlink *, void *ctx);
typedef long (*jlink_
long (*map_children) (jlink *, jlink_map_fn rtn, void *ctx); ren() on all embedded links.
/* Optional, call dbJLinkMapChild
* Stop immediately and return status if non-zero.
*/
There is also a top-level API for running that on all records:
long dbJLinkMapAll(char *recname, jlink_map_fn rtn, void *ctx)
Question about alarms and embedded links: Currently a link that wants to raise an alarm does so by calling recGblSetSevr( plink-> record, stat, sevr), so for embedded links the parent link has no idea that the child raised an alarm or what alarm state it's in. Should I add an lset routine and a dbLink wrapper for handling alarms from child links, which for a top-level link (or when this is unimplemented in the parent) would call recGblSetSevr()? This way the parent could see and filter the child's alarms if it wanted to.
I think I'm done implementing for the weekend now. I'll check back for any comments later, but I have to produce a 45-minute talk to give at LBNL in 7 days time, and 4.6.0 is also due out this week too.
What if anything do you think is still missing or wrong in this code? Ahh, except for still having a broken dbPutLinkTest...
Thanks!