Make attach* functions return bool in multi-channel types

The attachAlarm and attachTimeStamps() return true if successful, false
otherwise in other classes. In NTMultiChannel and NTScalarMultiChannel
they returned void. Bring multi-channel behaviour in line.
This commit is contained in:
Dave Hickin
2015-08-20 17:23:59 +01:00
parent 5076057d8d
commit 000dde0454
4 changed files with 41 additions and 28 deletions

View File

@@ -278,16 +278,20 @@ NTMultiChannel::NTMultiChannel(PVStructurePtr const & pvStructure)
}
void NTMultiChannel::attachTimeStamp(PVTimeStamp &pv) const
bool NTMultiChannel::attachTimeStamp(PVTimeStamp &pv) const
{
if(!pvTimeStamp) return;
pv.attach(pvTimeStamp);
if (pvTimeStamp)
return pv.attach(pvTimeStamp);
else
return false;
}
void NTMultiChannel::attachAlarm(PVAlarm &pv) const
bool NTMultiChannel::attachAlarm(PVAlarm &pv) const
{
if(!pvAlarm) return;
pv.attach(pvAlarm);
if (pvAlarm)
return pv.attach(pvAlarm);
else
return false;
}
}}

View File

@@ -212,18 +212,21 @@ public:
* Destructor
*/
~NTMultiChannel() {}
/**
* Attach a pvTimeStamp.
* @param pvTimeStamp The pvTimeStamp that will be attached.
* Does nothing if no timeStamp
*/
void attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
/**
* Attach a pvTimeStamp.
* @param pvTimeStamp The pvTimeStamp that will be attached.
* Does nothing if no timeStamp.
* @return true if the operation was successfull (i.e. this instance
has a timeStamp field), otherwise false.
*/
bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
/**
* Attach a pvAlarm.
* @param pvAlarm The pvAlarm that will be attached.
* Does nothing if no alarm
* Does nothing if no alarm.
* @return true if the operation was successfull (i.e. this instance has a timeStamp field), otherwise false.
*/
void attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
/**
* Get the pvStructure.
* @return PVStructurePtr.

View File

@@ -275,16 +275,20 @@ NTScalarMultiChannel::NTScalarMultiChannel(PVStructurePtr const & pvStructure)
}
void NTScalarMultiChannel::attachTimeStamp(PVTimeStamp &pv) const
bool NTScalarMultiChannel::attachTimeStamp(PVTimeStamp &pv) const
{
if(!pvTimeStamp) return;
pv.attach(pvTimeStamp);
if (pvTimeStamp)
return pv.attach(pvTimeStamp);
else
return false;
}
void NTScalarMultiChannel::attachAlarm(PVAlarm &pv) const
bool NTScalarMultiChannel::attachAlarm(PVAlarm &pv) const
{
if(!pvAlarm) return;
pv.attach(pvAlarm);
if (pvAlarm)
return pv.attach(pvAlarm);
else
return false;
}
}}

View File

@@ -213,18 +213,20 @@ public:
* Destructor
*/
~NTScalarMultiChannel() {}
/**
* Attach a pvTimeStamp.
* @param pvTimeStamp The pvTimeStamp that will be attached.
* Does nothing if no timeStamp
*/
void attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
/**
* Attach a pvTimeStamp.
* @param pvTimeStamp The pvTimeStamp that will be attached.
* Does nothing if no timeStamp.
* @return true if the operation was successfull (i.e. this instance has a timeStamp field), otherwise false.
*/
bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
/**
* Attach a pvAlarm.
* @param pvAlarm The pvAlarm that will be attached.
* Does nothing if no alarm
* Does nothing if no alarm.
* @return true if the operation was successfull (i.e. this instance has a timeStamp field), otherwise false.
*/
void attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
/**
* Get the pvStructure.
* @return PVStructurePtr.