|
knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <TokenBuffer.h>


Public Member Functions | |
| TokenBuffer () | |
| void | stopBuffering () |
| std::shared_ptr< TokenQueue > | createQueue () |
| TokenBuffer () | |
| void | stopBuffering () |
| std::shared_ptr< TokenQueue > | createQueue () |
Public Member Functions inherited from knowrob::TokenBroadcaster | |
| TokenBroadcaster () | |
| ~TokenBroadcaster () override | |
| void | addSubscriber (const std::shared_ptr< Channel > &subscriber) |
| void | removeSubscriber (const std::shared_ptr< Channel > &subscriber) |
| TokenBroadcaster () | |
| ~TokenBroadcaster () override | |
| void | addSubscriber (const std::shared_ptr< Channel > &subscriber) |
| void | removeSubscriber (const std::shared_ptr< Channel > &subscriber) |
Public Member Functions inherited from knowrob::TokenStream | |
| TokenStream () | |
| virtual | ~TokenStream () |
| TokenStream (const TokenStream &)=delete | |
| virtual void | close () |
| bool | isOpened () const |
| TokenStream () | |
| virtual | ~TokenStream () |
| TokenStream (const TokenStream &)=delete | |
| virtual void | close () |
| bool | isOpened () const |
Protected Member Functions | |
| void | push (const TokenPtr &tok) override |
| void | push (const TokenPtr &tok) override |
Protected Member Functions inherited from knowrob::TokenBroadcaster | |
| virtual void | pushToBroadcast (const TokenPtr &tok) |
| virtual void | pushToBroadcast (const TokenPtr &tok) |
Protected Member Functions inherited from knowrob::TokenStream | |
| virtual void | push (Channel &channel, const TokenPtr &tok) |
| virtual void | push (Channel &channel, const TokenPtr &tok) |
Protected Attributes | |
| std::mutex | bufferMutex_ |
| std::atomic< bool > | isBuffering_ |
| std::list< TokenPtr > | buffer_ |
Protected Attributes inherited from knowrob::TokenBroadcaster | |
| std::list< std::shared_ptr< Channel > > | subscribers_ |
| std::mutex | mtx_ |
Protected Attributes inherited from knowrob::TokenStream | |
| std::list< std::shared_ptr< Channel > > | channels_ |
| std::atomic< bool > | isOpened_ |
| std::mutex | channel_mutex_ |
A token stream that buffers all input until stopBuffering() is called. The main purpose is to avoid losing messages while building a pipeline, such that pipeline can be partially active during construction. Also TokenBuffer provides an easy exit point for a pipeline by creating a queue.
Definition at line 19 of file TokenBuffer.h.
| TokenBuffer::TokenBuffer | ( | ) |
Definition at line 15 of file TokenBuffer.cpp.
| knowrob::TokenBuffer::TokenBuffer | ( | ) |
| std::shared_ptr< TokenQueue > TokenBuffer::createQueue | ( | ) |
Create a queue that will receive all output tokens of this stream.
Definition at line 39 of file TokenBuffer.cpp.
| std::shared_ptr<TokenQueue> knowrob::TokenBuffer::createQueue | ( | ) |
Create a queue that will receive all output tokens of this stream.
|
overrideprotectedvirtual |
Reimplemented from knowrob::TokenBroadcaster.
Definition at line 46 of file TokenBuffer.cpp.
|
overrideprotectedvirtual |
Reimplemented from knowrob::TokenBroadcaster.
| void TokenBuffer::stopBuffering | ( | ) |
Stop buffering and forward all buffered tokens to subscribers.
Definition at line 18 of file TokenBuffer.cpp.
| void knowrob::TokenBuffer::stopBuffering | ( | ) |
Stop buffering and forward all buffered tokens to subscribers.
|
protected |
Definition at line 37 of file TokenBuffer.h.
|
protected |
Definition at line 35 of file TokenBuffer.h.
|
protected |
Definition at line 36 of file TokenBuffer.h.