Rewrite all std::map<const formula*, ...> as
Sgi::hash_map<const formula*, ...>. * src/misc/hash.hh: New file. * src/misc/Makefile.am (misc_HEADERS): Add it. * src/ltlvisit/dotty.cc (dotty_visitor::map): Use a hash_map instead of a map. * src/tgba/bdddict.hh (bdd_dict::fv_map, bdd_dict::vf_map, bdd_dict::ref_set, bdd_dict::var_map): Define as hash_map or hash_set. * src/tgbaalgos/ltl2tgba_fm.cc (translate_dict::fv_map, translate_dict::vf_map): Likewise. * src/tgba/tgbabddconcretefactory.hh (tgba_bdd_concrete_factory::acc_map_): Likewise. * src/tgba/tgbatba.hh, src/tgbaalgos/reachiter.hh: Include <map>.
This commit is contained in:
parent
51094329d8
commit
1955150999
9 changed files with 76 additions and 10 deletions
40
src/misc/hash.hh
Normal file
40
src/misc/hash.hh
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef SPOT_MISC_HASH_HH
|
||||
# define SPOT_MISC_HASH_HH
|
||||
|
||||
// See the G++ FAQ for details about this.
|
||||
|
||||
# ifdef __GNUC__
|
||||
# if __GNUC__ < 3
|
||||
# include <hash_map.h>
|
||||
# include <hash_set.h>
|
||||
namespace Sgi { using ::hash_map; }; // inherit globals
|
||||
# else
|
||||
# include <ext/hash_map>
|
||||
# include <ext/hash_set>
|
||||
# if __GNUC_MINOR__ == 0
|
||||
namespace Sgi = std; // GCC 3.0
|
||||
# else
|
||||
namespace Sgi = ::__gnu_cxx; // GCC 3.1 and later
|
||||
# endif
|
||||
# endif
|
||||
# else // ... there are other compilers, right?
|
||||
# include <hash_map>
|
||||
# include <hash_set>
|
||||
namespace Sgi = std;
|
||||
# endif
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
||||
/// A hash function for pointers.
|
||||
template <class T>
|
||||
struct ptr_hash
|
||||
{
|
||||
size_t operator()(const T* f) const
|
||||
{
|
||||
return reinterpret_cast<const char*>(f) - static_cast<const char*>(0);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SPOT_MISC_HASH_HH
|
||||
Loading…
Add table
Add a link
Reference in a new issue