38 #ifndef __GECODE_FLATZINC_SYMBOLTABLE_HH__
39 #define __GECODE_FLATZINC_SYMBOLTABLE_HH__
43 #ifdef GECODE_HAS_GNU_HASH_MAP
44 #include <ext/hash_map>
49 namespace Gecode {
namespace FlatZinc {
55 #ifdef GECODE_HAS_GNU_HASH_MAP
58 size_t operator ()(
const std::string&
x)
const {
59 return __gnu_cxx::hash<const char*>()(x.c_str());
62 typedef __gnu_cxx::hash_map<std::string,Val,hashString> mymap;
64 typedef std::map<std::string,Val> mymap;
69 bool put(
const std::string& key,
const Val& val);
71 bool get(
const std::string& key, Val& val)
const;
77 typename mymap::const_iterator
i = m.find(key);
78 bool fresh = (i == m.end());
86 typename mymap::const_iterator
i = m.find(key);
Gecode::IntArgs i(4, 1, 2, 3, 4)
Symbol table mapping identifiers (strings) to values.
bool get(const std::string &key, Val &val) const
Return whether key exists, and set val if it does exist.
bool put(const std::string &key, const Val &val)
Insert val with key.
Node * x
Pointer to corresponding Boolean expression node.
Gecode toplevel namespace