summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/util/common_type/assoc/detail
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/util/common_type/assoc/detail')
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp98
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp255
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp97
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp99
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp93
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp95
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp82
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp73
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp73
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp73
-rw-r--r--libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp141
11 files changed, 1179 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp
new file mode 100644
index 000000000..0410ec977
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/comb_hash_fn_string_form.hpp
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file comb_hash_fn_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_COMB_HASH_FN_STRING_FORM_HPP
+#define PB_DS_COMB_HASH_FN_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+namespace test
+{
+namespace detail
+{
+
+ template<typename Comb_Hash_Fn>
+ struct comb_hash_fn_string_form
+ {
+ static std::string
+ name()
+ { return (Comb_Hash_Fn::name()); }
+
+ static std::string
+ desc()
+ { return (Comb_Hash_Fn::desc()); }
+ };
+
+ template<typename Size_Type>
+ struct comb_hash_fn_string_form<
+ direct_mask_range_hashing_t_<
+ Size_Type> >
+ {
+ static std::string
+ name()
+ { return ("mask_"); }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("Comb_Hash_Fn", "value", "direct_mask_range_hashing");
+ }
+ };
+
+ template<typename Size_Type>
+ struct comb_hash_fn_string_form<direct_mod_range_hashing_t_<Size_Type> >
+ {
+ static std::string
+ name()
+ { return ("mod_"); }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("Comb_Hash_Fn", "value", "direct_mod_range_hashing");
+ }
+ };
+
+} // namespace detail
+} // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_COMB_HASH_FN_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp
new file mode 100644
index 000000000..9ee5c4dd7
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/ds_string_form.hpp
@@ -0,0 +1,255 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ds_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_DS_STRING_FORM_HPP
+#define PB_DS_DS_STRING_FORM_HPP
+
+#include <string>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <common_type/assoc/detail/list_update_policy_string_form.hpp>
+#include <common_type/assoc/detail/comb_hash_fn_string_form.hpp>
+#include <common_type/assoc/detail/resize_policy_string_form.hpp>
+#include <common_type/assoc/detail/probe_fn_string_form.hpp>
+#include <common_type/assoc/detail/tree_supports_order_statistics.hpp>
+#include <common_type/assoc/detail/trie_supports_order_statistics.hpp>
+#include <common_type/assoc/detail/trie_supports_prefix_search.hpp>
+#include <common_type/assoc/detail/store_hash_string_form.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+ namespace test
+ {
+ namespace detail
+ {
+ template<typename Cntnr, class Tag>
+ struct ds_string_form;
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::cc_hash_tag>
+ {
+ static std::string
+ name()
+ {
+ return ("cc_hash_" +
+ comb_hash_fn_string_form<typename Cntnr::comb_hash_fn>::name() +
+ resize_policy_string_form<typename Cntnr::resize_policy>::name() +
+ store_hash_string_form<Cntnr::store_hash>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string comb_hash_fn_desc =
+ comb_hash_fn_string_form<typename Cntnr::comb_hash_fn>::desc();
+
+ const std::string resize_policy_desc =
+ resize_policy_string_form<typename Cntnr::resize_policy>::desc();
+
+ const std::string store_hash_desc =
+ store_hash_string_form<Cntnr::store_hash>::desc();
+
+ return (make_xml_tag("type", "value", "cc_hash_table", comb_hash_fn_desc + resize_policy_desc + store_hash_desc));
+ }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::gp_hash_tag>
+ {
+ static std::string
+ name()
+ {
+ return ("gp_hash_" +
+ comb_hash_fn_string_form<typename Cntnr::comb_probe_fn>::name() +
+ probe_fn_string_form<typename Cntnr::probe_fn>::name() +
+ resize_policy_string_form<typename Cntnr::resize_policy>::name() +
+ store_hash_string_form<Cntnr::store_hash>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string comb_probe_fn_desc =
+ comb_hash_fn_string_form<typename Cntnr::comb_probe_fn>::desc();
+
+ const std::string probe_fn_desc =
+ probe_fn_string_form<typename Cntnr::probe_fn>::desc();
+
+ const std::string resize_policy_desc =
+ resize_policy_string_form<typename Cntnr::resize_policy>::desc();
+
+ const std::string store_hash_desc =
+ store_hash_string_form<Cntnr::store_hash>::desc();
+
+ return make_xml_tag("type", "value", "gp_hash_table",
+ comb_probe_fn_desc + probe_fn_desc + resize_policy_desc + store_hash_desc);
+ }
+ };
+
+ template<typename Cntnr>
+ struct tree_ds_string_form
+ {
+ static std::string
+ name(const std::string container_category_str)
+ {
+ if (tree_supports_order_statistics<Cntnr>::value)
+ return (container_category_str + "ost_");
+ return container_category_str;
+ }
+
+ static std::string
+ desc(const std::string container_category_str)
+ {
+ const std::string category_str =
+ make_xml_tag("Tag", "value", container_category_str);
+
+ const std::string node_update_str =
+ make_xml_tag("Node_Update",
+ "value",(tree_supports_order_statistics<Cntnr>::value ?
+ "tree_order_statistics_node_update" : "null_tree_node_update"));
+
+ return make_xml_tag("type", "value", "tree", category_str + node_update_str);
+ }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::rb_tree_tag>
+ : private tree_ds_string_form<Cntnr>
+ {
+ private:
+ typedef tree_ds_string_form< Cntnr> base_type;
+
+ public:
+ static std::string
+ name()
+ { return base_type::name("rb_tree_"); }
+
+ static std::string
+ desc()
+ { return base_type::desc("rb_tree_tag"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::splay_tree_tag>
+ : private tree_ds_string_form<Cntnr>
+ {
+ private:
+ typedef tree_ds_string_form< Cntnr> base_type;
+
+ public:
+ static std::string
+ name()
+ { return base_type::name("splay_tree_"); }
+
+ static std::string
+ desc()
+ { return base_type::desc("splay_tree_tag"); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::ov_tree_tag>
+ : private tree_ds_string_form<Cntnr>
+ {
+ private:
+ typedef tree_ds_string_form< Cntnr> base_type;
+
+ public:
+ static std::string
+ name()
+ { return (base_type::name("ov_tree_")); }
+
+ static std::string
+ desc()
+ { return (base_type::desc("ov_tree_tag")); }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::list_update_tag>
+ {
+ static std::string
+ name()
+ {
+ return ("lu_" +
+ lu_policy_string_form<typename Cntnr::update_policy>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("type", "value", "list_update",
+ lu_policy_string_form<typename Cntnr::update_policy>::desc());
+ }
+ };
+
+ template<typename Cntnr>
+ struct ds_string_form<Cntnr, __gnu_pbds::pat_trie_tag>
+ {
+ static std::string
+ name()
+ {
+ if (trie_supports_order_statistics<Cntnr>::value)
+ return ("pat_trie_ost_");
+
+ if (trie_supports_prefix_search<Cntnr>::value)
+ return ("pat_trie_prs_");
+
+ return ("pat_trie_");
+ }
+
+ static std::string
+ desc()
+ {
+ std::string category_s = make_xml_tag("Tag", "value", "pat_trie_tag");
+ const char* s;
+ if (trie_supports_order_statistics<Cntnr>::value)
+ s = "trie_order_statistics_node_update";
+ else if (trie_supports_prefix_search<Cntnr>::value)
+ s = "trie_prefix_search_node_update";
+ else
+ s = "null_trie_node_update";
+ std::string node_s = make_xml_tag("Node_Update", "value", s);
+ return make_xml_tag("type", "value", "trie", category_s + node_s);
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_DS_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp
new file mode 100644
index 000000000..ed3747fa1
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/list_update_policy_string_form.hpp
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file lu_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_LU_POLICY_STRING_FORM_HPP
+#define PB_DS_LU_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Update_Policy>
+ struct lu_policy_string_form;
+
+ template<>
+ struct lu_policy_string_form<move_to_front_lu_policy_t_>
+ {
+ static std::string
+ name()
+ { return ("mtf_"); }
+
+ static std::string
+ desc()
+ {
+ return make_xml_tag("Update_Policy", "value",
+ "move_to_front_lu_policy");
+ }
+ };
+
+ template<typename Allocator, typename Allocator::size_type Max_Count>
+ struct lu_policy_string_form<counter_lu_policy_t_<Allocator, Max_Count> >
+ {
+ static std::string
+ name()
+ {
+ std::ostringstream ret;
+ ret << "cnt_" << Max_Count << "_";
+ return (ret.str());
+ }
+
+ static std::string
+ desc()
+ {
+ return (make_xml_tag("Update_Policy", "value", "counter_lu_policy",
+ "Max_Count", Max_Count));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_LU_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp
new file mode 100644
index 000000000..15cbbfda5
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/probe_fn_string_form.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file probe_fn_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_PROBE_FN_STRING_FORM_HPP
+#define PB_DS_PROBE_FN_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Probe_Fn>
+ struct probe_fn_string_form;
+
+ template<typename Key, class Allocator>
+ struct probe_fn_string_form<linear_probe_fn_t_<Key, Allocator> >
+ {
+ static std::string
+ name()
+ { return ("linp_"); }
+
+ static std::string
+ desc()
+ { return make_xml_tag("Probe_Fn", "value", "linear_probe_fn"); }
+ };
+
+ template<typename Key, class Allocator>
+ struct probe_fn_string_form<quadratic_probe_fn_t_<Key, Allocator> >
+ {
+ static std::string
+ name()
+ { return ("quadp_"); }
+
+ static std::string
+ desc()
+ { return make_xml_tag("Probe_Fn", "value", "quadratic_probe_fn"); }
+ };
+
+ template<>
+ struct probe_fn_string_form<__gnu_pbds::null_probe_fn>
+ {
+ static std::string
+ name()
+ { return (""); }
+
+ static std::string
+ desc()
+ { return make_xml_tag("Probe_Fn", "value", "null_probe_fn"); }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PROBE_FN_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp
new file mode 100644
index 000000000..8d5b68698
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/resize_policy_string_form.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_RESIZE_POLICY_STRING_FORM_HPP
+#define PB_DS_RESIZE_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/detail/size_policy_string_form.hpp>
+#include <common_type/assoc/detail/trigger_policy_string_form.hpp>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Resize_Policy>
+ struct resize_policy_string_form;
+
+ template<typename Size_Policy,
+ class Trigger_Policy,
+ bool External_Size_Access,
+ typename Size_Type>
+ struct resize_policy_string_form<
+ __gnu_pbds::hash_standard_resize_policy<
+ Size_Policy, Trigger_Policy, External_Size_Access, Size_Type> >
+ {
+ static std::string
+ name()
+ {
+ return (size_policy_string_form<Size_Policy>::name() +
+ trigger_policy_string_form<Trigger_Policy>::name());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string size_policy_string_form_desc =
+ size_policy_string_form<Size_Policy>::desc();
+
+ const std::string trigger_policy_string_form_desc =
+ trigger_policy_string_form<Trigger_Policy>::desc();
+
+ return (make_xml_tag("Resize_Policy", "value", "hash_standard_resize_policy", size_policy_string_form_desc + trigger_policy_string_form_desc));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_RESIZE_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp
new file mode 100644
index 000000000..d2b61facb
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/size_policy_string_form.hpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file size_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_SIZE_POLICY_STRING_FORM_HPP
+#define PB_DS_SIZE_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/detail/size_policy_string_form.hpp>
+#include <common_type/assoc/detail/trigger_policy_string_form.hpp>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Size_Policy>
+ struct size_policy_string_form;
+
+ template<typename Allocator>
+ struct size_policy_string_form<
+ __gnu_pbds::test::hash_exponential_size_policy_t_<Allocator> >
+ {
+ static std::string
+ name()
+ { return ("exp_"); }
+
+ static std::string
+ desc()
+ {
+ return (make_xml_tag("Size_Policy", "value", "hash_exponential_size_policy"));
+ }
+ };
+
+ template<>
+ struct size_policy_string_form<
+ __gnu_pbds::test::hash_prime_size_policy_t_>
+ {
+ static std::string
+ name()
+ { return ("prime_"); }
+
+ static std::string
+ desc()
+ {
+ return (make_xml_tag("Size_Policy", "value", "hash_prime_size_policy"));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_SIZE_POLICY_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp
new file mode 100644
index 000000000..a932948fa
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/store_hash_string_form.hpp
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file store_hash_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_STORE_HASH_STRING_FORM_HPP
+#define PB_DS_STORE_HASH_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<bool Store_Hash>
+ struct store_hash_string_form
+ {
+ static std::string
+ name()
+ { return ("sth_"); }
+
+ static std::string
+ desc()
+ { return (make_xml_tag("Store_Hash", "value", "true")); }
+ };
+
+ template<>
+ struct store_hash_string_form<false>
+ {
+ static std::string
+ name()
+ { return ("nsth_"); }
+
+ static std::string
+ desc()
+ { return (make_xml_tag("Store_Hash", "value", "false")); }
+ };
+
+ } // namespace detail
+ } // namespace test
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_STORE_HASH_STRING_FORM_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp
new file mode 100644
index 000000000..80c1abe54
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/tree_supports_order_statistics.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_supports_order_statistics.hpp
+ * Checks whether a tree supports order statistics.
+ */
+
+#ifndef PB_DS_TREE_SUPPORTS_ORDER_STATISTICS_HPP
+#define PB_DS_TREE_SUPPORTS_ORDER_STATISTICS_HPP
+
+#include <ext/pb_ds/tree_policy.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Tree_Cntnr>
+ struct tree_supports_order_statistics
+ {
+ enum
+ {
+ value = __gnu_pbds::detail::is_same<
+ typename Tree_Cntnr::node_update,
+ __gnu_pbds::tree_order_statistics_node_update<
+ typename Tree_Cntnr::const_node_iterator,
+ typename Tree_Cntnr::node_iterator,
+ typename Tree_Cntnr::cmp_fn,
+ typename Tree_Cntnr::allocator_type> >::value
+ };
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TREE_SUPPORTS_ORDER_STATISTICS_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp
new file mode 100644
index 000000000..fc9cacc63
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_order_statistics.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_supports_order_statistics.hpp
+ * Checks whether a trie supports order stats.
+ */
+
+#ifndef PB_DS_TRIE_SUPPORTS_ORDER_STATISTICS_HPP
+#define PB_DS_TRIE_SUPPORTS_ORDER_STATISTICS_HPP
+
+#include <ext/pb_ds/trie_policy.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Tree_Cntnr>
+ struct trie_supports_order_statistics
+ {
+ enum
+ {
+ value = __gnu_pbds::detail::is_same<
+ typename Tree_Cntnr::node_update,
+ __gnu_pbds::trie_order_statistics_node_update<
+ typename Tree_Cntnr::const_node_iterator,
+ typename Tree_Cntnr::node_iterator,
+ typename Tree_Cntnr::e_access_traits,
+ typename Tree_Cntnr::allocator_type> >::value
+ };
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_SUPPORTS_ORDER_STATISTICS_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp
new file mode 100644
index 000000000..20c521010
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trie_supports_prefix_search.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_supports_prefix_search.hpp
+ * Checks whether a trie supports prefix search.
+ */
+
+#ifndef PB_DS_TRIE_SUPPORTS_PREFIX_SEARCH_HPP
+#define PB_DS_TRIE_SUPPORTS_PREFIX_SEARCH_HPP
+
+#include <ext/pb_ds/trie_policy.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Tree_Cntnr>
+ struct trie_supports_prefix_search
+ {
+ enum
+ {
+ value = __gnu_pbds::detail::is_same<
+ typename Tree_Cntnr::node_update,
+ __gnu_pbds::trie_prefix_search_node_update<
+ typename Tree_Cntnr::const_node_iterator,
+ typename Tree_Cntnr::node_iterator,
+ typename Tree_Cntnr::e_access_traits,
+ typename Tree_Cntnr::allocator_type> >::value
+ };
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_SUPPORTS_PREFIX_SEARCH_HPP
+
diff --git a/libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp
new file mode 100644
index 000000000..be4fe264f
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/common_type/assoc/detail/trigger_policy_string_form.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trigger_policy_string_form.hpp
+ * Transforms containers into string form.
+ */
+
+#ifndef PB_DS_TRIGGER_POLICY_STRING_FORM_HPP
+#define PB_DS_TRIGGER_POLICY_STRING_FORM_HPP
+
+#include <string>
+#include <common_type/assoc/template_policy.hpp>
+#include <io/xml.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace test
+ {
+
+ namespace detail
+ {
+
+ template<typename Trigger_Policy>
+ struct trigger_policy_string_form;
+
+ template<typename Allocator,
+ typename Allocator::size_type Min_Load_Nom,
+ typename Allocator::size_type Min_Load_Denom,
+ typename Allocator::size_type Max_Load_Nom,
+ typename Allocator::size_type Max_Load_Denom,
+ bool External_Access>
+ struct trigger_policy_string_form<
+ __gnu_pbds::test::hash_load_check_resize_trigger_t_<
+ Allocator,
+ Min_Load_Nom,
+ Min_Load_Denom,
+ Max_Load_Nom,
+ Max_Load_Denom,
+ External_Access> >
+ {
+ static std::string
+ name()
+ {
+ std::ostringstream ret;
+
+ ret << (External_Access? "": "n") << "ea_"
+ "lc_" << Min_Load_Nom << "div" << Min_Load_Denom << "_" <<
+ Max_Load_Nom << "div" << Max_Load_Denom << "_";
+
+ return (ret.str());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string ext_access_desc =
+ make_xml_tag("External_Access",
+ "value",(External_Access? "true" : "false"));
+
+ const std::string loads_desc =
+ make_xml_tag("alpha_min", "nom", Min_Load_Nom, "denom", Min_Load_Denom) +
+ make_xml_tag("alpha_max", "nom", Max_Load_Nom, "denom", Max_Load_Denom);
+
+ return (make_xml_tag("Trigger_Policy", "value", "hash_load_check_resize_trigger", ext_access_desc + loads_desc));
+ }
+ };
+
+ template<typename Allocator,
+ typename Allocator::size_type Load_Nom,
+ typename Allocator::size_type Load_Denom,
+ bool External_Access>
+ struct trigger_policy_string_form<
+ __gnu_pbds::test::cc_hash_max_collision_check_resize_trigger_t_<
+ Allocator,
+ Load_Nom,
+ Load_Denom,
+ External_Access> >
+ {
+ static std::string
+ name()
+ {
+ std::ostringstream ret;
+
+ ret << (External_Access? "": "n") << "ea_"
+ "mcolc_" << Load_Nom << "div" << Load_Denom << "_";
+
+ return (ret.str());
+ }
+
+ static std::string
+ desc()
+ {
+ const std::string ext_access_desc =
+ make_xml_tag("External_Access",
+ "value",(External_Access? "true" : "false"));
+
+ const std::string load_desc =
+ make_xml_tag("alpha", "nom", Load_Nom, "denom", Load_Denom);
+
+ return (make_xml_tag("Trigger_Policy", "value", "cc_hash_max_collision_check_resize_trigger", ext_access_desc + load_desc));
+ }
+ };
+
+ } // namespace detail
+
+ } // namespace test
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIGGER_POLICY_STRING_FORM_HPP
+