knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::AnswerTransformer Class Referenceabstract

#include <AnswerTransformer.h>

Inheritance diagram for knowrob::AnswerTransformer:
Collaboration diagram for knowrob::AnswerTransformer:

Public Member Functions

 AnswerTransformer ()
 
virtual TokenPtr transform (const TokenPtr &tok)=0
 
 AnswerTransformer ()
 
virtual TokenPtr transform (const TokenPtr &tok)=0
 
- 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)
 
void push (const TokenPtr &tok) override
 
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)
 

Additional Inherited Members

- 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_
 

Detailed Description

Broadcasts each input message after applying a transformation.

Definition at line 18 of file AnswerTransformer.h.

Constructor & Destructor Documentation

◆ AnswerTransformer() [1/2]

knowrob::AnswerTransformer::AnswerTransformer ( )
inlineexplicit

Definition at line 20 of file AnswerTransformer.h.

◆ AnswerTransformer() [2/2]

knowrob::AnswerTransformer::AnswerTransformer ( )
inlineexplicit

Definition at line 20 of file AnswerTransformer.h.

20 : TokenBroadcaster() {}

Member Function Documentation

◆ push() [1/2]

void knowrob::AnswerTransformer::push ( const TokenPtr tok)
inlineoverrideprotectedvirtual

Implements knowrob::TokenStream.

Definition at line 32 of file AnswerTransformer.h.

virtual TokenPtr transform(const TokenPtr &tok)=0
void push(const TokenPtr &tok) override

◆ push() [2/2]

void knowrob::AnswerTransformer::push ( const TokenPtr tok)
inlineoverrideprotectedvirtual

Reimplemented from knowrob::TokenBroadcaster.

Definition at line 32 of file AnswerTransformer.h.

◆ transform() [1/2]

virtual TokenPtr knowrob::AnswerTransformer::transform ( const TokenPtr tok)
pure virtual

Transform a token.

Parameters
tokthe token to transform.
Returns
the transformed token.

Implemented in knowrob::AnswerMerger, and knowrob::AnswerMerger.

◆ transform() [2/2]

virtual TokenPtr knowrob::AnswerTransformer::transform ( const TokenPtr tok)
pure virtual

Transform a token.

Parameters
tokthe token to transform.
Returns
the transformed token.

Implemented in knowrob::AnswerMerger, and knowrob::AnswerMerger.


The documentation for this class was generated from the following file: