6 #include <ext/hash_map>
8 typedef std::vector<std::string> Literals;
9 typedef __gnu_cxx::hash_map<std::string,bool> Preconditions;
10 typedef __gnu_cxx::hash_map<int,Literals> EffectsMap;
14 template< typename CharT, typename Traits, typename Alloc >
15 struct hash< std::basic_string<CharT, Traits, Alloc> > {
16 size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
19 for (unsigned int i = 0; i < s.size(); ++i)
20 hash += static_cast<size_t>(s[i]);
21 return hash + s.size();
27 template< typename CharT, typename Traits, typename Alloc >
28 struct hash< const std::basic_string<CharT, Traits, Alloc> > { //yes you need this version aswell!
30 size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
33 for (unsigned int i = 0; i < s.size(); ++i)
34 hash += static_cast<size_t>(s[i]);
35 return hash + s.size();
42 Action(std::string name, const Preconditions& preconditions, std::string executable, const EffectsMap& effects);
43 Action(const Action& action);
45 const Literals& effects(int value) const;
46 const Preconditions& preconditions() const;
47 const std::string& name() const;
52 std::string _executable;
53 Preconditions _preconditions;
55 static const Literals _empty;