#include <TokenStream.h>
An input channel of a stream.
Definition at line 51 of file TokenStream.h.
◆ Channel() [1/4]
TokenStream::Channel::Channel |
( |
const std::shared_ptr< TokenStream > & |
stream | ) |
|
|
explicit |
- Parameters
-
stream | the stream associated to this channel. |
Definition at line 78 of file TokenStream.cpp.
std::atomic< bool > isOpened_
std::atomic< bool > hasValidIterator_
std::shared_ptr< TokenStream > stream_
◆ ~Channel() [1/2]
TokenStream::Channel::~Channel |
( |
| ) |
|
◆ Channel() [2/4]
knowrob::TokenStream::Channel::Channel |
( |
const Channel & |
| ) |
|
|
delete |
◆ Channel() [3/4]
knowrob::TokenStream::Channel::Channel |
( |
const std::shared_ptr< TokenStream > & |
stream | ) |
|
|
explicit |
- Parameters
-
stream | the stream associated to this channel. |
◆ ~Channel() [2/2]
knowrob::TokenStream::Channel::~Channel |
( |
| ) |
|
◆ Channel() [4/4]
knowrob::TokenStream::Channel::Channel |
( |
const Channel & |
| ) |
|
|
delete |
◆ close() [1/2]
void TokenStream::Channel::close |
( |
| ) |
|
◆ close() [2/2]
void knowrob::TokenStream::Channel::close |
( |
| ) |
|
◆ create() [1/2]
Create a new stream channel. Note that this will generate an error in case the stream is closed already.
- Returns
- a new stream channel
Definition at line 88 of file TokenStream.cpp.
92 std::lock_guard<std::mutex> lock1(stream->channel_mutex_);
93 if (stream->isOpened()) {
94 auto channel = std::make_shared<TokenStream::Channel>(stream);
95 stream->channels_.push_back(channel);
96 channel->iterator_ = stream->channels_.end();
100 throw QueryError(
"cannot create a channel of a closed stream");
◆ create() [2/2]
static std::shared_ptr<Channel> knowrob::TokenStream::Channel::create |
( |
const std::shared_ptr< TokenStream > & |
stream | ) |
|
|
static |
Create a new stream channel. Note that this will generate an error in case the stream is closed already.
- Returns
- a new stream channel
◆ hasValidIterator() [1/2]
bool knowrob::TokenStream::Channel::hasValidIterator |
( |
| ) |
const |
|
inline |
- Returns
- true if the iterator is valid
Definition at line 92 of file TokenStream.h.
◆ hasValidIterator() [2/2]
bool knowrob::TokenStream::Channel::hasValidIterator |
( |
| ) |
const |
|
inline |
- Returns
- true if the iterator is valid
Definition at line 92 of file TokenStream.h.
◆ id() [1/2]
uint32_t TokenStream::Channel::id |
( |
| ) |
const |
- Returns
- the id of this channel
Definition at line 117 of file TokenStream.cpp.
118 return reinterpret_cast<std::uintptr_t
>(
this);
◆ id() [2/2]
uint32_t knowrob::TokenStream::Channel::id |
( |
| ) |
const |
- Returns
- the id of this channel
◆ invalidateIterator() [1/2]
void knowrob::TokenStream::Channel::invalidateIterator |
( |
| ) |
|
|
inline |
Invalidate the iterator of this channel
Definition at line 97 of file TokenStream.h.
◆ invalidateIterator() [2/2]
void knowrob::TokenStream::Channel::invalidateIterator |
( |
| ) |
|
|
inline |
Invalidate the iterator of this channel
Definition at line 97 of file TokenStream.h.
◆ isOpened() [1/2]
bool TokenStream::Channel::isOpened |
( |
| ) |
const |
◆ isOpened() [2/2]
bool knowrob::TokenStream::Channel::isOpened |
( |
| ) |
const |
◆ push() [1/2]
void TokenStream::Channel::push |
( |
const TokenPtr & |
tok | ) |
|
Push a QueryResult into this channel.
- Parameters
-
tok | a QueryResult pointer. |
Definition at line 121 of file TokenStream.cpp.
124 std::shared_lock<std::shared_mutex> lock(
mutex_);
127 if (tok->indicatesEndOfEvaluation()) {
131 }
else if (!tok->indicatesEndOfEvaluation()) {
132 KB_WARN(
"message pushed to closed stream {}",
reinterpret_cast<std::uintptr_t
>(
this));
◆ push() [2/2]
void knowrob::TokenStream::Channel::push |
( |
const TokenPtr & |
tok | ) |
|
Push a QueryResult into this channel.
- Parameters
-
tok | a QueryResult pointer. |
◆ TokenStream
◆ hasValidIterator_
std::atomic< bool > knowrob::TokenStream::Channel::hasValidIterator_ |
|
protected |
◆ isOpened_
std::atomic< bool > knowrob::TokenStream::Channel::isOpened_ |
|
protected |
◆ iterator_
std::list< std::shared_ptr< Channel > >::iterator knowrob::TokenStream::Channel::iterator_ |
|
protected |
◆ mutex_
std::shared_mutex knowrob::TokenStream::Channel::mutex_ |
|
protected |
◆ stream_
std::shared_ptr< TokenStream > knowrob::TokenStream::Channel::stream_ |
|
protected |
The documentation for this class was generated from the following files: