Fawkes API  Fawkes Development Version
protobuf_to_bb.cpp
1 
2 /***************************************************************************
3  * Protoboard plugin template
4  * - Templates that implement translation of incoming ProtoBuf messages
5  * to BlackBoard interfaces according to the appropriate template
6  * specializations
7  *
8  * Copyright 2019 Victor MatarĂ©
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL file in the doc directory.
22  */
23 
24 #include "protobuf_to_bb.h"
25 
26 namespace protoboard {
27 
28 pb_convert::pb_convert() : blackboard_(nullptr), logger_(nullptr)
29 {
30 }
31 
33 {
34 }
35 
36 void
37 pb_convert::init(fawkes::BlackBoard *blackboard, fawkes::Logger *logger, const std::string &)
38 {
39  blackboard_ = blackboard;
40  logger_ = logger;
41 }
42 
43 void
44 pb_convert::handle(std::shared_ptr<google::protobuf::Message> msg)
45 {
46  handle(*msg);
47 }
48 
49 void
50 pb_convert::handle(const google::protobuf::Message &)
51 {
52 }
53 
54 } // namespace protoboard
The BlackBoard abstract class.
Definition: blackboard.h:46
Interface for logging.
Definition: logger.h:42
fawkes::Logger * logger_
Logger from the main thread.
pb_convert()
Empty-init constructor.
virtual void init(fawkes::BlackBoard *blackboard, fawkes::Logger *logger, const std::string &="")
Deferred initialization.
virtual void handle(std::shared_ptr< google::protobuf::Message > msg)
Dereference msg and pass it on to handle it by reference.
virtual ~pb_convert()
Destructor. Does nothing since members aren't owned by this class.
fawkes::BlackBoard * blackboard_
Blackboard used by the main thread.