47 return _totalElements;
62 return _totalMessages;
72 _pendingElements += numElements;
77 return not this->asyncMessagesEmpty();
87 auto msg = this->asyncMessagesPop();
95 return this->asyncMessagesPeek();
100 for (
auto it = _inlineMessages.begin(); it != _inlineMessages.end(); it++)
104 _inlineMessages.erase(it);
105 _labelIter = _inlineMessages;
116 if (numElements > _reserveElements) _workEvents++;
118 _reserveElements = numElements;
121 inline bool Pothos::InputPort::asyncMessagesEmpty(
void)
123 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
124 return _asyncMessages.empty();
129 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
131 auto msg = _asyncMessages.front().first;
132 _asyncMessages.pop_front();
138 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
140 return _asyncMessages.front().first;
143 inline void Pothos::InputPort::inlineMessagesPush(
const Pothos::Label &label)
145 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
146 if (_inputInlineMessages.full()) _inputInlineMessages.set_capacity(_inputInlineMessages.capacity()*2);
147 _inputInlineMessages.push_back(label);
150 inline void Pothos::InputPort::inlineMessagesClear(
void)
152 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
153 _inputInlineMessages.clear();
154 _inlineMessages.clear();
159 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
160 while (not _inputInlineMessages.empty())
162 const auto &front = _inputInlineMessages.front();
163 _inlineMessages.push_back(front.toAdjusted(1, this->dtype().size()));
164 _inputInlineMessages.pop_front();
166 buff = _bufferAccumulator.
front();
171 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
172 this->bufferAccumulatorPushNoLock(buffer);
175 inline void Pothos::InputPort::bufferAccumulatorRequire(
const size_t numBytes)
177 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
178 _bufferAccumulator.
require(numBytes);
181 inline void Pothos::InputPort::bufferAccumulatorClear(
void)
183 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
Definition: BufferAccumulator.hpp:31
const BufferChunk & front(void) const
Definition: BufferAccumulator.hpp:100
Definition: Object.hpp:55
void require(const size_t numBytes)
Definition: BufferChunk.hpp:30