knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
AnswerTransformer.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_ANSWER_TRANSFORMER_H
7 #define KNOWROB_ANSWER_TRANSFORMER_H
8 
9 #include <knowrob/queries/Answer.h>
10 #include <knowrob/queries/TokenBroadcaster.h>
11 
12 #include <utility>
13 
14 namespace knowrob {
18  class AnswerTransformer : public TokenBroadcaster {
19  public:
21 
27  virtual TokenPtr transform(const TokenPtr &tok) = 0;
28 
29  protected:
30 
31  // Override AnswerStream
32  void push(const TokenPtr &tok) override { TokenBroadcaster::push(transform(tok)); }
33  };
34 
35 } // knowrob
36 
37 #endif //KNOWROB_ANSWER_TRANSFORMER_H
void push(const TokenPtr &tok) override
virtual TokenPtr transform(const TokenPtr &tok)=0
void push(const TokenPtr &tok) override
std::shared_ptr< const Token > TokenPtr
Definition: Token.h:74