converters/log.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef CONVERTERS_LOG_HPP
19 #define CONVERTERS_LOG_HPP
20 
21 #include <rosgraph_msgs/Log.h>
22 
24 #include "converter_base.hpp"
25 
26 #include <qicore/logmanager.hpp>
27 #include <qicore/loglistener.hpp>
28 
29 namespace naoqi
30 {
31 namespace converter
32 {
33 
34 class LogConverter : public BaseConverter<LogConverter>
35 {
36 
37  typedef boost::function<void(rosgraph_msgs::Log&) > Callback_t;
38 
39 public:
40  LogConverter( const std::string& name, float frequency, const qi::SessionPtr& sessions );
41 
42  void reset( );
43 
44  void registerCallback( const message_actions::MessageAction action, Callback_t cb );
45 
46  void callAll( const std::vector<message_actions::MessageAction>& actions );
47 
48 private:
50  void set_qi_logger_level();
51 
52  qi::LogManagerPtr logger_;
54  qi::LogLevel log_level_;
55  qi::LogListenerPtr listener_;
56 
57  std::map<message_actions::MessageAction, Callback_t> callbacks_;
58 };
59 
60 } //publisher
61 } //naoqi
62 
63 #endif
void callAll(const std::vector< message_actions::MessageAction > &actions)
boost::function< void(rosgraph_msgs::Log &) > Callback_t
std::map< message_actions::MessageAction, Callback_t > callbacks_
LogConverter(const std::string &name, float frequency, const qi::SessionPtr &sessions)
void registerCallback(const message_actions::MessageAction action, Callback_t cb)


naoqi_driver
Author(s): Karsten Knese
autogenerated on Sat Feb 15 2020 03:24:26