47 return _totalElements;
62 return _totalMessages;
72 _pendingElements += numElements;
77 return std::move(_buffer);
82 return not this->asyncMessagesEmpty();
92 auto msg = this->asyncMessagesPop();
100 return this->asyncMessagesPeek();
105 for (
auto it = _inlineMessages.begin(); it != _inlineMessages.end(); it++)
109 _inlineMessages.erase(it);
110 _labelIter = _inlineMessages;
121 if (numElements > _reserveElements) _workEvents++;
123 _reserveElements = numElements;
126 inline bool Pothos::InputPort::asyncMessagesEmpty(
void)
128 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
129 return _asyncMessages.empty();
134 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
136 auto msg = std::move(_asyncMessages.front().first);
137 _asyncMessages.pop_front();
143 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
145 return _asyncMessages.front().first;
148 inline void Pothos::InputPort::inlineMessagesPush(
const Pothos::Label &label)
150 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
151 if (_inputInlineMessages.full()) _inputInlineMessages.set_capacity(_inputInlineMessages.capacity()*2);
152 _inputInlineMessages.push_back(label);
155 inline void Pothos::InputPort::inlineMessagesClear(
void)
157 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
158 _inputInlineMessages.clear();
159 _inlineMessages.clear();
164 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
165 while (not _inputInlineMessages.empty())
167 _inlineMessages.push_back(std::move(_inputInlineMessages.front()));
168 _inlineMessages.back().adjust(1, this->
dtype().size());
169 _inputInlineMessages.pop_front();
171 buff = _bufferAccumulator.
front();
176 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
177 this->bufferAccumulatorPushNoLock(
BufferChunk(buffer));
180 inline void Pothos::InputPort::bufferAccumulatorRequire(
const size_t numBytes)
182 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
183 _bufferAccumulator.
require(numBytes);
186 inline void Pothos::InputPort::bufferAccumulatorClear(
void)
188 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
Definition: BufferAccumulator.hpp:31
const BufferChunk & front(void) const
Definition: BufferAccumulator.hpp:100
Definition: Object.hpp:47
void require(const size_t numBytes)
Definition: BufferChunk.hpp:30