better implementation of ChannelArray::getLength
This commit is contained in:
@ -1014,10 +1014,22 @@ void ChannelArrayLocal::putArray(
|
|||||||
|
|
||||||
void ChannelArrayLocal::getLength()
|
void ChannelArrayLocal::getLength()
|
||||||
{
|
{
|
||||||
channelArrayRequester->getLengthDone(
|
size_t length = 0;
|
||||||
Status::Ok,getPtrSelf(),
|
size_t capacity = 0;
|
||||||
pvArray->getLength(),
|
const char *exceptionMessage = NULL;
|
||||||
pvArray->getCapacity());
|
pvRecord->lock();
|
||||||
|
try {
|
||||||
|
length = pvArray->getLength();
|
||||||
|
capacity = pvArray->getCapacity();
|
||||||
|
} catch(std::exception e) {
|
||||||
|
exceptionMessage = e.what();
|
||||||
|
}
|
||||||
|
pvRecord->unlock();
|
||||||
|
Status status = Status::Ok;
|
||||||
|
if(exceptionMessage!=NULL) {
|
||||||
|
status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage);
|
||||||
|
}
|
||||||
|
channelArrayRequester->getLengthDone(status,getPtrSelf(),length,capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelArrayLocal::setLength(size_t length, size_t capacity)
|
void ChannelArrayLocal::setLength(size_t length, size_t capacity)
|
||||||
|
Reference in New Issue
Block a user