#ifndef __VOCAB_HASH_HH__ #define __VOCAB_HASH_HH__ // Copyright 2007 Timothy Brownawell // // This program is made available under the GNU GPL version 2.0 or // greater. See the accompanying file COPYING for details. // // This program is distributed WITHOUT ANY WARRANTY; without even the // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. #include "vocab.hh" #include "hash_map.hh" #define ENCODING(enc) \ namespace hashmap { \ template \ struct hash > \ { \ size_t operator()(enc const & t) const \ { \ return hash()(t()); \ } \ }; \ } #define DECORATE(dec) \ namespace hashmap { \ template \ struct hash > \ { \ size_t operator()(dec const & t) const \ { \ return hash()(t.inner()); \ } \ }; \ } #define ATOMIC(ty) \ namespace hashmap { \ template<> \ struct hash \ { \ size_t operator()(ty const & t) const \ { \ return hash()(t()); \ } \ }; \ } #define ATOMIC_NOVERIFY(ty) ATOMIC(ty) #include "vocab_terms.hh" #endif