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;
110 _reserveElements = numElements;
114 inline bool Pothos::InputPort::asyncMessagesEmpty(
void)
116 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
117 return _asyncMessages.empty();
122 std::lock_guard<Util::SpinLock> lock(_asyncMessagesLock);
124 auto msg = _asyncMessages.front().first;
125 _asyncMessages.pop_front();
129 inline void Pothos::InputPort::inlineMessagesPush(
const Pothos::Label &label)
131 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
132 if (_inputInlineMessages.full()) _inputInlineMessages.set_capacity(_inputInlineMessages.capacity()*2);
133 _inputInlineMessages.push_back(label);
136 inline void Pothos::InputPort::inlineMessagesClear(
void)
138 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
139 _inputInlineMessages.clear();
140 _inlineMessages.clear();
145 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
146 while (not _inputInlineMessages.empty())
148 const auto &front = _inputInlineMessages.front();
149 _inlineMessages.push_back(front.toAdjusted(1, this->dtype().size()));
150 _inputInlineMessages.pop_front();
152 buff = _bufferAccumulator.front();
155 inline void Pothos::InputPort::bufferAccumulatorPush(
const BufferChunk &buffer)
157 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
158 this->bufferAccumulatorPushNoLock(buffer);
161 inline void Pothos::InputPort::bufferAccumulatorRequire(
const size_t numBytes)
163 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
164 _bufferAccumulator.require(numBytes);
167 inline void Pothos::InputPort::bufferAccumulatorClear(
void)
169 std::lock_guard<Util::SpinLock> lock(_bufferAccumulatorLock);
170 _bufferAccumulator = BufferAccumulator();
Definition: Object.hpp:55
Definition: BufferChunk.hpp:26