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 auto &queue = _postedBuffers;
95 if (queue.full()) queue.set_capacity(queue.size()*2);
96 queue.push_back(buffer);
99 if (not buffer.
dtype) queue.back().dtype = this->dtype();
107 _postedLabels.push_back(label.
toAdjusted(this->dtype().size(), 1));
112 inline bool Pothos::OutputPort::bufferManagerEmpty(
void)
114 std::lock_guard<Util::SpinLock> lock(_bufferManagerLock);
115 return not _bufferManager or _bufferManager->empty();
120 std::lock_guard<Util::SpinLock> lock(_bufferManagerLock);
122 buff = _bufferManager->front();
125 inline void Pothos::OutputPort::bufferManagerPop(
const size_t numBytes)
127 std::lock_guard<Util::SpinLock> lock(_bufferManagerLock);
128 return _bufferManager->pop(numBytes);
131 inline bool Pothos::OutputPort::tokenManagerEmpty(
void)
133 std::lock_guard<Util::SpinLock> lock(_tokenManagerLock);
134 return not _tokenManager or _tokenManager->empty();
139 std::lock_guard<Util::SpinLock> lock(_tokenManagerLock);
141 auto tok = _tokenManager->front();
142 _tokenManager->pop(0);
146 inline void Pothos::OutputPort::tokenManagerPop(
const size_t numBytes)
148 std::lock_guard<Util::SpinLock> lock(_tokenManagerLock);
149 return _tokenManager->pop(numBytes);
unsigned long long totalLabels(void) const
Definition: OutputPortImpl.hpp:55
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:92
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:105
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
int index(void) const
Definition: OutputPortImpl.hpp:15
DType dtype
Definition: BufferChunk.hpp:83
bool isSignal(void) const
Definition: OutputPortImpl.hpp:70
Definition: BufferChunk.hpp:26
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