⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 assoc_cntnr.hpp

📁 linux下编程用 编译软件
💻 HPP
📖 第 1 页 / 共 3 页
字号:
#include <ext/pb_assoc/detail/basic_assoc_cntnr/iterators_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/info_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/erase_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/insert_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/d_insert_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/d_find_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/d_extract_key.hpp>#undef PB_ASSOC_CLASS_T_DEC#undef PB_ASSOC_CLASS_C_DEC#undef PB_ASSOC_BASE_C_DEC#undef PB_ASSOC_DIRECT_BASE_C_DEC#define PB_ASSOC_CLASS_T_DEC \	template<typename Key, class DS_Tag, class Policy_Tl, class Allocator>#define PB_ASSOC_CLASS_C_DEC \	basic_assoc_cntnr< \		Key, \		null_data_type, \		DS_Tag, \		Policy_Tl, \		Allocator>#define PB_ASSOC_BASE_C_DEC \	detail::assoc_cntnr_base< \		Key, \		null_data_type, \		DS_Tag, \		Policy_Tl, \		Allocator>::type  template<typename Key, class DS_Tag, class Policy_Tl, class Allocator>  class basic_assoc_cntnr<Key, null_data_type, DS_Tag, Policy_Tl, Allocator> : public PB_ASSOC_BASE_C_DEC  {  public:    typedef typename Allocator::size_type size_type;    typedef typename Allocator::difference_type difference_type;    typedef DS_Tag ds_category;    typedef basic_ms_tag ms_category;    typedef Allocator allocator;    typedef    typename allocator::template rebind<      Key>::other::value_type    key_type;    typedef    typename allocator::template rebind<      Key>::other::reference    key_reference;    typedef    typename allocator::template rebind<      Key>::other::const_reference    const_key_reference;    typedef    typename allocator::template rebind<      Key>::other::pointer    key_pointer;    typedef    typename allocator::template rebind<      Key>::other::const_pointer    const_key_pointer;    typedef    typename allocator::template rebind<      key_type>::other::value_type    value_type;    typedef    typename allocator::template rebind<      key_type>::other::const_reference    reference;    typedef    typename allocator::template rebind<      key_type>::other::const_reference    const_reference;    typedef    typename allocator::template rebind<      key_type>::other::const_pointer    pointer;    typedef    typename allocator::template rebind<key_type>::other::const_pointer    const_pointer;    typedef    typename PB_ASSOC_BASE_C_DEC::const_find_iterator    const_find_iterator;    typedef typename PB_ASSOC_BASE_C_DEC::find_iterator find_iterator;    typedef typename PB_ASSOC_BASE_C_DEC::const_iterator const_iterator;    typedef typename PB_ASSOC_BASE_C_DEC::iterator iterator;  public:    virtual    ~basic_assoc_cntnr();    inline size_type    size() const;    inline size_type    max_size() const;    inline bool    empty() const;    inline static const_key_reference    extract_key(const_reference r_val);    inline std::pair<find_iterator, bool>    insert(const_reference r_val);    inline find_iterator    find(const_key_reference r_key)    { return (my_base::find(r_key)); }    inline const_find_iterator    find(const_key_reference r_key) const    { return (my_base::find(r_key)); }    inline size_type    erase(const_key_reference r_key);    template<class Pred>    inline size_type    erase_if(Pred prd);    void    clear();    inline iterator    begin();    inline const_iterator    begin() const;    inline iterator    end();    inline const_iterator    end() const;  protected:#define PB_ASSOC_CLASS_NAME basic_assoc_cntnr#define PB_ASSOC_DIRECT_BASE_C_DEC PB_ASSOC_BASE_C_DEC#define PB_ASSOC_DIRECT_BASE_CAST_C_DEC \	typename PB_ASSOC_DIRECT_BASE_C_DEC#include <ext/pb_assoc/detail/constructors_destructor_fn_imps.hpp>#undef PB_ASSOC_DIRECT_BASE_CAST_C_DEC#undef PB_ASSOC_DIRECT_BASE_C_DEC#undef PB_ASSOC_CLASS_NAME  private:    typedef typename PB_ASSOC_BASE_C_DEC my_base;  private:    basic_assoc_cntnr&     operator=(const PB_ASSOC_CLASS_C_DEC& r_other);  };#include <ext/pb_assoc/detail/basic_assoc_cntnr/constructors_destructor_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/iterators_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/info_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/erase_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/insert_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_assoc_cntnr/extract_key.hpp>#undef PB_ASSOC_CLASS_T_DEC#undef PB_ASSOC_CLASS_C_DEC#undef PB_ASSOC_BASE_C_DEC#define PB_ASSOC_TYPELIST_CHAIN1(X0) pb_assoc::detail::typelist_chain<X0, pb_assoc::detail::null_type>#define PB_ASSOC_TYPELIST_CHAIN2(X0, X1) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN1(X1) >#define PB_ASSOC_TYPELIST_CHAIN3(X0, X1, X2) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN2(X1, X2) >#define PB_ASSOC_TYPELIST_CHAIN4(X0, X1, X2, X3) pb_assoc::detail::typelist_chain<X0,  PB_ASSOC_TYPELIST_CHAIN3(X1, X2, X3) >#define PB_ASSOC_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) pb_assoc::detail::typelist_chain<X0,  PB_ASSOC_TYPELIST_CHAIN4(X1, X2, X3, X4) >#define PB_ASSOC_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) >#define PB_ASSOC_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) >#define PB_ASSOC_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) >#define PB_ASSOC_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) >#define PB_ASSOC_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) >#define PB_ASSOC_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) >#define PB_ASSOC_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) >#define PB_ASSOC_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >#define PB_ASSOC_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >#define PB_ASSOC_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) pb_assoc::detail::typelist_chain<X0, PB_ASSOC_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >#define PB_ASSOC_CLASS_T_DEC \	template< \		typename Key, \		typename Data, \		class Hash_Fn, \		class Eq_Fn, \		class Resize_Policy, \		bool Store_Hash, \		class DS_Tag, \		class Policy_TL, \		class Allocator>#define PB_ASSOC_CLASS_C_DEC \	basic_hash_assoc_cntnr< \		Key, \		Data, \		Hash_Fn, \		Eq_Fn, \		Resize_Policy, \		Store_Hash, \		DS_Tag, \		Policy_TL, \		Allocator>#define PB_ASSOC_BASE_C_DEC \	basic_assoc_cntnr< \		Key, \		Data, \		DS_Tag, \		typename pb_assoc::detail::typelist_append< \			pb_assoc::detail::typelist< \				PB_ASSOC_TYPELIST_CHAIN4( Hash_Fn, Eq_Fn, Resize_Policy, pb_assoc::detail::int_to_type<Store_Hash>) >, \				Policy_TL>::type, \		Allocator>  template<typename Key,	   typename Data,	   class Hash_Fn,	   class Eq_Fn,	   class Resize_Policy,	   bool Store_Hash,	   class DS_Tag,	   class Policy_TL,	   class Allocator>  class basic_hash_assoc_cntnr : public PB_ASSOC_BASE_C_DEC  {  public:    typedef Hash_Fn hash_fn;    typedef Eq_Fn eq_fn;    typedef Resize_Policy resize_policy;    enum      {	store_hash = Store_Hash      };    virtual    ~basic_hash_assoc_cntnr();    hash_fn&     get_hash_fn();    const hash_fn&     get_hash_fn() const;    eq_fn&     get_eq_fn();    const eq_fn&     get_eq_fn() const;    Resize_Policy&     get_resize_policy();    const resize_policy&     get_resize_policy() const;  protected:    typedef typename Allocator::size_type size_type;    virtual void    do_resize(size_type new_size);#define PB_ASSOC_CLASS_NAME basic_hash_assoc_cntnr#define PB_ASSOC_DIRECT_BASE_C_DEC PB_ASSOC_BASE_C_DEC#define PB_ASSOC_DIRECT_BASE_CAST_C_DEC \	PB_ASSOC_DIRECT_BASE_C_DEC#include <ext/pb_assoc/detail/constructors_destructor_fn_imps.hpp>#undef PB_ASSOC_DIRECT_BASE_C_DEC#undef PB_ASSOC_CLASS_NAME#undef PB_ASSOC_DIRECT_BASE_C_DEC  private:    typedef PB_ASSOC_BASE_C_DEC my_base;    basic_hash_assoc_cntnr&     operator=(const PB_ASSOC_CLASS_C_DEC& r_other);  };#include <ext/pb_assoc/detail/basic_hash_assoc_cntnr/constructors_destructor_fn_imps.hpp>#include <ext/pb_assoc/detail/basic_hash_assoc_cntnr/resize_fn_imps.hpp>#undef PB_ASSOC_CLASS_T_DEC#undef PB_ASSOC_CLASS_C_DEC#undef PB_ASSOC_BASE_C_DEC#define PB_ASSOC_CLASS_T_DEC \	template< \		typename Key, \		typename Data, \		class Hash_Fn, \		class Eq_Fn, \		class Comb_Hash_Fn, \		class Resize_Policy, \		bool Store_Hash, \		class Allocator>#define PB_ASSOC_CLASS_C_DEC \	cc_hash_assoc_cntnr< \		Key, \		Data, \		Hash_Fn, \		Eq_Fn, \		Comb_Hash_Fn, \		Resize_Policy, \		Store_Hash, \		Allocator>#define PB_ASSOC_BASE_C_DEC \	basic_hash_assoc_cntnr< \		Key, \		Data, \		Hash_Fn, \		Eq_Fn, \		Resize_Policy, \		Store_Hash, \		cc_hash_ds_tag, \		pb_assoc::detail::typelist< \			PB_ASSOC_TYPELIST_CHAIN1( \				Comb_Hash_Fn) >, \		Allocator>  template<typename Key,	   typename Data,	   class Hash_Fn = typename pb_assoc::detail::def_hash_fn<Key>::type,	   class Eq_Fn = typename pb_assoc::detail::def_eq_fn<Key>::type,	   class Comb_Hash_Fn = pb_assoc::detail::def_comb_hash_fn::type,	   class Resize_Policy =	   typename pb_assoc::detail::def_resize_policy<Comb_Hash_Fn>::type,	   bool Store_Hash = pb_assoc::detail::def_store_hash,	   class Allocator = std::allocator<char> >  class cc_hash_assoc_cntnr : public PB_ASSOC_BASE_C_DEC  {  public:    typedef Comb_Hash_Fn comb_hash_fn;    cc_hash_assoc_cntnr();    cc_hash_assoc_cntnr(const Hash_Fn& r_hash_fn);    cc_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn);    cc_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, 			const Comb_Hash_Fn& r_comb_hash_fn);    cc_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, 			const Comb_Hash_Fn& r_comb_hash_fn, 			const Resize_Policy& r_resize_policy);    template<class It>    cc_hash_assoc_cntnr(It first_it, It last_it);    template<class It>    cc_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn);    template<class It>    cc_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, 			const Eq_Fn& r_eq_fn);    template<class It>    cc_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Hash_Fn& r_comb_hash_fn);    template<class It>    cc_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Hash_Fn& r_comb_hash_fn, const Resize_Policy& r_resize_policy);    cc_hash_assoc_cntnr(const PB_ASSOC_CLASS_C_DEC& r_other);    virtual    ~cc_hash_assoc_cntnr();    PB_ASSOC_CLASS_C_DEC&     operator=(const PB_ASSOC_CLASS_C_DEC& r_other);    void    swap(PB_ASSOC_CLASS_C_DEC& r_other);    comb_hash_fn&     get_comb_hash_fn();    const comb_hash_fn&     get_comb_hash_fn() const;  private:    typedef PB_ASSOC_BASE_C_DEC my_base;  };#include <ext/pb_assoc/detail/cc_hash_assoc_cntnr/constructor_destructor_fn_imps.hpp>#undef PB_ASSOC_CLASS_T_DEC#undef PB_ASSOC_CLASS_C_DEC#undef PB_ASSOC_BASE_C_DEC#define PB_ASSOC_CLASS_T_DEC \	template< \		typename Key, \		typename Data, \		class Hash_Fn, \		class Eq_Fn, \		class Comb_Probe_Fn, \		class Probe_Fn, \		class Resize_Policy, \		bool Store_Hash, \		class Allocator>#define PB_ASSOC_CLASS_C_DEC \	gp_hash_assoc_cntnr< \		Key, \		Data, \		Hash_Fn, \		Eq_Fn, \		Comb_Probe_Fn, \		Probe_Fn, \		Resize_Policy, \		Store_Hash, \		Allocator>#define PB_ASSOC_BASE_C_DEC \	basic_hash_assoc_cntnr< \		Key, \		Data, \		Hash_Fn, \		Eq_Fn, \		Resize_Policy, \		Store_Hash, \		gp_hash_ds_tag, \		pb_assoc::detail::typelist< \			PB_ASSOC_TYPELIST_CHAIN2( Comb_Probe_Fn, Probe_Fn) >, \		Allocator>  template<typename Key,	   typename Data,	   class Hash_Fn = typename pb_assoc::detail::def_hash_fn<Key>::type,	   class Eq_Fn = typename pb_assoc::detail::def_eq_fn<Key>::type,	   class Comb_Probe_Fn = pb_assoc::detail::def_comb_hash_fn::type,	   class Probe_Fn = typename detail::def_probe_fn<Comb_Probe_Fn>::type,	   class Resize_Policy =	   typename pb_assoc::detail::def_resize_policy<Comb_Probe_Fn>::type,	   bool Store_Hash = pb_assoc::detail::def_store_hash,	   class Allocator = std::allocator<char> >  class gp_hash_assoc_cntnr : public PB_ASSOC_BASE_C_DEC  {  public:    typedef Comb_Probe_Fn comb_probe_fn;    typedef Probe_Fn probe_fn;    gp_hash_assoc_cntnr();    gp_hash_assoc_cntnr(const Hash_Fn& r_hash_fn);    gp_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn);    gp_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, 			const Comb_Probe_Fn& r_comb_probe_fn);    gp_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, 			const Comb_Probe_Fn& r_comb_probe_fn, 			const Probe_Fn& r_probe_fn);    gp_hash_assoc_cntnr(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, 			const Comb_Probe_Fn& r_comb_probe_fn, 			const Probe_Fn& r_probe_fn, 			const Resize_Policy& r_resize_policy);    template<class It>    gp_hash_assoc_cntnr(It first_it, It last_it);    template<class It>    gp_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn);    template<class It>    gp_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn);    template<class It>    gp_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Probe_Fn& r_comb_probe_fn);    template<class It>    gp_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Probe_Fn& r_comb_probe_fn, const Probe_Fn& r_probe_fn);    template<class It>    gp_hash_assoc_cntnr(It first_it, It last_it, const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Probe_Fn& r_comb_probe_fn, const Probe_Fn& r_probe_fn, const Resize_Policy& r_resize_policy);    gp_hash_assoc_cntnr(const PB_ASSOC_CLASS_C_DEC& r_other);    virtual    ~gp_hash_assoc_cntnr();    PB_ASSOC_CLASS_C_DEC&     operator=(const PB_ASSOC_CLASS_C_DEC& r_other);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -