Fawkes API  Fawkes Development Version
map_skill.h
1 /***************************************************************************
2  * map_skill.h - Skill mapping function
3  *
4  * Created: Tue Sep 26 16:15:00 2017
5  * Copyright 2017 Tim Niemueller [www.niemueller.de]
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #include <map>
22 #include <regex>
23 #include <string>
24 
25 namespace fawkes {
26 
28 {
29 public:
31  ActionSkillMapping(std::map<std::string, std::string> &mappings);
32 
33  void add_mapping(const std::string &action_name, const std::string &skill_string_template);
34  bool has_mapping(const std::string &action_name) const;
35 
36  std::string map_skill(const std::string & name,
37  const std::map<std::string, std::string> &params,
38  std::multimap<std::string, std::string> & messages) const;
39 
40 private:
41  std::map<std::string, std::string> mappings_;
42 };
43 
44 } // namespace fawkes
std::string map_skill(const std::string &name, const std::map< std::string, std::string > &params, std::multimap< std::string, std::string > &messages) const
Perform mapping.
Definition: map_skill.cpp:139
Fawkes library namespace.
void add_mapping(const std::string &action_name, const std::string &skill_string_template)
Add another mapping.
Definition: map_skill.cpp:114
ActionSkillMapping()
Constructor.
Definition: map_skill.cpp:97
Class to maintain and perform mapping from actions to skills.
Definition: map_skill.h:27
bool has_mapping(const std::string &action_name) const
Check if mapping for an action exists.
Definition: map_skill.cpp:125