naoqidriver
info.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 INFO_CONVERTER_HPP
19 #define INFO_CONVERTER_HPP
20 
21 /*
22 * LOCAL includes
23 */
24 #include "converter_base.hpp"
26 
27 /*
28 * ROS includes
29 */
30 #include <naoqi_bridge_msgs/StringStamped.h>
31 
32 
33 namespace naoqi
34 {
35 namespace converter
36 {
37 
38 class InfoConverter : public BaseConverter<InfoConverter>
39 {
40 
41  typedef boost::function<void(naoqi_bridge_msgs::StringStamped)> Callback_t;
42 
43 public:
44  InfoConverter( const std::string& name, float frequency, const qi::SessionPtr& sessions );
45 
46  void reset();
47 
48  void registerCallback( const message_actions::MessageAction action, Callback_t cb );
49 
50  void callAll( const std::vector<message_actions::MessageAction>& actions );
51 
52 private:
54  qi::AnyObject p_memory_;
55 
57  std::vector<std::string> keys_;
58  std::map<message_actions::MessageAction, Callback_t> callbacks_;
59 
60  naoqi_bridge_msgs::StringStamped msg_;
61 };
62 
63 } //converter
64 } //naoqi
65 
66 #endif
std::string name() const
Definition: converter_base.hpp:54
float frequency() const
Definition: converter_base.hpp:59
void registerCallback(const message_actions::MessageAction action, Callback_t cb)
Definition: info.cpp:64
MessageAction
Definition: message_actions.h:9
qi::AnyObject p_memory_
Definition: info.hpp:54
Definition: audio.cpp:29
InfoConverter(const std::string &name, float frequency, const qi::SessionPtr &sessions)
Definition: info.cpp:36
std::map< message_actions::MessageAction, Callback_t > callbacks_
Definition: info.hpp:58
Definition: converter_base.hpp:40
Definition: info.hpp:38
boost::function< void(naoqi_bridge_msgs::StringStamped)> Callback_t
Definition: info.hpp:41
std::vector< std::string > keys_
Definition: info.hpp:57
void callAll(const std::vector< message_actions::MessageAction > &actions)
Definition: info.cpp:69
naoqi_bridge_msgs::StringStamped msg_
Definition: info.hpp:60
void reset()
Definition: info.cpp:60