47 return _totalElements;
62 return _totalMessages;
67 _pendingElements += numElements;
77 _readBeforeWritePort = port;
80 template <
typename ValueType>
83 Pothos::OutputPort::_postMessage(
Pothos::Object(std::forward<ValueType>(message)));
88 this->bufferManagerPop(numBytes);
94 this->bufferManagerPop(numElements*this->dtype().size());
100 auto &queue = _postedBuffers;
101 if (queue.full()) queue.set_capacity(queue.size()*2);
102 queue.push_back(buffer);
105 if (not buffer.
dtype) queue.back().dtype = this->dtype();
113 _postedLabels.push_back(label.
toAdjusted(this->dtype().size(), 1));
121 if (numElements > _reserveElements) _workEvents++;
123 _reserveElements = numElements;
126 inline bool Pothos::OutputPort::bufferManagerEmpty(
void)
128 std::lock_guard<Util::SpinLock> lock(_bufferManagerLock);
129 return not _bufferManager or _bufferManager->empty();
134 std::lock_guard<Util::SpinLock> lock(_bufferManagerLock);
136 buff = _bufferManager->front();
139 inline void Pothos::OutputPort::bufferManagerPop(
const size_t numBytes)
141 std::lock_guard<Util::SpinLock> lock(_bufferManagerLock);
142 return _bufferManager->pop(numBytes);
145 inline bool Pothos::OutputPort::tokenManagerEmpty(
void)
147 std::lock_guard<Util::SpinLock> lock(_tokenManagerLock);
148 return not _tokenManager or _tokenManager->empty();
153 std::lock_guard<Util::SpinLock> lock(_tokenManagerLock);
155 auto tok = _tokenManager->front();
156 _tokenManager->pop(0);
160 inline void Pothos::OutputPort::tokenManagerPop(
const size_t numBytes)
162 std::lock_guard<Util::SpinLock> lock(_tokenManagerLock);
163 return _tokenManager->pop(numBytes);
unsigned long long totalLabels(void) const
Definition: OutputPortImpl.hpp:55
void popElements(const size_t numElements)
Definition: OutputPortImpl.hpp:92
size_t elements(void) const
Definition: OutputPortImpl.hpp:40
const std::string & name(void) const
Get the string name identifier for this port.
Definition: OutputPortImpl.hpp:20
void popBuffer(const size_t numBytes)
Definition: OutputPortImpl.hpp:86
Label toAdjusted(const MultType &mult, const DivType &div) const
void postBuffer(const BufferChunk &buffer)
Definition: OutputPortImpl.hpp:98
unsigned long long totalElements(void) const
Definition: OutputPortImpl.hpp:45
const DType & dtype(void) const
Get the data type information for this port.
Definition: OutputPortImpl.hpp:25
Definition: Object.hpp:55
void produce(const size_t numElements)
Definition: OutputPortImpl.hpp:65
void postLabel(const Label &label)
Definition: OutputPortImpl.hpp:111
const BufferChunk & buffer(void) const
Definition: OutputPortImpl.hpp:35
const std::string & domain(void) const
Get the domain information for this port.
Definition: OutputPortImpl.hpp:30
void setReserve(const size_t numElements)
Definition: OutputPortImpl.hpp:118
int index(void) const
Definition: OutputPortImpl.hpp:15
DType dtype
Definition: BufferChunk.hpp:102
bool isSignal(void) const
Definition: OutputPortImpl.hpp:70
Definition: BufferChunk.hpp:30
unsigned long long totalMessages(void) const
Definition: OutputPortImpl.hpp:60
void setReadBeforeWrite(InputPort *port)
Definition: OutputPortImpl.hpp:75
void postMessage(ValueType &&message)
Definition: OutputPortImpl.hpp:81
unsigned long long totalBuffers(void) const
Definition: OutputPortImpl.hpp:50