47 return _totalElements;
62 return _totalMessages;
72 _pendingElements += numElements;
77 return not this->asyncMessagesEmpty();
87 auto msg = this->asyncMessagesPop();
95 for (
auto it = _inlineMessages.begin(); it != _inlineMessages.end(); it++)
99 _inlineMessages.erase(it);
100 _labelIter = _inlineMessages;
111 if (numElements > _reserveElements) _workEvents++;
113 _reserveElements = numElements;
116 inline bool Pothos::InputPort::asyncMessagesEmpty(
void)
118 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
119 return _asyncMessages.empty();
124 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
126 auto msg = _asyncMessages.front().first;
127 _asyncMessages.pop_front();
131 inline void Pothos::InputPort::inlineMessagesPush(
const Pothos::Label &label)
133 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
134 if (_inputInlineMessages.full()) _inputInlineMessages.set_capacity(_inputInlineMessages.capacity()*2);
135 _inputInlineMessages.push_back(label);
138 inline void Pothos::InputPort::inlineMessagesClear(
void)
140 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
141 _inputInlineMessages.clear();
142 _inlineMessages.clear();
147 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
148 while (not _inputInlineMessages.empty())
150 const auto &front = _inputInlineMessages.front();
151 _inlineMessages.push_back(front.toAdjusted(1, this->dtype().size()));
152 _inputInlineMessages.pop_front();
154 buff = _bufferAccumulator.front();
157 inline void Pothos::InputPort::bufferAccumulatorPush(
const BufferChunk &buffer)
159 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
160 this->bufferAccumulatorPushNoLock(buffer);
163 inline void Pothos::InputPort::bufferAccumulatorRequire(
const size_t numBytes)
165 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
166 _bufferAccumulator.require(numBytes);
169 inline void Pothos::InputPort::bufferAccumulatorClear(
void)
171 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
172 _bufferAccumulator = BufferAccumulator();
Definition: Object.hpp:55
Definition: BufferChunk.hpp:26