dbLink: Clarify meaning of lset isConstant and isVolatile flags
Modify dbIsLinkConnected() to check lset->isVolatile first.
This commit is contained in:
@@ -265,8 +265,19 @@ int dbIsLinkConnected(const struct link *plink)
|
||||
{
|
||||
lset *plset = plink->lset;
|
||||
|
||||
if (!plset || !plset->isConnected)
|
||||
if (!plset)
|
||||
return FALSE;
|
||||
if (!plset->isVolatile)
|
||||
return TRUE;
|
||||
|
||||
if (!plset->isConnected) {
|
||||
struct dbCommon *precord = plink->precord;
|
||||
|
||||
errlogPrintf("dbLink: Link type for '%s.%s' is volatile but has no"
|
||||
" lset::isConnected() method\n",
|
||||
precord->name, link_field_name(plink));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return plset->isConnected(plink);
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ typedef long (*dbLinkUserCallback)(struct link *plink, void *priv);
|
||||
|
||||
typedef struct lset {
|
||||
/* Characteristics of the link type */
|
||||
const unsigned isConstant:1;
|
||||
const unsigned isVolatile:1;
|
||||
const unsigned isConstant:1; /* 1 means value doesn't change */
|
||||
const unsigned isVolatile:1; /* 0 means link always connected */
|
||||
|
||||
/* Activation */
|
||||
void (*openLink)(struct link *plink);
|
||||
|
||||
Reference in New Issue
Block a user