// (C) Copyright 2008-2009 SDML (www.sdml.info) // // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef KEY_TRAITS_HPP #define KEY_TRAITS_HPP #include // Forward declarations of standard types. namespace std { template class basic_string; template class vector; }; namespace gpld { // A couple of tags used to help differentiate operations between bitstring // iterable objects and element-iterable objects. struct bit_iterable_tag { }; struct element_iterable_tag { }; // TODO Implement this (later). template struct bitstring_iterator { }; /** * Key traits define information and functionality associated with the use of * different types as keys, especially the iterator type used when finding * or inserting elements in a prefix or suffix tree. */ template struct key_traits { typedef bit_iterable_tag category; typedef bitstring_iterator iterator; }; // A helper struct that defines element iterability for container overloads. template struct fwd_container_key_traits { typedef element_iterable_tag category; typedef typename Container::const_iterator iterator; }; // Specializations for common key types. template struct key_traits> : fwd_container_key_traits> { }; // TODO: Create more specializations as needed. } /* namespace gpld */ #endif