Files
pvxs/ioc/localfieldlog.cpp
T
2023-05-09 10:17:32 -07:00

31 lines
895 B
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 "localfieldlog.h"
namespace pvxs {
namespace ioc {
LocalFieldLog::LocalFieldLog(dbChannel* pDbChannel, db_field_log* existingFieldLog)
:pFieldLog(existingFieldLog) {
if (!pFieldLog && (ellCount(&pDbChannel->pre_chain) != 0 || ellCount(&pDbChannel->pre_chain) == 0)) {
pFieldLog = db_create_read_log(pDbChannel);
if (pFieldLog) {
pFieldLog = dbChannelRunPreChain(pDbChannel, pFieldLog);
if (pFieldLog) {
pFieldLog = dbChannelRunPostChain(pDbChannel, pFieldLog);
owned = true;
}
}
}
}
} // pvxs
} // ioc