get/setLength capacity removed
This commit is contained in:
@@ -166,16 +166,15 @@ namespace pvAccess {
|
||||
virtual void getArray(size_t offset = 0, size_t count = 0, size_t stride = 1) = 0;
|
||||
|
||||
/**
|
||||
* Get the length and the capacity.
|
||||
* Get the length.
|
||||
*/
|
||||
virtual void getLength() = 0;
|
||||
|
||||
/**
|
||||
* Set the length and/or the capacity.
|
||||
* @param length The new length.
|
||||
* @param capacity The new capacity, 0 means do "do not change the capacity".
|
||||
*/
|
||||
virtual void setLength(size_t length, size_t capacity = 0) = 0;
|
||||
virtual void setLength(size_t length) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -221,12 +220,11 @@ namespace pvAccess {
|
||||
* @param status Completion status.
|
||||
* @param channelArray The channelArray interface.
|
||||
* @param length The length of the array, 0 if the request failed.
|
||||
* @param capacity The capacity of the array, 0 if the request failed.
|
||||
*/
|
||||
virtual void getLengthDone(
|
||||
const epics::pvData::Status& status,
|
||||
ChannelArray::shared_pointer const & channelArray,
|
||||
size_t length, size_t capacity) = 0;
|
||||
size_t length) = 0;
|
||||
|
||||
/**
|
||||
* The request is done. This is always called with no locks held.
|
||||
|
||||
@@ -1574,7 +1574,6 @@ namespace epics {
|
||||
size_t m_stride;
|
||||
|
||||
size_t m_length;
|
||||
size_t m_capacity;
|
||||
|
||||
Mutex m_structureMutex;
|
||||
|
||||
@@ -1583,7 +1582,7 @@ namespace epics {
|
||||
m_channelArrayRequester(channelArrayRequester),
|
||||
m_pvRequest(pvRequest),
|
||||
m_offset(0), m_count(0),
|
||||
m_length(0), m_capacity(0)
|
||||
m_length(0)
|
||||
{
|
||||
PVACCESS_REFCOUNT_MONITOR_CONSTRUCT(channelArray);
|
||||
}
|
||||
@@ -1651,7 +1650,6 @@ namespace epics {
|
||||
{
|
||||
// lock... see comment below
|
||||
SerializeHelper::writeSize(m_length, buffer, control);
|
||||
SerializeHelper::writeSize(m_capacity, buffer, control);
|
||||
}
|
||||
else if (pendingRequest & QOS_PROCESS) // i.e. getLength
|
||||
{
|
||||
@@ -1721,9 +1719,8 @@ namespace epics {
|
||||
else if (qos & QOS_PROCESS)
|
||||
{
|
||||
size_t length = SerializeHelper::readSize(payloadBuffer, transport.get());
|
||||
size_t capacity = SerializeHelper::readSize(payloadBuffer, transport.get());
|
||||
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(status, thisChannelArray, length, capacity));
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(status, thisChannelArray, length));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1813,7 +1810,7 @@ namespace epics {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void setLength(size_t length, size_t capacity) {
|
||||
virtual void setLength(size_t length) {
|
||||
|
||||
ChannelArray::shared_pointer thisChannelArray = dynamic_pointer_cast<ChannelArray>(shared_from_this());
|
||||
|
||||
@@ -1838,7 +1835,6 @@ namespace epics {
|
||||
{
|
||||
Lock lock(m_structureMutex);
|
||||
m_length = length;
|
||||
m_capacity = capacity;
|
||||
}
|
||||
m_channel->checkAndGetTransport()->enqueueSendRequest(shared_from_this());
|
||||
} catch (std::runtime_error &rte) {
|
||||
@@ -1855,17 +1851,17 @@ namespace epics {
|
||||
{
|
||||
Lock guard(m_mutex);
|
||||
if (m_destroyed) {
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(destroyedStatus, thisChannelArray, 0, 0));
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(destroyedStatus, thisChannelArray, 0));
|
||||
return;
|
||||
}
|
||||
if (!m_initialized) {
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(notInitializedStatus, thisChannelArray, 0, 0));
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(notInitializedStatus, thisChannelArray, 0));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!startRequest(m_lastRequest.get() ? QOS_DESTROY | QOS_PROCESS : QOS_PROCESS)) {
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(otherRequestPendingStatus, thisChannelArray, 0, 0));
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(otherRequestPendingStatus, thisChannelArray, 0));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1873,7 +1869,7 @@ namespace epics {
|
||||
m_channel->checkAndGetTransport()->enqueueSendRequest(shared_from_this());
|
||||
} catch (std::runtime_error &rte) {
|
||||
stopRequest();
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(channelNotConnected, thisChannelArray, 0, 0));
|
||||
EXCEPTION_GUARD(m_channelArrayRequester->getLengthDone(channelNotConnected, thisChannelArray, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1801,8 +1801,7 @@ void ServerArrayHandler::handleResponse(osiSockAddr* responseFrom,
|
||||
else if (setLength)
|
||||
{
|
||||
size_t length = SerializeHelper::readSize(payloadBuffer, transport.get());
|
||||
size_t capacity = SerializeHelper::readSize(payloadBuffer, transport.get());
|
||||
request->getChannelArray()->setLength(length, capacity);
|
||||
request->getChannelArray()->setLength(length);
|
||||
}
|
||||
else if (getLength)
|
||||
{
|
||||
@@ -1909,13 +1908,12 @@ void ServerChannelArrayRequesterImpl::setLengthDone(const Status& status, Channe
|
||||
}
|
||||
|
||||
void ServerChannelArrayRequesterImpl::getLengthDone(const Status& status, ChannelArray::shared_pointer const & /*channelArray*/,
|
||||
size_t length, size_t capacity)
|
||||
size_t length)
|
||||
{
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
_status = status;
|
||||
_length = length;
|
||||
_capacity = capacity;
|
||||
}
|
||||
TransportSender::shared_pointer thisSender = shared_from_this();
|
||||
_transport->enqueueSendRequest(thisSender);
|
||||
@@ -1987,7 +1985,6 @@ void ServerChannelArrayRequesterImpl::send(ByteBuffer* buffer, TransportSendCont
|
||||
{
|
||||
//Lock guard(_mutex);
|
||||
SerializeHelper::writeSize(_length, buffer, control);
|
||||
SerializeHelper::writeSize(_capacity, buffer, control);
|
||||
}
|
||||
else if ((QOS_INIT & request) != 0)
|
||||
{
|
||||
|
||||
@@ -584,7 +584,7 @@ namespace pvAccess {
|
||||
void putArrayDone(const epics::pvData::Status& status, ChannelArray::shared_pointer const & channelArray);
|
||||
void setLengthDone(const epics::pvData::Status& status, ChannelArray::shared_pointer const & channelArray);
|
||||
void getLengthDone(const epics::pvData::Status& status, ChannelArray::shared_pointer const & channelArray,
|
||||
std::size_t length, std::size_t capacity);
|
||||
std::size_t length);
|
||||
void lock();
|
||||
void unlock();
|
||||
void destroy();
|
||||
@@ -605,7 +605,6 @@ namespace pvAccess {
|
||||
epics::pvData::PVArray::shared_pointer _pvPutArray;
|
||||
|
||||
std::size_t _length;
|
||||
std::size_t _capacity;
|
||||
epics::pvData::Status _status;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user