26 #include <boost/foreach.hpp> 27 #define for_each BOOST_FOREACH 35 p_memory_(session->service(
"ALMemory")),
45 qi::AnyValue memData_anyvalue =
p_memory_.call<qi::AnyValue>(
"getListData",
_key_list);
48 _msg = naoqi_bridge_msgs::MemoryList();
50 _msg.header.stamp = now;
52 qi::AnyReferenceVector memData_anyref = memData_anyvalue.asListValuePtr();
54 for(
int i=0; i<memData_anyref.size();i++)
56 if(memData_anyref[i].content().kind() == qi::TypeKind_Int)
58 naoqi_bridge_msgs::MemoryPairInt tmp_msg;
60 tmp_msg.data = memData_anyref[i].content().asInt32();
61 _msg.ints.push_back(tmp_msg);
63 else if(memData_anyref[i].content().kind() == qi::TypeKind_Float)
65 naoqi_bridge_msgs::MemoryPairFloat tmp_msg;
67 tmp_msg.data = memData_anyref[i].content().asFloat();
68 _msg.floats.push_back(tmp_msg);
70 else if(memData_anyref[i].content().kind() == qi::TypeKind_String)
72 naoqi_bridge_msgs::MemoryPairString tmp_msg;
74 tmp_msg.data = memData_anyref[i].content().asString();
75 _msg.strings.push_back(tmp_msg);
void registerCallback(const message_actions::MessageAction action, Callback_t cb)
boost::function< void(naoqi_bridge_msgs::MemoryList &) > Callback_t
std::map< message_actions::MessageAction, Callback_t > callbacks_
virtual void callAll(const std::vector< message_actions::MessageAction > &actions)
std::vector< std::string > _key_list
MemoryListConverter(const std::vector< std::string > &key_list, const std::string &name, const float &frequency, const qi::SessionPtr &session)
naoqi_bridge_msgs::MemoryList _msg